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 0db5135
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cardano-api/internal/Cardano/Api/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ data ScriptWitness witctx era where
PlutusScriptWitness :: ScriptLanguageInEra lang era
-> PlutusScriptVersion lang
-> PlutusScriptOrReferenceInput lang
-> ScriptDatum witctx
-> ScriptDatum lang witctx
-> ScriptRedeemer
-> ExecutionUnits
-> ScriptWitness witctx era
Expand Down Expand Up @@ -781,14 +781,15 @@ instance Eq (ScriptWitness witctx era) where

type ScriptRedeemer = HashableScriptData

data ScriptDatum witctx where
ScriptDatumForTxIn :: HashableScriptData -> ScriptDatum WitCtxTxIn
InlineScriptDatum :: ScriptDatum WitCtxTxIn
NoScriptDatumForMint :: ScriptDatum WitCtxMint
NoScriptDatumForStake :: ScriptDatum WitCtxStake
data ScriptDatum lang witctx where
ScriptDatumForTxIn :: HashableScriptData -> ScriptDatum lang WitCtxTxIn
InlineScriptDatum :: ScriptDatum lang WitCtxTxIn
NoScriptDatumForMint :: ScriptDatum lang WitCtxMint
NoScriptDatumForStake :: ScriptDatum lang WitCtxStake
NoScriptDatumForSpending :: ScriptDatum PlutusScriptV3 WitCtxTxIn -- CIP-0069

deriving instance Eq (ScriptDatum witctx)
deriving instance Show (ScriptDatum witctx)
deriving instance Eq (ScriptDatum lang witctx)
deriving instance Show (ScriptDatum lang witctx)

-- We cannot always extract a script from a script witness due to reference scripts.
-- Reference scripts exist in the UTxO, so without access to the UTxO we cannot
Expand Down

0 comments on commit 0db5135

Please sign in to comment.