Repository navigation
define own Global, Input and Output structs - #116
yuval-block wants to merge 3 commits into
Conversation
57013dc to
19a23f4
Compare
range-diff for force push 57013dcca3 → 19a23f490a
|
19a23f4 to
83c0bbb
Compare
range-diff for force push 19a23f490a → 83c0bbb0a0
|
83c0bbb to
e10fb51
Compare
range-diff for force push 83c0bbb0a0 → e10fb51e3d
|
e10fb51 to
1d0d5c5
Compare
range-diff for force push e10fb51e3d → 1d0d5c5a96
|
1d0d5c5 to
dc75494
Compare
range-diff for force push 1d0d5c5a96 → dc75494692
|
950a11b to
3e05d55
Compare
range-diff for force push 950a11b30a → 3e05d55356
|
20c3f12 to
a172330
Compare
range-diff for force push 20c3f12f9d → a1723301e7
|
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 |
a172330 to
e4468ab
Compare
range-diff for force push a1723301e7 → e4468abab2
|
e4468ab to
5cf8f49
Compare
range-diff for force push e4468abab2 → 5cf8f49ac9
|
5cf8f49 to
3bebd68
Compare
range-diff for force push 5cf8f49ac9 → 3bebd68a9b
|
3bebd68 to
5d0742b
Compare
range-diff for force push 3bebd68a9b → 5d0742b812
|
5d0742b to
558e0c9
Compare
range-diff for force push 5d0742b812 → 558e0c9d6c
|
558e0c9 to
bfa0472
Compare
range-diff for force push 558e0c9d6c → bfa047201a
|
bfa0472 to
1397429
Compare
range-diff for force push bfa047201a → 13974295ec
|
joinable_struct! generates both a plain struct and its result-domain counterpart, so Global, Input and Output are this crate's types. wrap is an inherent method, which replaces the GlobalExt, InputExt and OutputExt traits. The macro takes the psbt_v2 type and the field list. Each field mirrors the psbt_v2 field of the same name, so the macro generates the conversions: from_v2_fields moves the mirrored fields out of a psbt_v2 value, and encode_v2 moves them into one, keeping the psbt_v2 fields that this crate does not mirror. From converts each type from psbt_v2 and back. Global has no PSBT version or input and output counts, so Global::into_v2 takes the counts as arguments and sets the version to 2. The fields are private. A public field cannot enforce an invariant that the type system does not encode, and cannot be made private again without breaking callers. The macro generates a getter of the same name and a `set_` setter with the field's declared visibility, using pastey to name the setters. OutputUniqueIdExt still reads and writes the unique ID of an Output. closes #104 Suggested-by: Codex Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UniqueId becomes a required and immutable field of Output. Output::new takes it, and TryFrom<psbt_v2::v2::Output> reads it from PSBT_OUT_UNIQUE_ID. An output without one, or with an empty or overlong one, is rejected: an empty ID would make unrelated outputs join as one. This replaces OutputUniqueIdExt. joinable_struct! takes the field in a new `proprietary` list. Each entry names a ProprietaryField codec, which defines the field's key subtype and encoding, so changing the key later does not change the field's type or join. The macro decodes the proprietary fields in order, removing their keys, and encodes them back. closes #89 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check compound and proprietary keydata in conflict paths, and exercise optional and map fields in the owned PSBT join and conversion properties.
1397429 to
3e19b23
Compare
range-diff for force push 13974295ec → 3e19b232fd
|
3e19b23 to
8c2e1d8
Compare
range-diff for force push 3e19b232fd → 8c2e1d8f34
|
| //! Per-output field type and output set merging. | ||
| //! | ||
| //! [`ResultOutput`] wraps each per-output field in the internal result domain. | ||
| //! `OutputSet` and `ResultOutputSet` are sets of outputs identified by their |
There was a problem hiding this comment.
Set docs name types the crate lacks
The new input and output module docs present InputSet/ResultInputSet and OutputSet/ResultOutputSet as the set types, and the UniqueId doc repeats OutputSet, but no such items exist in the crate at this commit; the documented join behavior describes API readers cannot find or use.
///
OutputSet.— fungi-protocol/concurrent-psbt@8c2e1d8 · crates/concurrent-psbt/src/psbt/output.rs#L111
oakagent · automated · 8c2e1d8
8c2e1d8 to
50eab5b
Compare
range-diff for force push 8c2e1d8f34 → 50eab5bc68
|
This crate now owns its
Global,Input, andOutputtypes. Building on #121,joinable_struct!defines each source type, result type, conflict variants, and conversions from one field list, subsuming the temporaryrecord_conflicts!macro.joinable_struct!generates the plain struct alongside its result-domain counterpart, plus the From conversions from the psbt_v2 field lists.wrapbecomes an inherent method, replacing GlobalExt, InputExt and OutputExt. Fields are private, with public getters andset_setters by default.[accessors(pub(crate))]restricts accessor visibility when needed. Global drops the PSBT version and the input and output counts, which a conversion derives. OutputUniqueIdExt still reads and writes the unique ID.Output::newsets it, andTryFromreads it from PSBT_OUT_UNIQUE_ID, which must be 1 to 32 bytes. Proprietary fields are declared in the macro throughProprietaryFieldcodecs.closes #104, closes #89, supersedes #76
refs #83: building with
psbt-v2/silent-paymentsno longer fails, but its fields are dropped until this crate has matching features.Taproot key origins keep psbt-v2’s
(Vec<TapLeafHash>, KeySource)representation and use structural equality for joins. Order, repetitions, and the key source must match; differing values remain conflicts.🤖 Generated with Claude Code