-
Notifications
You must be signed in to change notification settings - Fork 31
Build method test native tokens #3121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
witness_count_add=len(tx_files.signing_key_files), | ||
) | ||
else: | ||
pytest.skip(f"Unsupported build method: {build_method}") |
There was a problem hiding this comment.
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}") |
There was a problem hiding this comment.
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}") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 | ||
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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), | ||
) |
There was a problem hiding this comment.
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.
# At this point we don't know the exact error string from build-estimate. | ||
# Let this fail if it's anything unexpected so we can revisit later. | ||
assert ( | ||
"balance" in exc_val or "ValueNotConservedUTxO" in exc_val or "UTxO" in exc_val |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't know yet how the actual error for build-estimate
looks like, because it is masked by cli issue 1199.
At the same time we want to make sure we are matching just the expected error message.
Checking if the error contains "balance" will likely match all sorts of error and lead to false positives. Let's check TODO: unknown atm
and replace it with precise error string as soon as it starts failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay will do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't assert false because the linter does not like that.. so the best to fail loud is with the pytest.fail and then once this is fixed we can include the right assertions
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 thebuild_method
parameter, supporting multiple build paths (BUILD
,BUILD_RAW
,BUILD_EST
) in a unified way.Key Changes
Tests
Minting & Burning Tests
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 replaceuse_build_cmd
withbuild_method
.expected_fee
) to depend onbuild_method
instead of a boolean flag.BUILD_EST
(build-estimate) where relevant.Policy Tests
test_valid_policy_after
andtest_valid_policy_before
to followbuild_method
.Transfer Tests
test_transfer_tokens
,test_transfer_multiple_tokens
,test_transfer_no_ada
, andtest_transfer_invalid_token_amount
to replaceuse_build_cmd
withbuild_method
.BUILD_EST
alongside existing build methods.Reference Script Tests
test_script_reference_utxo
to branch bybuild_method
instead ofuse_build_cmd
.BUILD_EST
.Committee Tests
test_register_hot_key_no_cc_member
andtest_update_committee_action
intests_conway/test_committee.py
to removeuse_build_cmd
in favor ofbuild_method
.Utilities (
clusterlib_utils.py
)mint_or_burn_witness
andmint_or_burn_sign
use_build_cmd
parameter withbuild_method
.BUILD
,BUILD_RAW
, andBUILD_EST
.