Skip to content

Conversation

OlufemiAdeOlusile
Copy link
Collaborator

This PR continues the cleanup of transaction building across the codebase by fully deprecating use_build_cmd in minting, burning, and token transfer flows. All affected tests and utility functions now rely on the build_method parameter, supporting multiple build paths (BUILD, BUILD_RAW, BUILD_EST) in a unified way.

Key Changes

Tests

  • Minting & Burning Tests

    • Updated test_minting_and_burning_witnesses, test_minting_and_burning_sign, test_minting_multiple_scripts, test_minting_burning_diff_tokens_single_tx, test_minting_burning_same_token_single_tx, test_bundle_minting_and_burning_*, test_minting_and_partial_burning, test_minting_unicode_asset_name to replace use_build_cmd with build_method.
    • Adjusted fee expectations (expected_fee) to depend on build_method instead of a boolean flag.
    • Extended logic to support BUILD_EST (build-estimate) where relevant.
  • Policy Tests

    • Updated test_valid_policy_after and test_valid_policy_before to follow build_method.
  • Transfer Tests

    • Updated test_transfer_tokens, test_transfer_multiple_tokens, test_transfer_no_ada, and test_transfer_invalid_token_amount to replace use_build_cmd with build_method.
    • Added support for BUILD_EST alongside existing build methods.
    • Improved error expectation handling depending on method.
  • Reference Script Tests

    • Updated test_script_reference_utxo to branch by build_method instead of use_build_cmd.
    • Fixed witness count handling and added support for BUILD_EST.
  • Committee Tests

    • Updated test_register_hot_key_no_cc_member and test_update_committee_action in tests_conway/test_committee.py to remove use_build_cmd in favor of build_method.

Utilities (clusterlib_utils.py)

  • mint_or_burn_witness and mint_or_burn_sign

    • Replaced use_build_cmd parameter with build_method.
    • Implemented explicit branching for BUILD, BUILD_RAW, and BUILD_EST.
    • Added defensive error handling for unsupported methods.

witness_count_add=len(tx_files.signing_key_files),
)
else:
pytest.skip(f"Unsupported build method: {build_method}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Raise exception instead of skipping when calling with invalid build method.

cluster.g_transaction.submit_tx(tx_file=tx_signed, txins=tx_raw_output.txins)

else:
pytest.skip(f"Unsupported build method: {build_method}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Raise exception instead of skipping when calling with invalid build method.

cluster.g_transaction.submit_tx(tx_file=tx_signed, txins=tx_raw_output.txins)

else:
pytest.skip(f"Unsupported build method: {build_method}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Raise exception instead of skipping when calling with invalid build method.

txouts=txouts,
tx_files=tx_files,
)
assert expected_error in str(excinfo.value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Raise exception when calling with invalid build method.

"The transaction does not balance in its use of assets" in exc_val
or "ValueNotConservedUTxO" in exc_val
), exc_val

Copy link
Collaborator

Choose a reason for hiding this comment

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

Raise exception when calling with invalid build method.

logging.disable(logging.NOTSET)

exc_val = str(excinfo.value)
# build-estimate tends to throw balancing errors
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this point we don't know how the error message looks like, because we are likely hitting the cli issue 1199. Let the test fail with a TODO comment, so we know what to do once the issue is fixed.

invalid_hereafter=invalid_hereafter,
invalid_before=invalid_before,
witness_count_add=len(tx_files.signing_key_files),
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Raise exception when calling with invalid build method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants