diff --git a/src/merkle/mod.rs b/src/merkle/mod.rs index 411dd7e..0afbce9 100644 --- a/src/merkle/mod.rs +++ b/src/merkle/mod.rs @@ -71,8 +71,8 @@ impl fmt::Display for MerkleError { 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), } } } diff --git a/src/merkle/store/mod.rs b/src/merkle/store/mod.rs index 961d4b8..5610429 100644 --- a/src/merkle/store/mod.rs +++ b/src/merkle/store/mod.rs @@ -92,12 +92,12 @@ impl MerkleStore { /// # 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 { 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 @@ impl MerkleStore { /// # 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 @@ impl MerkleStore { 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 @@ impl MerkleStore { /// 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 @@ impl MerkleStore { /// 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 @@ impl MerkleStore { /// 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 @@ impl MerkleStore { /// 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 @@ impl MerkleStore { /// # 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, diff --git a/src/merkle/store/tests.rs b/src/merkle/store/tests.rs index a60adb4..c469553 100644 --- a/src/merkle/store/tests.rs +++ b/src/merkle/store/tests.rs @@ -14,7 +14,7 @@ const LEAVES4: [Word; 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!(