Skip to content

Commit

Permalink
Modify pPlutusReferenceScriptWitness parser to relax the requirement for
Browse files Browse the repository at this point in the history
a spending script datum in Conway
  • Loading branch information
Jimbo4350 committed Jul 24, 2024
1 parent 601d88f commit 469d718
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2227,17 +2227,33 @@ pTxIn balance =
let simpleLang = AnyScriptLanguage SimpleScriptLanguage
in SimpleReferenceScriptWitnessFiles refTxIn simpleLang Nothing

pPlutusReferenceScriptWitness :: BalanceTxExecUnits -> Parser (ScriptWitnessFiles WitCtxTxIn)
pPlutusReferenceScriptWitness autoBalanceExecUnits =
createPlutusReferenceScriptWitnessFiles
<$> pReferenceTxIn "spending-" "plutus"
<*> pPlutusScriptLanguage "spending-"
<*> pScriptDatumOrFile "spending-reference-tx-in" WitCtxTxIn
<*> pScriptRedeemerOrFile "spending-reference-tx-in"
<*> ( case autoBalanceExecUnits of
AutoBalance -> pure (ExecutionUnits 0 0)
ManualBalance -> pExecutionUnits "spending-reference-tx-in"
)
pPlutusReferenceScriptWitness
:: ShelleyBasedEra era -> BalanceTxExecUnits -> Parser (ScriptWitnessFiles WitCtxTxIn)
pPlutusReferenceScriptWitness sbe' autoBalanceExecUnits =
caseShelleyToBabbageOrConwayEraOnwards
( const $
createPlutusReferenceScriptWitnessFiles
<$> pReferenceTxIn "spending-" "plutus"
<*> pPlutusScriptLanguage "spending-"
<*> pScriptDatumOrFile "spending-reference-tx-in" WitCtxTxIn
<*> pScriptRedeemerOrFile "spending-reference-tx-in"
<*> ( case autoBalanceExecUnits of
AutoBalance -> pure (ExecutionUnits 0 0)
ManualBalance -> pExecutionUnits "spending-reference-tx-in"
)
)
( const $
createPlutusReferenceScriptWitnessFiles
<$> pReferenceTxIn "spending-" "plutus"
<*> pPlutusScriptLanguage "spending-"
<*> pScriptDatumOrFileCip69 "spending-reference-tx-in" WitCtxTxIn
<*> pScriptRedeemerOrFile "spending-reference-tx-in"
<*> ( case autoBalanceExecUnits of
AutoBalance -> pure (ExecutionUnits 0 0)
ManualBalance -> pExecutionUnits "spending-reference-tx-in"
)
)
sbe'
where
createPlutusReferenceScriptWitnessFiles
:: TxIn
Expand Down

0 comments on commit 469d718

Please sign in to comment.