Skip to content

Commit 9896d0c

Browse files
committed
Fail on allReferenceInputs when not null
1 parent 9999d6d commit 9896d0c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

cardano-cli/cardano-cli.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ library
253253
cardano-ledger-conway,
254254
cardano-ledger-core,
255255
cardano-ledger-dijkstra,
256+
cardano-ledger-mary,
256257
cardano-ping ^>=0.9,
257258
cardano-prelude,
258259
cardano-protocol-tpraos,

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import Cardano.CLI.Type.Error.TxCmdError
7474
import Cardano.CLI.Type.Error.TxValidationError
7575
import Cardano.CLI.Type.Output (renderScriptCostsWithScriptHashesMap)
7676
import Cardano.Ledger.Api (allInputsTxBodyF, bodyTxL)
77+
import Cardano.Ledger.Mary.Value qualified as L
7778
import Cardano.Prelude (putLByteString)
7879

7980
import RIO hiding (toList)
@@ -1010,7 +1011,6 @@ runTxBuild
10101011
-- as it's not possible to call this function with ByronEra
10111012
let era = toCardanoEra sbe
10121013
inputsThatRequireWitnessing = [input | (input, _) <- inputsAndMaybeScriptWits]
1013-
10141014
let allReferenceInputs =
10151015
getAllReferenceInputs
10161016
(map snd inputsAndMaybeScriptWits)
@@ -1021,6 +1021,17 @@ runTxBuild
10211021
(map snd proposals)
10221022
readOnlyRefIns
10231023

1024+
let (ma, _) = mintValueWithScriptWits
1025+
flat = L.flattenMultiAsset ma
1026+
if not $ null flat
1027+
then
1028+
error $
1029+
unlines
1030+
[ "allReferenceInputs:" <> show allReferenceInputs
1031+
, "mintValueWithScriptWits:" <> show mintValueWithScriptWits
1032+
]
1033+
else return ()
1034+
10241035
let allTxInputs = inputsThatRequireWitnessing ++ allReferenceInputs ++ txinsc
10251036
localNodeConnInfo =
10261037
LocalNodeConnectInfo

0 commit comments

Comments
 (0)