Repository navigation
pick the Constructor or Sorter role from a PSBT's flags - #124
Draft
yuval-block wants to merge 1 commit into
Draft
yuval-block wants to merge 1 commit into
yuval-block wants to merge 1 commit into
Conversation
yuval-block
force-pushed
the
sort-uuid
branch
from
November 16, 2026 03:27
0c154de to
bd4f1dc
Compare
yuval-block
force-pushed
the
dynamic-constructor
branch
from
November 16, 2026 03:28
7bf09f4 to
a1025bb
Compare
range-diff for force push 7bf09f4e6b → a1025bb699
|
yuval-block
force-pushed
the
sort-uuid
branch
from
November 16, 2026 04:36
bd4f1dc to
70a89f4
Compare
yuval-block
force-pushed
the
dynamic-constructor
branch
from
November 16, 2026 04:37
a1025bb to
2c7b09f
Compare
range-diff for force push a1025bb699 → 2c7b09f955
|
yuval-block
force-pushed
the
sort-uuid
branch
from
November 16, 2026 05:01
70a89f4 to
0934730
Compare
yuval-block
force-pushed
the
dynamic-constructor
branch
from
November 16, 2026 05:02
2c7b09f to
6caa821
Compare
range-diff for force push 2c7b09f955 → 6caa821969
|
yuval-block
force-pushed
the
sort-uuid
branch
from
November 16, 2026 18:21
0934730 to
ed2bcaa
Compare
yuval-block
force-pushed
the
dynamic-constructor
branch
from
November 16, 2026 18:22
6caa821 to
afea4f8
Compare
range-diff for force push 6caa821969 → afea4f88c9
|
The typed roles take a PSBT's modifiability and sort mode as type parameters, so code that parses a PSBT it did not create has to know both before it can name a role. roles::dynamic::Role reads them from the PSBT's flags instead: the tx modifiable flags select a Constructor when inputs or outputs can still be added, or a Sorter when the PSBT is unmodifiable, and the sort key derivation and PSBT_GLOBAL_TX_UUID select the sort mode. Stage holds the role for one sort mode. Dispatch cannot fail. ResultUnorderedPsbt marks every sort rule violation as a conflict, so a clean UnorderedPsbt always satisfies the sort mode its own fields select, and the typed roles can be built without checking it again. Parsing reports the same errors as UnorderedPsbt. ResultRole joins like ResultUnorderedPsbt and picks a role only once the join is clean. Two PSBTs whose flags disagree join to a conflict, not to some role in between. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yuval-block
force-pushed
the
dynamic-constructor
branch
from
November 16, 2026 23:10
afea4f8 to
068cfa3
Compare
range-diff for force push afea4f88c9 → 068cfa3d52
|
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
yuval-block
force-pushed
the
sort-uuid
branch
from
November 16, 2026 23:44
ed2bcaa to
000109c
Compare
yuval-block
force-pushed
the
dynamic-constructor
branch
from
November 16, 2026 23:45
068cfa3 to
397e1f4
Compare
range-diff for force push 068cfa3d52 → 397e1f4c97
|
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.
Code receiving a PSBT cannot know its modifiability and sort mode as Rust type parameters.
roles::dynamic::Rolereads those fields and selects the corresponding typed role at runtime.Rolerepresents the sort mode, including whether a nonempty transaction UUID is present. ItsStageholds aConstructorwhile inputs or outputs remain modifiable, or aSorteronce both are fixed.ResultRoledelegates joins toResultUnorderedPsbtand selects a role whentry_unwrapsucceeds.Selecting a role from a valid
UnorderedPsbtcannot fail: its fields already satisfy the selected sort mode. Parsing reports the existingUnorderedPsbterrors.