Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratyush committed Dec 28, 2023
1 parent 93e0e8d commit 9b82567
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/merkle_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl<P: Config> MerkleTree<P> {
) -> Result<Self, crate::Error> {
// use empty leaf digest
let leaf_digests = vec![P::LeafDigest::default(); 1 << (height - 1)];
Self::new_with_leaf_digest(leaf_hash_param, two_to_one_hash_param, &leaf_digests)
Self::new_with_leaf_digest(leaf_hash_param, two_to_one_hash_param, leaf_digests)
}

/// Returns a new merkle tree. `leaves.len()` should be power of two.
Expand All @@ -249,13 +249,13 @@ impl<P: Config> MerkleTree<P> {
.map(|input| P::LeafHash::evaluate(leaf_hash_param, input.as_ref()))
.collect::<Result<Vec<_>, _>>()?;

Self::new_with_leaf_digest(leaf_hash_param, two_to_one_hash_param, &leaf_digests)
Self::new_with_leaf_digest(leaf_hash_param, two_to_one_hash_param, leaf_digests)
}

pub fn new_with_leaf_digest(
leaf_hash_param: &LeafParam<P>,
two_to_one_hash_param: &TwoToOneParam<P>,
leaf_digests: &[P::LeafDigest],
leaf_digests: Vec<P::LeafDigest>,
) -> Result<Self, crate::Error> {
let leaf_nodes_size = leaf_digests.len();
assert!(
Expand Down

0 comments on commit 9b82567

Please sign in to comment.