Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeytimoshin committed May 8, 2024
1 parent 5240649 commit 5a9eda7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion merkle-tree/concurrent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ where
for _ in lower_range..upper_range {
self.changelog[i].update_proof(leaf_index, proof, allow_updates_changelog)?;
i = (i + 1) % self.changelog_length;
}
}
} else {
self.changelog[0].update_proof(leaf_index, proof, allow_updates_changelog)?;
}
Expand Down
13 changes: 10 additions & 3 deletions merkle-tree/concurrent/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ use light_concurrent_merkle_tree::{
changelog::ChangelogEntry, errors::ConcurrentMerkleTreeError, event::ChangelogEvent,
ConcurrentMerkleTree,
};
use light_hash_set::HashSet;
use light_hasher::{Hasher, Keccak, Poseidon, Sha256};
use light_merkle_tree_reference::store::Store;
use num_bigint::BigUint;
use num_traits::FromBytes;
use rand::{thread_rng, Rng};
use solana_program::pubkey::Pubkey;
use light_hash_set::HashSet;

/// Tests whether append operations work as expected.
fn append<H, const CANOPY: usize>()
Expand Down Expand Up @@ -1229,7 +1229,7 @@ pub fn test_100_nullify_mt() {
onchain_merkle_tree.root().unwrap(),
crank_merkle_tree.root()
);

let mut queue = HashSet::<u16>::new(6857, 4800, 2400).unwrap();
for i in 1..1 + iterations {
let mut leaf = [0; 32];
Expand Down Expand Up @@ -1263,7 +1263,14 @@ pub fn test_100_nullify_mt() {
.get_proof_of_leaf(leaf_index, false)
.unwrap();
onchain_merkle_tree
.update(change_log_index, &leaf, &[0u8; 32], leaf_index, &mut proof0, false)
.update(
change_log_index,
&leaf,
&[0u8; 32],
leaf_index,
&mut proof0,
false,
)
.unwrap();
}
nullified_leaf_indices.remove(0);
Expand Down

0 comments on commit 5a9eda7

Please sign in to comment.