diff --git a/cardano-api/src/Cardano/Api.hs b/cardano-api/src/Cardano/Api.hs index 7e5178c3354..3cde898d1e7 100644 --- a/cardano-api/src/Cardano/Api.hs +++ b/cardano-api/src/Cardano/Api.hs @@ -369,6 +369,7 @@ module Cardano.Api ( Witness(..), KeyWitnessInCtx(..), ScriptWitnessInCtx(..), + IsScriptWitnessInCtx(..), ScriptDatum(..), ScriptRedeemer, scriptWitnessScript, diff --git a/cardano-api/src/Cardano/Api/Script.hs b/cardano-api/src/Cardano/Api/Script.hs index 995d1c68471..84bb19ee123 100644 --- a/cardano-api/src/Cardano/Api/Script.hs +++ b/cardano-api/src/Cardano/Api/Script.hs @@ -53,6 +53,7 @@ module Cardano.Api.Script ( Witness(..), KeyWitnessInCtx(..), ScriptWitnessInCtx(..), + IsScriptWitnessInCtx(..), ScriptDatum(..), ScriptRedeemer, scriptWitnessScript, @@ -851,6 +852,17 @@ deriving instance Show (KeyWitnessInCtx witctx) deriving instance Eq (ScriptWitnessInCtx witctx) deriving instance Show (ScriptWitnessInCtx witctx) +class IsScriptWitnessInCtx ctx where + scriptWitnessInCtx :: ScriptWitnessInCtx ctx + +instance IsScriptWitnessInCtx WitCtxTxIn where + scriptWitnessInCtx = ScriptWitnessForSpending + +instance IsScriptWitnessInCtx WitCtxMint where + scriptWitnessInCtx = ScriptWitnessForMinting + +instance IsScriptWitnessInCtx WitCtxStake where + scriptWitnessInCtx = ScriptWitnessForStakeAddr -- ---------------------------------------------------------------------------- -- Script execution units