From 260592f8e771fba1e47d0110cebbe99cc7cd77ab Mon Sep 17 00:00:00 2001 From: cristiantroy <154241727+cristiantroy@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:17:48 +0800 Subject: [PATCH] Fix: typos (#249) * tests: fix typos * full.rs: fix typo * CONTRIBUTING: fix typo --- CONTRIBUTING.md | 2 +- src/merkle/mmr/full.rs | 2 +- src/merkle/store/tests.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47a46eb..e1452de 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,7 +72,7 @@ For example, a new change to the AIR crate might have the following message: `fe // ================================================================================ ``` -- [Rustfmt](https://github.com/rust-lang/rustfmt) and [Clippy](https://github.com/rust-lang/rust-clippy) linting is included in CI pipeline. Anyways it's prefferable to run linting locally before push: +- [Rustfmt](https://github.com/rust-lang/rustfmt) and [Clippy](https://github.com/rust-lang/rust-clippy) linting is included in CI pipeline. Anyways it's preferable to run linting locally before push: ``` cargo fix --allow-staged --allow-dirty --all-targets --all-features; cargo fmt; cargo clippy --workspace --all-targets --all-features -- -D warnings ``` diff --git a/src/merkle/mmr/full.rs b/src/merkle/mmr/full.rs index b47437d..3836567 100644 --- a/src/merkle/mmr/full.rs +++ b/src/merkle/mmr/full.rs @@ -280,7 +280,7 @@ impl Mmr { // Update the depth of the tree to correspond to a subtree forest_target >>= 1; - // compute the indeces of the right and left subtrees based on the post-order + // compute the indices of the right and left subtrees based on the post-order let right_offset = index - 1; let left_offset = right_offset - nodes_in_forest(forest_target); diff --git a/src/merkle/store/tests.rs b/src/merkle/store/tests.rs index 004e020..2d22b3d 100644 --- a/src/merkle/store/tests.rs +++ b/src/merkle/store/tests.rs @@ -103,7 +103,7 @@ fn test_merkle_tree() -> Result<(), MerkleError> { "node 3 must be the same for both MerkleTree and MerkleStore" ); - // STORE MERKLE PATH MATCHS ============================================================== + // STORE MERKLE PATH MATCHES ============================================================== // assert the merkle path returned by the store is the same as the one in the tree let result = store.get_path(mtree.root(), NodeIndex::make(mtree.depth(), 0)).unwrap(); assert_eq!( @@ -290,7 +290,7 @@ fn test_sparse_merkle_tree() -> Result<(), MerkleError> { "node 4 must be the same for both SparseMerkleTree and MerkleStore" ); - // STORE MERKLE PATH MATCHS ============================================================== + // STORE MERKLE PATH MATCHES ============================================================== // assert the merkle path returned by the store is the same as the one in the tree let result = store.get_path(smt.root(), NodeIndex::make(smt.depth(), 0)).unwrap(); assert_eq!( @@ -425,7 +425,7 @@ fn test_add_merkle_paths() -> Result<(), MerkleError> { "node 3 must be the same for both PartialMerkleTree and MerkleStore" ); - // STORE MERKLE PATH MATCHS ============================================================== + // STORE MERKLE PATH MATCHES ============================================================== // assert the merkle path returned by the store is the same as the one in the pmt let result = store.get_path(pmt.root(), NodeIndex::make(pmt.max_depth(), 0)).unwrap(); assert_eq!( @@ -649,7 +649,7 @@ fn get_leaf_depth_works_depth_64() { let index = NodeIndex::new(64, k).unwrap(); // assert the leaf doesn't exist before the insert. the returned depth should always - // increment with the paths count of the set, as they are insersecting one another up to + // increment with the paths count of the set, as they are intersecting one another up to // the first bits of the used key. assert_eq!(d, store.get_leaf_depth(root, 64, k).unwrap());