Skip to content

Commit 16b0451

Browse files
committed
Fail if any plutus spending script witnesses are present
1 parent 98467ea commit 16b0451

File tree

1 file changed

+9
-0
lines changed
  • cardano-cli/src/Cardano/CLI/EraBased/Transaction

1 file changed

+9
-0
lines changed

cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,8 @@ runTxBuild
10711071
proposals
10721072
mCurrentTreasuryValueAndDonation
10731073

1074+
failIfPlutusPresent txBodyContent
1075+
10741076
firstExceptT TxCmdTxInsDoNotExist
10751077
. hoistEither
10761078
$ txInsExistInUTxO allTxInputs txEraUtxo
@@ -1115,6 +1117,13 @@ runTxBuild
11151117

11161118
return r
11171119

1120+
failIfPlutusPresent :: Monad m => Exp.TxBodyContent era -> m ()
1121+
failIfPlutusPresent txbodycontent =
1122+
let ins = [w | (_, w) <- Exp.txIns txbodycontent]
1123+
in if null $ mapMaybe Exp.getAnyWitnessPlutusLanguage ins
1124+
then return ()
1125+
else error $ "TxBodyContent:" <> show ins
1126+
11181127
-- ----------------------------------------------------------------------------
11191128
-- Transaction body validation and conversion
11201129
--

0 commit comments

Comments
 (0)