Skip to content

fix(tests): handle return collateral validation in build - #3616

Merged
mkoura merged 1 commit into
masterfrom
small_return_collateral_api_1261
Aug 14, 2026
Merged

fix(tests): handle return collateral validation in build#3616
mkoura merged 1 commit into
masterfrom
small_return_collateral_api_1261

Conversation

@mkoura

@mkoura mkoura commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_collateral to distinguish:
    • explicit too-small return collateral (expect build failure 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 via api_1261).
  • Added optional transaction view structural verification (skipped on Dijkstra where not supported).
  • Updated api_1261 blocker metadata to mark the fix as bundled with node 11.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.

@mkoura
mkoura merged commit cd352cb into master Aug 14, 2026
4 checks passed
@mkoura
mkoura deleted the small_return_collateral_api_1261 branch August 14, 2026 16:32
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