Skip to content

Commit 63367ee

Browse files
authored
Merge pull request #1276 from saratomaz/check_calculate_plutus_script_cost
check that calculate-plutus-script-cost include script hash for reference scripts
2 parents 56da1b9 + 58aada7 commit 63367ee

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
@@ -1122,6 +1122,14 @@ def test_mix_reference_attached_script(
11221122
script_txins=plutus_txins,
11231123
)
11241124

1125+
plutus_cost = cluster.calculate_plutus_script_cost(
1126+
src_address=payment_addrs[0].address,
1127+
tx_name=f"{temp_template}_step2",
1128+
tx_files=tx_files_redeem,
1129+
txouts=txouts_redeem,
1130+
script_txins=plutus_txins,
1131+
)
1132+
11251133
tx_signed = cluster.sign_tx(
11261134
tx_body_file=tx_output_redeem.out_file,
11271135
signing_key_files=tx_files_redeem.signing_key_files,
@@ -1136,6 +1144,12 @@ def test_mix_reference_attached_script(
11361144
cluster.get_utxo(utxo=script_utxos1[0]) or cluster.get_utxo(utxo=script_utxos2[0])
11371145
), f"Script address UTxOs were NOT spent - `{script_utxos1}` and `{script_utxos2}`"
11381146

1147+
# check that the script hash is included for all scripts
1148+
for script in plutus_cost:
1149+
assert script.get(
1150+
"scriptHash"
1151+
), "Missing script hash on calculate-plutus-script-cost result"
1152+
11391153
@allure.link(helpers.get_vcs_link())
11401154
@pytest.mark.parametrize("script_type", ("simple", "plutus_v1", "plutus_v2"))
11411155
def test_spend_reference_script(

0 commit comments

Comments
 (0)