Skip to content

Introduce joinable Output struct type - #90

Merged
arminsabouri merged 1 commit into
mainfrom
output-type
Nov 13, 2026
Merged

arminsabouri merged 1 commit into
mainfrom
output-type

Conversation

@yuval-block

Copy link
Copy Markdown
Collaborator

Reopens #74, which was merged into `struct-macro` before #68 landed. Same commit, now stacked on #68.

🤖 Generated with Claude Code

@github-code-quality

github-code-quality Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main 543f744 output-type 930cf29 +/-
100% 100% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 13, 2026 14:55 UTC

@arminsabouri arminsabouri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

re-ACK

Base automatically changed from struct-macro to main November 12, 2026 19:36
@github-actions

Copy link
Copy Markdown
range-diff for force push e35e224dba → 549c733b12 November 12, 2026 20:16 UTC: 1 modified; 1 commit; base 94c1abc38e → 227c7b51ba (descendant, 3 commits ahead)

reproduce: git range-diff 94c1abc..e35e224 227c7b5..549c733

1:  e35e224dba +172 -32 6f ! 1:  549c733b12 +172 -28 5f Introduce joinable Output struct type
1: e35e224dba ! 1: 549c733b12 Introduce joinable Output struct type
@@ crates/concurrent-psbt/src/lib.rs: mod psbt;
  pub use lattice::partial::{Conflict, JoinResult, PartialJoin};
 +pub use psbt::output;
 
- ## crates/concurrent-psbt/src/psbt/joinable_struct_macro.rs ##
-@@
- /// The field list must name at least one field: `is_ok` is generated as the
- /// conjunction of the per-field checks, which has no expansion for an empty
- /// list.
--#[cfg_attr(
--    not(all(test, feature = "unit-tests")),
--    expect(unused_macros, reason = "expanded by the PSBT field types")
--)]
- macro_rules! joinable_struct {
-     // ── Entry point ──────────────────────────────────────────
-     (
-
  ## crates/concurrent-psbt/src/psbt/mod.rs ##
 @@
  #[macro_use]
  mod joinable_struct_macro;
+ pub(crate) mod global;
 +pub mod output;
  mod values;

@arminsabouri arminsabouri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

re-ACK

@bc1cindy bc1cindy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK 549c733

@github-actions

Copy link
Copy Markdown
range-diff for force push 549c733b12 → 930cf29805 November 13, 2026 14:43 UTC: 1 modified; 1 commit; base 227c7b51ba → 543f744bef (descendant, 2 commits ahead)

reproduce: git range-diff 227c7b5..549c733 543f744..930cf29

1:  549c733b12 +172 -28 5f ! 1:  930cf29805 +172  -0 3f Introduce joinable Output struct type
1: 549c733b12 ! 1: 930cf29805 Introduce joinable Output struct type
@@ Metadata
  ## Commit message ##
     Introduce joinable Output struct type
 
- ## crates/concurrent-psbt/src/collections/btreemap.rs ##
-@@ crates/concurrent-psbt/src/collections/btreemap.rs: use crate::lattice::join::{Join, JoinMut};
- use crate::lattice::partial::{JoinResult, PartialJoin};
- 
- /// Extension trait for lifting `BTreeMap<K, V>` values to `Ok`, entering the result domain.
--#[cfg_attr(
--    not(test),
--    expect(
--        dead_code,
--        reason = "used once PSBT field types join in the result domain"
--    )
--)]
- pub(crate) trait BTreeMapExt {
-     type Key;
-     type Value: PartialJoin;
-@@ crates/concurrent-psbt/src/collections/btreemap.rs: impl<K: Ord, V: PartialJoin> BTreeMapExt for BTreeMap<K, V> {
- 
- /// Extension trait for `BTreeMap<K, JoinResult<V>>` — `is_ok` checks all values,
- /// `try_unwrap` extracts the plain map or returns `self` on conflict.
--#[cfg_attr(
--    not(test),
--    expect(
--        dead_code,
--        reason = "used once PSBT field types join in the result domain"
--    )
--)]
- pub(crate) trait ResultBTreeMapExt: Sized {
-     type Key;
-     type Value: PartialJoin;
-
- ## crates/concurrent-psbt/src/collections/option.rs ##
-@@ crates/concurrent-psbt/src/collections/option.rs: where
- }
- 
- /// Extension trait for lifting `Option<V>` into the result domain.
--#[cfg_attr(
--    not(test),
--    expect(
--        dead_code,
--        reason = "used once PSBT field types join in the result domain"
--    )
--)]
- pub(crate) trait OptionExt {
-     type Item: PartialJoin;
-     /// Lift each inner value to `Ok`, preserving `None`.
-@@ crates/concurrent-psbt/src/collections/option.rs: impl<V: PartialJoin> OptionExt for Option<V> {
- }
- 
- /// Extension trait for `Option<JoinResult<V>>` — conflict detection and extraction.
--#[cfg_attr(
--    not(test),
--    expect(
--        dead_code,
--        reason = "used once PSBT field types join in the result domain"
--    )
--)]
- pub(crate) trait ResultOptionExt {
-     type Value: PartialJoin;
-     /// Returns `true` if the option is `None` or contains `Ok`.
-
  ## crates/concurrent-psbt/src/lib.rs ##
 @@ crates/concurrent-psbt/src/lib.rs: mod psbt;
- 
  pub use lattice::join::{Join, JoinMut};
  pub use lattice::partial::{Conflict, JoinResult, PartialJoin};
+ pub use psbt::input;
 +pub use psbt::output;
 
  ## crates/concurrent-psbt/src/psbt/mod.rs ##
 @@
- #[macro_use]
  mod joinable_struct_macro;
  pub(crate) mod global;
+ pub mod input;
 +pub mod output;
  mod values;

@arminsabouri arminsabouri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

re-ACK

@arminsabouri
arminsabouri added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit bf9b058 Nov 13, 2026
6 checks passed
@arminsabouri
arminsabouri deleted the output-type branch November 13, 2026 15:06
Mshehu5 pushed a commit to Mshehu5/concurrent-psbt that referenced this pull request Nov 14, 2026
Introduce the PSBT_OUT_UNIQUE_ID field (currently proprietary field)
which serves as a stable key for outputs in unordered PSBTS.

Reopens fungi-protocol#77, which was merged into \`struct-macro\` before fungi-protocol#68 landed.
Same commit, now stacked on fungi-protocol#90.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

5 participants