fix(tests): handle return collateral validation in build - #3616
Merged
Conversation
Cardano-api >= 11.4.0.0 (bundled with the node 11.1.0 release) fixes issue #1261: `transaction build` now validates that the return collateral output meets the min UTxO value. Rework test_minting_with_small_return_collateral: * When the too small return collateral output is specified explicitly, expect `transaction build` to fail. * When it is not specified explicitly, the command omits the return collateral output and uses the whole collateral input as total collateral. Verify that and check the token was minted. * Keep backwards compatibility: on older versions the build succeeds and submit fails with BabbageOutputTooSmallUTxO, xfailed via the api_1261 blocker. The discrimination is behavior-driven rather than version-based, as cardano-cli 11.1.0.0 exists with both pre-fix and post-fix cardano-api. Structural asserts are kept outside allow_unstable_error_messages() so unrelated errors cannot be silently converted to pass or xfail. Also update api_1261 fixed_in to the actual node release 11.1.0.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Plutus V2 negative minting test to reflect the newer cardano-cli transaction build behavior that validates return-collateral min-UTxO when explicitly provided, while keeping behavior-driven compatibility with older node/cardano-api combinations.
Changes:
- Reworked
test_minting_with_small_return_collateralto distinguish:- explicit too-small return collateral (expect
buildfailure on newer versions), vs - implicit return collateral (expect omission + full collateral used + successful mint on newer versions), vs
- legacy behavior (expect submit failure with
BabbageOutputTooSmallUTxO, gated viaapi_1261).
- explicit too-small return collateral (expect
- Added optional
transaction viewstructural verification (skipped on Dijkstra where not supported). - Updated
api_1261blocker metadata to mark the fix as bundled with node11.1.0.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cardano_node_tests/tests/tests_plutus_v2/test_mint_negative_build.py | Reworks the negative minting test to handle new/old behaviors around return-collateral min-UTxO validation and verifies success-path collateral semantics + mint result. |
| cardano_node_tests/tests/issues.py | Updates api_1261.fixed_in to 11.1.0 to match the node release that bundles the fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cardano-api >= 11.4.0.0 (bundled with the node 11.1.0 release) fixes issue #1261:
transaction buildnow validates that the return collateral output meets the min UTxO value.Rework test_minting_with_small_return_collateral:
transaction buildto fail.The discrimination is behavior-driven rather than version-based, as cardano-cli 11.1.0.0 exists with both pre-fix and post-fix cardano-api. Structural asserts are kept outside allow_unstable_error_messages() so unrelated errors cannot be silently converted to pass or xfail.
Also update api_1261 fixed_in to the actual node release 11.1.0.