Skip to content
Open
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
16 changes: 16 additions & 0 deletions cardano_node_tests/tests/tests_plutus_v2/test_mint_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,22 @@ def test_minting_ref_one_token(
expected_costs=[script_expected_fee["cost"]],
)

ref_size_data = cluster.g_query.get_ref_script_size(utxo=reference_utxo)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref_size = cluster.g_query.get_ref_script_size(utxo=reference_utxo)["refInputScriptSize"] will print meaningful error when the key is missing, and you don't need to add the assert.


ref_size = ref_size_data.get("refInputScriptSize")
assert ref_size is not None, f"Missing refInputScriptSize field in output: {ref_size_data}"

expected_sizes = {
"v2": 1893,
"v3": 6,
}
expected_size = expected_sizes.get(plutus_version)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected_size = expected_sizes[plutus_version] will print meaningful error when the key is missing, and you don't need to add the assert in next line.

assert expected_size is not None, f"Unexpected Plutus version: {plutus_version}"

assert ref_size == expected_size, (
f"Unexpected reference script size: expected {expected_size}, got {ref_size}"
)

@allure.link(helpers.get_vcs_link())
@common.PARAM_PLUTUS2ONWARDS_VERSION
@pytest.mark.smoke
Expand Down
Loading