diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs index 17269c6deba..a93731b64b9 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs @@ -12,7 +12,10 @@ import Cardano.Api import qualified Cardano.Api.Ledger as L import Cardano.Api.Shelley +import Cardano.CLI.Types.Common +import Cardano.Crypto.Hash.Class (hashToStringAsHex) import qualified Cardano.Ledger.Core as L + import Cardano.Testnet import Prelude @@ -28,7 +31,7 @@ import qualified System.Info as SYS import Testnet.Components.Configuration import Testnet.Components.Query (findLargestUtxoWithAddress, findUtxosWithAddress, getEpochStateView, waitForBlocks) -import Testnet.Process.Run (execCli', mkExecConfig) +import Testnet.Process.Run import Testnet.Property.Util (integrationRetryWorkspace) import Testnet.Types @@ -108,10 +111,11 @@ hprop_transaction = integrationRetryWorkspace 2 "simple transaction build" $ \te , "--out-file", txbodySignedFp ] - void $ execCli' execConfig + txSubmissionResult :: TxSubmissionResult <- execCliStdoutToJson execConfig [ anyEraToString cEra, "transaction", "submit" , "--tx-file", txbodySignedFp ] + let TxId txHash = txhash txSubmissionResult H.noteShowM_ $ waitForBlocks epochStateView 1 @@ -121,6 +125,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", hashToStringAsHex txHash <> "#0" + ] + txOutValue :: TxOut ctx era -> TxOutValue era txOutValue (TxOut _ v _ _) = v