in src/tests.rs [139:161]
fn test_merkle_proof_batch(list: &[(TreeIndex, P)], tree: &SMT<P>) {
// Test batched Merkle proof generation and verification.
// Test batched proof of an empty list of tree indexes.
assert!(Tester::<P>::merkle_proof_existing(tree, &[], &[]));
// Test batched proof of lists of various lengths.
for batch_size in &[1, 100, list.len()] {
for i in 0..LEAF_NUM / batch_size {
let mut proof_list = Vec::new();
let mut leaves = Vec::new();
for j in 0..*batch_size {
proof_list.push(list[i * batch_size + j].0);
leaves.push(list[i * batch_size + j].1.get_proof_node());
}
assert!(Tester::<P>::merkle_proof_existing(
tree,
&leaves,
&proof_list
));
}
}
}