Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKitsune committed Apr 17, 2024
1 parent 64f0edc commit 063634c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cascading_merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,14 +928,19 @@ mod tests {
#[test]
fn test_extend_from_slice() -> color_eyre::Result<()> {
let leaves = (0..1 << 5).into_iter().map(Field::from).collect::<Vec<_>>();

// Create expected tree
let expected_tree =
CascadingMerkleTree::<PoseidonHash>::new_with_leaves(vec![], 10, &Field::ZERO, &leaves);

let mut tree = CascadingMerkleTree::<PoseidonHash>::new(vec![], 10, &Field::ZERO);
tree.extend_from_slice(&leaves);

assert_eq!(
tree.leaves().collect::<Vec<Field>>(),
expected_tree.leaves().collect::<Vec<Field>>()
);

assert_eq!(tree.root(), expected_tree.root());
Ok(())
}
Expand Down

0 comments on commit 063634c

Please sign in to comment.