plutus icon indicating copy to clipboard operation
plutus copied to clipboard

Introduce hashScriptWithPrefix which produces the ScriptHash corresponding to a SerialisedScript

Open colll78 opened this issue 1 year ago • 2 comments

The old versions of PlutusLedgerApi exposed the function scriptHash which could be used to produce the ScriptHash associated with a given SerialisedScript. The fact that the new PlutusLedgerApi does not expose such a function means these projects are forced to implement their own variant of the function (which often involves introducing crypto/hashing library dependencies) or introduce additional heavy dependencies such as CardanoApi. This PR introduces the function hashScriptWithPrefix to PlutusLedgerApi.Common so that downstream applications can avoid redundant work.

Pre-submit checklist:

  • Branch
    • [x] Tests are provided (if possible)
    • [x] Commit sequence broadly makes sense
    • [x] Key commits have useful messages
    • [x] Changelog fragments have been written (if appropriate)
    • [x] Relevant tickets are mentioned in commit messages
    • [x] Formatting, PNG optimization, etc. are updated
  • PR
    • [] (For external contributions) Corresponding issue exists and is linked in the description
    • [x] Targeting master unless this is a cherry-pick backport
    • [x] Self-reviewed the diff
    • [x] Useful pull request description
    • [x] Reviewer requested

colll78 avatar Sep 30 '24 21:09 colll78

@zliu41 Who should I request for review?

colll78 avatar Oct 02 '24 01:10 colll78

@effectfully

colll78 avatar Oct 04 '24 15:10 colll78