Skip to content

Commit 82c73e4

Browse files
committed
Parse transaction hash in output of "transaction submit", then check it is a live utxo
1 parent 9671e7b commit 82c73e4

File tree

1 file changed

+12
-1
lines changed
  • cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli

1 file changed

+12
-1
lines changed

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,16 @@ hprop_transaction = integrationRetryWorkspace 0 "simple transaction build" $ \te
115115
, "--out-file", txbodySignedFp
116116
]
117117

118-
void $ execCli' execConfig
118+
stdout <- execCli' execConfig
119119
[ anyEraToString cEra, "transaction", "submit"
120120
, "--tx-file", txbodySignedFp
121121
]
122122

123+
txId <- if null stdout
124+
then do
125+
H.note_ "Expected output of \"transaction submit\" not to be empty"
126+
H.failure
127+
else pure $ last $ lines stdout
123128

124129
H.byDurationM 1 15 "Expected UTxO found" $ do
125130
void $ execCli' execConfig
@@ -134,6 +139,12 @@ hprop_transaction = integrationRetryWorkspace 0 "simple transaction build" $ \te
134139
txouts2 <- H.noteShow $ L.unCoin . txOutValueLovelace . txOutValue . snd <$> Map.toList utxo2
135140
H.assert $ 15_000_003_000_000 `List.elem` txouts2
136141

142+
-- Check that the transaction output exists, when querying by id:
143+
void $ execCli' execConfig
144+
[ anyEraToString cEra, "query", "utxo"
145+
, "--tx-in", txId <> "#0"
146+
]
147+
137148
txOutValue :: TxOut ctx era -> TxOutValue era
138149
txOutValue (TxOut _ v _ _) = v
139150

0 commit comments

Comments
 (0)