feat: implement additional leaf traversal methods on MerkleStore

This commit is contained in:
Bobbin Threadbare
2023-08-16 02:54:11 -07:00
parent 85034af1df
commit 9f54c82d62
5 changed files with 163 additions and 30 deletions

View File

@@ -160,6 +160,16 @@ pub struct ValuePath {
pub path: MerklePath,
}
impl ValuePath {
/// Returns a new [ValuePath] instantiated from the specified value and path.
pub fn new(value: RpoDigest, path: Vec<RpoDigest>) -> Self {
Self {
value,
path: MerklePath::new(path),
}
}
}
/// A container for a [MerklePath] and its [Word] root.
///
/// This structure does not provide any guarantees regarding the correctness of the path to the