IntersectMBO / cardano-api

Cardano API
Apache License 2.0
22 stars 20 forks source link

Remove redundant `Maybe ScriptHash` from `PReferenceScript` #606

Open Swordlash opened 1 month ago

Swordlash commented 1 month ago

Hello, I have been asked a question "what is the script hash used for in PReferenceScript and when can you set it to Nothing"?

Currently the type PlutusScriptOrReferenceInput looks like this:

data PlutusScriptOrReferenceInput lang
  = PScript (PlutusScript lang)
  | -- | Needed to construct the redeemer pointer map
    -- in the case of minting reference scripts where we don't
    -- have direct access to the script
    PReferenceScript
      TxIn
      (Maybe ScriptHash)

It seems that, despite the comment, the script hash is nowhere used; I cloned the repo and removed it, adjusted the pattern match in scriptWitnessScript, and everything else just compiled.

The question is, can we remove the field? I'd gladly prepare the PR if we can.

Thanks!

github-actions[bot] commented 1 week ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

smelc commented 1 week ago

cc @CarlosLopezDeLara