Repository navigation
fix(transaction): select a given collateral UTxO for payment - #880
Merged
Merged
Conversation
This was referenced Nov 28, 2026
twwu123
approved these changes
Nov 30, 2026
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.
What
TxBuilderno longer keeps a UTxO named by acollateral(...)part out of coin selection. When the payer's UTxOs hold it (a snapshot'sutxos, a wallet'sgetUtxos), selection may spend it for payment too, and it is still put up as collateral: the ledger accepts an input that is also a collateral input. To keep it unspent, an application leaves it out of the payer's UTxOs, or refuses it withcanSelect, which is now asked about it as well.Until now, a payer whose funds were in its collateral UTxO, such as a wallet with a single UTxO, got
INSUFFICIENT_FUNDSfor a transaction those funds cover.Contents
tx-builder/balance.ts:paymentPoolandrefusedByno longer pass over the UTxOs that collateral parts put up.tx-builder/builder.ts,mesh-tx-builder/index.ts: the internalselectableCollateraldeclaration is removed.MeshTxBuilderpassed it so that selection could spend itstxInCollateralinputs. That is now the default, soMeshTxBuilderbuilds as before.builder.test.ts: the pool counts ofINSUFFICIENT_FUNDS, and selection with the UTxO listed, left out, or refused bycanSelect.traps-emulator.test.ts: the same cases, built against the emulator and submitted to it.A sweep (
sendAllTo) now spends a listed collateral UTxO too. UTxOs that the parts read are still never selected. The consolidation steps of a plan still leave alone the collateral of the step they serve.Validation