Skip to content

Commit

Permalink
Modify ScriptDatum in accordance with CIP-0069
Browse files Browse the repository at this point in the history
I.E the datum is no longer required in spending scripts
  • Loading branch information
Jimbo4350 committed Jul 3, 2024
1 parent 46097e3 commit e865569
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cardano-api/internal/Cardano/Api/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ instance Eq (ScriptWitness witctx era) where
type ScriptRedeemer = HashableScriptData

data ScriptDatum witctx where
ScriptDatumForTxIn :: HashableScriptData -> ScriptDatum WitCtxTxIn
ScriptDatumForTxIn :: Maybe HashableScriptData -> ScriptDatum WitCtxTxIn
InlineScriptDatum :: ScriptDatum WitCtxTxIn
NoScriptDatumForMint :: ScriptDatum WitCtxMint
NoScriptDatumForStake :: ScriptDatum WitCtxStake
Expand Down
8 changes: 4 additions & 4 deletions cardano-api/internal/Cardano/Api/Tx/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2218,7 +2218,7 @@ convScriptData sbe txOuts scriptWitnesses =
[ d | TxOut _ _ (TxOutDatumInTx _ d) _ <- txOuts ]
++ [ d | (_, AnyScriptWitness
(PlutusScriptWitness
_ _ _ (ScriptDatumForTxIn d) _ _)) <- scriptWitnesses
_ _ _ (ScriptDatumForTxIn (Just d)) _ _)) <- scriptWitnesses
]
in TxBodyScriptData w datums redeemers
)
Expand Down Expand Up @@ -2485,7 +2485,7 @@ makeShelleyTransactionBody sbe@ShelleyBasedEraAlonzo
[ d | TxOut _ _ (TxOutDatumInTx _ d) _ <- txOuts ]
++ [ d | (_, AnyScriptWitness
(PlutusScriptWitness
_ _ _ (ScriptDatumForTxIn d) _ _)) <- witnesses
_ _ _ (ScriptDatumForTxIn (Just d)) _ _)) <- witnesses
]

redeemers :: Alonzo.Redeemers StandardAlonzo
Expand Down Expand Up @@ -2591,7 +2591,7 @@ makeShelleyTransactionBody sbe@ShelleyBasedEraBabbage
[ d | TxOut _ _ (TxOutDatumInTx _ d) _ <- txOuts ]
++ [ d | (_, AnyScriptWitness
(PlutusScriptWitness
_ _ _ (ScriptDatumForTxIn d) _ _)) <- witnesses
_ _ _ (ScriptDatumForTxIn (Just d)) _ _)) <- witnesses
]

redeemers :: Alonzo.Redeemers StandardBabbage
Expand Down Expand Up @@ -2707,7 +2707,7 @@ makeShelleyTransactionBody sbe@ShelleyBasedEraConway
[ d | TxOut _ _ (TxOutDatumInTx _ d) _ <- txOuts ]
++ [ d | (_, AnyScriptWitness
(PlutusScriptWitness
_ _ _ (ScriptDatumForTxIn d) _ _)) <- witnesses
_ _ _ (ScriptDatumForTxIn (Just d)) _ _)) <- witnesses
]

redeemers :: Alonzo.Redeemers StandardConway
Expand Down

0 comments on commit e865569

Please sign in to comment.