chore: storage -> store
Augusto F. Hack hack.augusto@gmail.com
Mon, 20 Mar 2023 21:55:57 +0100
3 files changed,
12 insertions(+),
12 deletions(-)
M
src/merkle/mod.rs
→
src/merkle/mod.rs
@@ -71,8 +71,8 @@ ),
InvalidPath(_path) => write!(f, "the provided path is not valid"), InvalidEntriesCount(max, provided) => write!(f, "the provided number of entries is {provided}, but the maximum for the given depth is {max}"), NodeNotInSet(index) => write!(f, "the node indexed by {index} is not in the set"), - NodeNotInStore(hash, index) => write!(f, "the node {:?} indexed by {} and depth {} is not in the storage", hash, index.value(), index.depth(),), - RootNotInStore(root) => write!(f, "the root {:?} is not in the storage", root), + NodeNotInStore(hash, index) => write!(f, "the node {:?} indexed by {} and depth {} is not in the store", hash, index.value(), index.depth(),), + RootNotInStore(root) => write!(f, "the root {:?} is not in the store", root), } } }
M
src/merkle/store/mod.rs
→
src/merkle/store/mod.rs
@@ -92,12 +92,12 @@ ///
/// # Errors /// /// This method can return the following errors: - /// - `RootNotInStore` if the `root` is not present in the storage. + /// - `RootNotInStore` if the `root` is not present in the store. /// - `NodeNotInStore` if a node needed to traverse from `root` to `index` is not present in the store. pub fn get_node(&self, root: Word, index: NodeIndex) -> Result<Word, MerkleError> { let mut hash: RpoDigest = root.into(); - // corner case: check the root is in the storage when called with index `NodeIndex::root()` + // corner case: check the root is in the store when called with index `NodeIndex::root()` self.nodes .get(&hash) .ok_or(MerkleError::RootNotInStore(hash.into()))?;@@ -120,7 +120,7 @@ ///
/// # Errors /// /// This method can return the following errors: - /// - `RootNotInStore` if the `root` is not present in the storage. + /// - `RootNotInStore` if the `root` is not present in the store. /// - `NodeNotInStore` if a node needed to traverse from `root` to `index` is not present in the store. pub fn get_path( &self,@@ -130,7 +130,7 @@ ) -> Result<(Word, MerklePath), MerkleError> {
let mut hash: RpoDigest = root.into(); let mut path = Vec::with_capacity(index.depth().into()); - // corner case: check the root is in the storage when called with index `NodeIndex::root()` + // corner case: check the root is in the store when called with index `NodeIndex::root()` self.nodes .get(&hash) .ok_or(MerkleError::RootNotInStore(hash.into()))?;@@ -160,7 +160,7 @@
/// Adds all the nodes of a Merkle tree represented by `leaves`. /// /// This will instantiate a Merkle tree using `leaves` and include all the nodes into the - /// storage. + /// store. /// /// # Errors ///@@ -208,7 +208,7 @@
/// Adds all the nodes of a Sparse Merkle tree represented by `entries`. /// /// This will instantiate a Sparse Merkle tree using `entries` and include all the nodes into - /// the storage. + /// the store. /// /// # Errors ///@@ -236,7 +236,7 @@
/// Adds all the nodes of a Merkle path represented by `path`. /// /// This will compute the sibling elements determined by the Merkle `path` and `node`, and - /// include all the nodes into the storage. + /// include all the nodes into the store. pub fn add_merkle_path( &mut self, index_value: u64,@@ -270,7 +270,7 @@
/// Adds all the nodes of multiple Merkle paths into the store. /// /// This will compute the sibling elements for each Merkle `path` and include all the nodes - /// into the storage. + /// into the store. /// /// # Errors ///@@ -315,7 +315,7 @@ ///
/// # Errors /// /// This method can return the following errors: - /// - `RootNotInStore` if the `root` is not present in the storage. + /// - `RootNotInStore` if the `root` is not present in the store. /// - `NodeNotInStore` if a node needed to traverse from `root` to `index` is not present in the store. pub fn set_node( &mut self,
M
src/merkle/store/tests.rs
→
src/merkle/store/tests.rs
@@ -14,7 +14,7 @@ int_to_node(4),
]; #[test] -fn test_root_not_in_storage() -> Result<(), MerkleError> { +fn test_root_not_in_store() -> Result<(), MerkleError> { let mtree = MerkleTree::new(LEAVES4.to_vec())?; let store = MerkleStore::default().with_merkle_tree(LEAVES4)?; assert_eq!(