Skip to content

Commit

Permalink
mpc: add MerkleTree::commit_id
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Mar 27, 2023
1 parent f25bf8b commit 9723b32
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions commit_verify/src/mpc/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use amplify::Wrapper;
pub use self::commit::Error;
use crate::merkle::{MerkleLeaves, MerkleNode};
use crate::mpc::atoms::Leaf;
use crate::mpc::{Message, MessageMap, Proof, ProtocolId, LNPBP4_TAG};
use crate::{Conceal, LIB_NAME_COMMIT_VERIFY};
use crate::mpc::{Commitment, Message, MessageMap, Proof, ProtocolId, LNPBP4_TAG};
use crate::{strategies, CommitStrategy, CommitmentId, Conceal, LIB_NAME_COMMIT_VERIFY};

type OrderedMap = SmallOrdMap<u16, (ProtocolId, Message)>;

Expand All @@ -51,6 +51,15 @@ pub struct MerkleTree {

impl Proof for MerkleTree {}

impl CommitStrategy for MerkleTree {
type Strategy = strategies::ConcealStrict;
}

impl CommitmentId for MerkleTree {
const TAG: [u8; 32] = *b"urn:lnpbp:lnpbp0004:tree:v01#23A";
type Id = Commitment;
}

pub struct IntoIter {
width: u16,
pos: u16,
Expand Down

0 comments on commit 9723b32

Please sign in to comment.