Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Nov 16, 2023
1 parent f4be9ea commit bad45bc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions crates/prune/src/segments/account_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ mod tests {
.filter(|(key, _)| key.highest_block_number > last_pruned_block_number)
.map(|(key, blocks)| {
let new_blocks = blocks
.iter(0)
.skip_while(|block| *block <= last_pruned_block_number as usize)
.iter()
.skip_while(|block| *block <= last_pruned_block_number)
.collect::<Vec<_>>();
(key.clone(), BlockNumberList::new_pre_sorted(new_blocks))
})
Expand Down
4 changes: 2 additions & 2 deletions crates/prune/src/segments/storage_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ mod tests {
.filter(|(key, _)| key.sharded_key.highest_block_number > last_pruned_block_number)
.map(|(key, blocks)| {
let new_blocks = blocks
.iter(0)
.skip_while(|block| *block <= last_pruned_block_number as usize)
.iter()
.skip_while(|block| *block <= last_pruned_block_number)
.collect::<Vec<_>>();
(key.clone(), BlockNumberList::new_pre_sorted(new_blocks))
})
Expand Down
6 changes: 3 additions & 3 deletions crates/stages/src/stages/index_account_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ mod tests {
ShardedKey { key: ADDRESS, highest_block_number: shard_index }
}

fn list(list: &[usize]) -> BlockNumberList {
fn list(list: &[u64]) -> BlockNumberList {
BlockNumberList::new(list).unwrap()
}

fn cast(
table: Vec<(ShardedKey<Address>, BlockNumberList)>,
) -> BTreeMap<ShardedKey<Address>, Vec<usize>> {
) -> BTreeMap<ShardedKey<Address>, Vec<u64>> {
table
.into_iter()
.map(|(k, v)| {
let v = v.iter(0).collect();
let v = v.iter().collect();
(k, v)
})
.collect()
Expand Down
6 changes: 3 additions & 3 deletions crates/stages/src/stages/index_storage_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ mod tests {
}
}

fn list(list: &[usize]) -> BlockNumberList {
fn list(list: &[u64]) -> BlockNumberList {
BlockNumberList::new(list).unwrap()
}

fn cast(
table: Vec<(StorageShardedKey, BlockNumberList)>,
) -> BTreeMap<StorageShardedKey, Vec<usize>> {
) -> BTreeMap<StorageShardedKey, Vec<u64>> {
table
.into_iter()
.map(|(k, v)| {
let v = v.iter(0).collect();
let v = v.iter().collect();
(k, v)
})
.collect()
Expand Down

0 comments on commit bad45bc

Please sign in to comment.