Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cardano-testnet: use new output of "transaction submit" #6003

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
Loading