Skip to content

Commit

Permalink
mpc: remove Default impl for MerkleBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Feb 28, 2024
1 parent 16bb75b commit 5ae480c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions commit_verify/src/mpc/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::collections::{BTreeMap, BTreeSet};

use amplify::confinement::{Confined, LargeVec};
use amplify::num::u5;
use strict_encoding::{StrictDeserialize, StrictEncode, StrictSerialize};
use strict_encoding::{StrictDeserialize, StrictDumb, StrictEncode, StrictSerialize};

use crate::id::CommitId;
use crate::merkle::{MerkleBuoy, MerkleHash};
Expand Down Expand Up @@ -130,7 +130,7 @@ impl TreeNode {
}

/// Partially-concealed merkle tree data.
#[derive(Getters, Clone, PartialEq, Eq, Hash, Debug, Default)]
#[derive(Getters, Clone, PartialEq, Eq, Hash, Debug)]
#[derive(StrictType, StrictEncode, StrictDecode)]
#[strict_type(lib = LIB_NAME_COMMIT_VERIFY)]
#[derive(CommitEncode)]
Expand All @@ -151,11 +151,22 @@ pub struct MerkleBlock {
cross_section: LargeVec<TreeNode>,

/// Entropy used for placeholders. May be unknown if the message is provided
/// by a third-party, wishing to conceal that information.
/// by a third party, wishing to conceal that information.
#[getter(as_copy)]
entropy: Option<u64>,
}

impl StrictDumb for MerkleBlock {
fn strict_dumb() -> Self {
MerkleBlock {
depth: u5::ONE,
cofactor: 0,
cross_section: confined_vec![TreeNode::strict_dumb()],
entropy: Some(8845),
}
}
}

impl StrictSerialize for MerkleBlock {}
impl StrictDeserialize for MerkleBlock {}

Expand Down

0 comments on commit 5ae480c

Please sign in to comment.