Skip to content

Commit

Permalink
added tree history size to inclusion proof test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKitsune committed Oct 27, 2023
1 parent 7f944a1 commit 788e563
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/tree_availability/src/world_tree/tree_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl TreeData {
}

pub async fn cache_tree_history(&self) {
if self.tree_history_size > 0 {
if self.tree_history_size != 0 {
let mut tree_history = self.tree_history.write().await;

if tree_history.len() == self.tree_history_size {
Expand Down Expand Up @@ -199,7 +199,7 @@ mod tests {
// Then you can apply the remaining updates
tree_data.insert_many_at(5, &identities[5..]).await;

for (i, identity) in identities.iter().enumerate().take(5) {
for (i, _identity) in identities.iter().enumerate().take(5) {
let proof_from_world_tree = tree_data
.get_inclusion_proof(identities[i], Some(root))
.await
Expand Down Expand Up @@ -227,7 +227,7 @@ mod tests {
}

#[tokio::test]
async fn test_inclusion_proof_after_deletions() {
async fn test_get_inclusion_proof_after_deletions() {
let (tree_data, mut ref_tree, identities) =
initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES);

Expand Down
4 changes: 2 additions & 2 deletions crates/tree_availability/tests/inclusion_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn test_inclusion_proof() -> eyre::Result<()> {
vec![U256::from(1), U256::from(2), U256::from(3)];

let world_tree_creation_block =
middleware.get_block_number().await?.as_u64();
middleware.get_block_number().await?.as_u64() - 1;

mock_world_id
.register_identities(
Expand Down Expand Up @@ -57,7 +57,7 @@ async fn test_inclusion_proof() -> eyre::Result<()> {
let tree_availability_service = TreeAvailabilityService::new(
3,
1,
0,
5,
world_tree_address,
world_tree_creation_block,
middleware,
Expand Down

0 comments on commit 788e563

Please sign in to comment.