mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-12 09:01:29 +01:00
feat: add merkle path containers and return them on tree update
Returning tuples is often confusing as they don't convey meaning and it should be used only when there is no possible ambiguity. For `MerkleStore`, we had a couple of tuples being returned, and reading the implementation was required in order to distinguish if they were leaf values or computed roots. This commit introduces two containers that will self-document these returns: `RootPath` and `ValuePath`. It will also update `set_node` to return both the new root & the new path, so we can prevent duplicated traversals downstream when updating a node (one to update, the second to fetch the new path/root).
This commit is contained in:
@@ -18,7 +18,7 @@ mod merkle_tree;
|
||||
pub use merkle_tree::MerkleTree;
|
||||
|
||||
mod path;
|
||||
pub use path::MerklePath;
|
||||
pub use path::{MerklePath, RootPath, ValuePath};
|
||||
|
||||
mod path_set;
|
||||
pub use path_set::MerklePathSet;
|
||||
|
||||
Reference in New Issue
Block a user