Repository navigation
Introduce Constructor role - #114
yuval-block wants to merge 2 commits into
Conversation
7e6e6bd to
199a7b1
Compare
range-diff for force push 7e6e6bdbea → 199a7b165d
|
range-diff for force push 7e6e6bdbea → 199a7b165d
|
199a7b1 to
0a5cb0d
Compare
range-diff for force push 199a7b165d → 0a5cb0da97
|
range-diff for force push 199a7b165d → 0a5cb0da97
|
0a5cb0d to
eaf668d
Compare
range-diff for force push 0a5cb0da97 → eaf668d595
|
eaf668d to
2badec2
Compare
range-diff for force push 0a5cb0da97 → eaf668d595
|
range-diff for force push eaf668d595 → 2badec25e6
|
range-diff for force push eaf668d595 → 2badec25e6
|
06a6e9a to
ded2f3f
Compare
533330d to
e3bd458
Compare
range-diff for force push 2badec25e6 → 06a6e9a687
|
range-diff for force push 533330d9a2 → e3bd458414
|
range-diff for force push 533330d9a2 → e3bd458414
|
range-diff for force push bb9dfa0fd7 → 04dc575e48
|
range-diff for force push bb9dfa0fd7 → 04dc575e48
|
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 |
04dc575 to
638d7d0
Compare
range-diff for force push 04dc575e48 → 638d7d0739
|
range-diff for force push 04dc575e48 → 638d7d0739
|
638d7d0 to
7c329c3
Compare
range-diff for force push 638d7d0739 → 7c329c3e9a
|
range-diff for force push 638d7d0739 → 7c329c3e9a
|
7c329c3 to
ce5df60
Compare
range-diff for force push 7c329c3e9a → ce5df60a15
|
ce5df60 to
9925498
Compare
range-diff for force push ce5df60a15 → 99254980d7
|
9925498 to
adbd771
Compare
range-diff for force push 99254980d7 → adbd771ae0
|
Add Constructor<M, S> and ResultConstructor<M, S>, which provide a typesafe interface to unordered PSBT mutation modeled after the upstream psbt_v2 crate's interface for BIP 174 and 370. This currently only supports same-modifiability Constructors to be joined. The logical AND of the modifiability flags allows mixed modifiability constructors to be joined in principle, but this is not implemented in this commit.
The result of sorting before the sets are frozen is just a modifiable BIP 370 constructor.
adbd771 to
dfb127c
Compare
range-diff for force push adbd771ae0 → dfb127c290
|
| /// Move on to the [`Sorter`] while inputs and outputs stay as modifiable | ||
| /// as they are. Sorting then hands the PSBT to the BIP 370 | ||
| /// [`Constructor`](psbt_v2::v2::Constructor) of the same modifiability, | ||
| /// which adds further inputs and outputs after the sorted ones. |
There was a problem hiding this comment.
Doc promises outputs from inputs-only handoff
into_sorter's doc says sorting hands the PSBT to the BIP 370 constructor of the same modifiability, "which adds further inputs and outputs", but InputsModifiable hands off to v2::Constructor<InputsOnlyModifiable> (only input) and OutputsModifiable to OutputsOnlyModifiable (only output). A reader of a partly modifiable constructor is promised additions the handed-off constructor cannot make.
/// is handed to: the matching BIP 370 constructor while inputs or outputs
— fungi-protocol/concurrent-psbt@dfb127c · crates/concurrent-psbt/src/roles/sorter/mod.rs#L74
oakagent · automated · dfb127c
dfb127c to
4407fe7
Compare
range-diff for force push dfb127c290 → 4407fe788c
|
Add Constructor<M, S> and ResultConstructor<M, S>, which provide a
typesafe interface to unordered PSBT mutation modeled after the upstream
psbt_v2 crate's interface for BIP 174 and 370.
Like the BIP 370 Constructor role, this can freeze the input or output fields. Unlike the upstream implementation
no_more_inputsandno_more_outputstransition the static type.Unlike the BIP 370 Constructor, this can only transition into the Sorter role, from the fully or partly modifiable states.