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 Oct 4, 2024
1 parent 9671e7b commit 82c73e4
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,16 @@ hprop_transaction = integrationRetryWorkspace 0 "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.byDurationM 1 15 "Expected UTxO found" $ do
void $ execCli' execConfig
Expand All @@ -134,6 +139,12 @@ hprop_transaction = integrationRetryWorkspace 0 "simple transaction build" $ \te
txouts2 <- H.noteShow $ L.unCoin . txOutValueLovelace . txOutValue . snd <$> Map.toList utxo2
H.assert $ 15_000_003_000_000 `List.elem` 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 82c73e4

Please sign in to comment.