Skip to content

Commit 97cd975

Browse files
authored
Merge pull request #6003 from IntersectMBO/smelc/test-cli-transaction-submit-new-output
cardano-testnet: use new output of "transaction submit"
2 parents c2179ff + 8fd765e commit 97cd975

File tree

1 file changed

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

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import Cardano.Api
1212
import qualified Cardano.Api.Ledger as L
1313
import Cardano.Api.Shelley
1414

15+
import Cardano.CLI.Types.Common
16+
import Cardano.Crypto.Hash.Class (hashToStringAsHex)
1517
import qualified Cardano.Ledger.Core as L
18+
1619
import Cardano.Testnet
1720

1821
import Prelude
@@ -28,7 +31,7 @@ import qualified System.Info as SYS
2831
import Testnet.Components.Configuration
2932
import Testnet.Components.Query (findLargestUtxoWithAddress, findUtxosWithAddress,
3033
getEpochStateView, waitForBlocks)
31-
import Testnet.Process.Run (execCli', mkExecConfig)
34+
import Testnet.Process.Run
3235
import Testnet.Property.Util (integrationRetryWorkspace)
3336
import Testnet.Types
3437

@@ -108,10 +111,11 @@ hprop_transaction = integrationRetryWorkspace 2 "simple transaction build" $ \te
108111
, "--out-file", txbodySignedFp
109112
]
110113

111-
void $ execCli' execConfig
114+
txSubmissionResult :: TxSubmissionResult <- execCliStdoutToJson execConfig
112115
[ anyEraToString cEra, "transaction", "submit"
113116
, "--tx-file", txbodySignedFp
114117
]
118+
let TxId txHash = txhash txSubmissionResult
115119

116120
H.noteShowM_ $ waitForBlocks epochStateView 1
117121

@@ -121,6 +125,12 @@ hprop_transaction = integrationRetryWorkspace 2 "simple transaction build" $ \te
121125
H.assertWith txouts2 $ \txouts2' ->
122126
[transferAmount, initialAmount - transferAmount - txFee] == txouts2'
123127

128+
-- Check that the transaction output exists, when querying by id:
129+
void $ execCli' execConfig
130+
[ anyEraToString cEra, "query", "utxo"
131+
, "--tx-in", hashToStringAsHex txHash <> "#0"
132+
]
133+
124134
txOutValue :: TxOut ctx era -> TxOutValue era
125135
txOutValue (TxOut _ v _ _) = v
126136

0 commit comments

Comments
 (0)