Skip to content

Commit

Permalink
ValuePath: adjust constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer committed Jan 17, 2024
1 parent 49cdf63 commit 7e9afc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/merkle/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ pub struct ValuePath {

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) }
pub fn new(value: RpoDigest, path: MerklePath) -> Self {
Self { value, path }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/merkle/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl<T: KvMap<RpoDigest, StoreNode>> MerkleStore<T> {
// the path is computed from root to leaf, so it must be reversed
path.reverse();

Ok(ValuePath::new(hash, path))
Ok(ValuePath::new(hash, MerklePath::new(path)))
}

// LEAF TRAVERSAL
Expand Down

0 comments on commit 7e9afc9

Please sign in to comment.