Skip to content

Commit

Permalink
Parse transaction hash in output of "transaction submit", then check …
Browse files Browse the repository at this point in the history
…it is a live utxo
  • Loading branch information
smelc committed Nov 7, 2024
1 parent 6fac0b4 commit 71bac0b
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,17 @@ hprop_transaction = integrationRetryWorkspace 2 "simple transaction build" $ \te
, "--out-file", txbodySignedFp
]

void $ execCli' execConfig
stdout <- execCli' execConfig
[ anyEraToString cEra, "transaction", "submit"
, "--tx-file", txbodySignedFp
]

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

H.noteShowM_ $ waitForBlocks epochStateView 1

H.byDurationM 1 15 "Expected UTxO found" $ do
Expand All @@ -121,6 +127,12 @@ hprop_transaction = integrationRetryWorkspace 2 "simple transaction build" $ \te
H.assertWith txouts2 $ \txouts2' ->
[transferAmount, initialAmount - transferAmount - txFee] == txouts2'

-- Check that the transaction output exists, when querying by id:
void $ execCli' execConfig
[ anyEraToString cEra, "query", "utxo"
, "--tx-in", txId <> "#0"
]

txOutValue :: TxOut ctx era -> TxOutValue era
txOutValue (TxOut _ v _ _) = v

Expand Down

0 comments on commit 71bac0b

Please sign in to comment.