Skip to content

Commit

Permalink
merkle: plan for MerkleBuoy generic default to be removed in v0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 6, 2023
1 parent 270ac2c commit 247db25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions commit_verify/src/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ where T: CommitmentId<Id = MerkleNode> + Copy
}

/// Helper struct to track depth when working with Merkle blocks.
// TODO: v0.11 Remove default generic from MerkleBuoy
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct MerkleBuoy<D: Copy + Eq + SubAssign<u8> + Default = u5> {
buoy: D,
Expand Down
4 changes: 2 additions & 2 deletions commit_verify/src/mpc/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ impl MerkleBlock {
}
Ordering::Less => {
cross_section.push(n2);
let mut buoy = MerkleBuoy::new(n2_depth);
let mut buoy = MerkleBuoy::<u5>::new(n2_depth);
let mut stop = false;
last_b = None;
cross_section.extend(b.by_ref().take_while(|n| {
Expand All @@ -448,7 +448,7 @@ impl MerkleBlock {
}
Ordering::Greater => {
cross_section.push(n1);
let mut buoy = MerkleBuoy::new(n1_depth);
let mut buoy = MerkleBuoy::<u5>::new(n1_depth);
let mut stop = false;
last_a = None;
cross_section.extend(a.by_ref().take_while(|n| {
Expand Down

0 comments on commit 247db25

Please sign in to comment.