Skip to content

Commit 4371248

Browse files
authored
Merge pull request IntersectMBO#1196 from mkoura/use_correct_outfile
Use correct Tx body file (for txid) when checking Tx with db-sync
2 parents 7929ecf + b380931 commit 4371248

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

cardano_node_tests/tests/test_native_tokens.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,7 @@ def test_multiasset_txouts_syntax(
21772177
address=token_mint_addr.address, coins=[token]
21782178
), "The token already exists"
21792179

2180-
# Build transaction body. The `tx_raw_output` will be used as blueprint for assembling
2180+
# Build transaction body. The `tx_raw_blueprint` will be used as blueprint for assembling
21812181
# CLI arguments for `transaction build`.
21822182
tx_files = clusterlib.TxFiles(
21832183
signing_key_files=[issuer_addr.skey_file, token_mint_addr.skey_file],
@@ -2199,7 +2199,7 @@ def test_multiasset_txouts_syntax(
21992199
mint=mint,
22002200
tx_files=tx_files,
22012201
)
2202-
tx_raw_output = cluster.build_raw_tx(
2202+
tx_raw_blueprint = cluster.build_raw_tx(
22032203
src_address=token_mint_addr.address,
22042204
tx_name=f"{temp_template}_mint_burn",
22052205
# token minting and burning in the same TX
@@ -2208,15 +2208,15 @@ def test_multiasset_txouts_syntax(
22082208
fee=fee,
22092209
)
22102210

2211-
# assemble CLI arguments for `transaction build` using data from `tx_raw_output`
2211+
# assemble CLI arguments for `transaction build` using data from `tx_raw_blueprint`
22122212

2213-
assert tx_raw_output.txins
2214-
assert tx_raw_output.txouts
2215-
assert tx_raw_output.mint
2213+
assert tx_raw_blueprint.txins
2214+
assert tx_raw_blueprint.txouts
2215+
assert tx_raw_blueprint.mint
22162216

22172217
# test syntax for multi-asset values and txouts, see
22182218
# https://github.com/input-output-hk/cardano-node/pull/2072
2219-
coin_txouts = [f"{t.amount} {t.coin}" for t in tx_raw_output.txouts]
2219+
coin_txouts = [f"{t.amount} {t.coin}" for t in tx_raw_blueprint.txouts]
22202220
txout_parts = [
22212221
"-7000",
22222222
"8500",
@@ -2226,21 +2226,21 @@ def test_multiasset_txouts_syntax(
22262226
*coin_txouts,
22272227
]
22282228
txout_joined = "+".join(txout_parts)
2229-
txout_str = f"{tx_raw_output.txouts[0].address}+{txout_joined}"
2229+
txout_str = f"{tx_raw_blueprint.txouts[0].address}+{txout_joined}"
22302230

2231-
txins_combined = [f"{x.utxo_hash}#{x.utxo_ix}" for x in tx_raw_output.txins]
2232-
mint_str = "+".join(f"{x.amount} {x.coin}" for x in tx_raw_output.mint[0].txouts)
2231+
txins_combined = [f"{x.utxo_hash}#{x.utxo_ix}" for x in tx_raw_blueprint.txins]
2232+
mint_str = "+".join(f"{x.amount} {x.coin}" for x in tx_raw_blueprint.mint[0].txouts)
22332233
out_file = (
2234-
tx_raw_output.out_file.parent
2235-
/ f"{tx_raw_output.out_file.stem}_assembled{tx_raw_output.out_file.suffix}"
2234+
tx_raw_blueprint.out_file.parent
2235+
/ f"{tx_raw_blueprint.out_file.stem}_assembled{tx_raw_blueprint.out_file.suffix}"
22362236
)
22372237
build_raw_args = [
22382238
"transaction",
22392239
"build-raw",
22402240
"--fee",
2241-
str(tx_raw_output.fee),
2241+
str(tx_raw_blueprint.fee),
22422242
"--mint-script-file",
2243-
str(tx_raw_output.mint[0].script_file),
2243+
str(tx_raw_blueprint.mint[0].script_file),
22442244
*helpers.prepend_flag("--tx-in", txins_combined),
22452245
"--tx-out",
22462246
txout_str,
@@ -2261,6 +2261,8 @@ def test_multiasset_txouts_syntax(
22612261
tx_name=f"{temp_template}_mint_burn",
22622262
)
22632263

2264+
tx_raw_output = tx_raw_blueprint._replace(out_file=out_file)
2265+
22642266
# submit signed transaction
22652267
cluster.submit_tx(tx_file=out_file_signed, txins=tx_raw_output.txins)
22662268

0 commit comments

Comments
 (0)