Skip to content

Commit 58aada7

Browse files
committed
check that calculate-plutus-script-cost include script hash for reference scripts
1 parent 53037da commit 58aada7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cardano_node_tests/tests/test_plutus_v2_spend_build.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,14 @@ def test_mix_reference_attached_script(
11051105
script_txins=plutus_txins,
11061106
)
11071107

1108+
plutus_cost = cluster.calculate_plutus_script_cost(
1109+
src_address=payment_addrs[0].address,
1110+
tx_name=f"{temp_template}_step2",
1111+
tx_files=tx_files_redeem,
1112+
txouts=txouts_redeem,
1113+
script_txins=plutus_txins,
1114+
)
1115+
11081116
tx_signed = cluster.sign_tx(
11091117
tx_body_file=tx_output_redeem.out_file,
11101118
signing_key_files=tx_files_redeem.signing_key_files,
@@ -1119,6 +1127,12 @@ def test_mix_reference_attached_script(
11191127
cluster.get_utxo(utxo=script_utxos1[0]) or cluster.get_utxo(utxo=script_utxos2[0])
11201128
), f"Script address UTxOs were NOT spent - `{script_utxos1}` and `{script_utxos2}`"
11211129

1130+
# check that the script hash is included for all scripts
1131+
for script in plutus_cost:
1132+
assert script.get(
1133+
"scriptHash"
1134+
), "Missing script hash on calculate-plutus-script-cost result"
1135+
11221136
@allure.link(helpers.get_vcs_link())
11231137
@pytest.mark.parametrize("script_type", ("simple", "plutus_v1", "plutus_v2"))
11241138
def test_spend_reference_script(

0 commit comments

Comments
 (0)