feat: add merkle store

This commit is contained in:
Augusto F. Hack
2023-03-14 00:10:54 +01:00
parent 2871e4eb27
commit 88a646031f
8 changed files with 675 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ use winter_math::log2;
/// A fully-balanced binary Merkle tree (i.e., a tree where the number of leaves is a power of two).
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct MerkleTree {
nodes: Vec<Word>,
pub(crate) nodes: Vec<Word>,
}
impl MerkleTree {
@@ -108,6 +108,8 @@ impl MerkleTree {
index.move_up();
}
debug_assert!(index.is_root(), "the path must include the root");
Ok(path.into())
}