mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-12 09:01:29 +01:00
fix: to paths reduction of MerklePathSet
This commit is contained in:
@@ -317,11 +317,10 @@ impl MerkleStore {
|
||||
/// For further reference, check [MerkleStore::add_merkle_path].
|
||||
pub fn add_merkle_path_set(&mut self, path_set: &MerklePathSet) -> Result<Word, MerkleError> {
|
||||
let root = path_set.root();
|
||||
path_set.indexes().try_fold(root, |_, index| {
|
||||
let node = path_set.get_node(index)?;
|
||||
let path = path_set.get_path(index)?;
|
||||
self.add_merkle_path(index.value(), node, path)
|
||||
})
|
||||
for (index, path) in path_set.to_paths() {
|
||||
self.add_merkle_path(index, path.value, path.path)?;
|
||||
}
|
||||
Ok(root)
|
||||
}
|
||||
|
||||
/// Sets a node to `value`.
|
||||
|
||||
Reference in New Issue
Block a user