INNER CODE UNIT · Rust
test_consistency
risc0/risc0-ethereum · crates/aggregation/src/lib.rs:524
fn test_consistency() {
for length in 1..=128 {
let digests: Vec<Digest> = (0..length)
.map(|_| rand::random::<[u8; 32]>().into())
.collect();
let root = merkle_root(&digests);
for i in 0..length {
let path = merkle_path(&digests, i);
assert_eq!(merkle_path_root(digests[i], &path), root);
}
}
}
#[test]
fn test_encode_decode() {
for length in 0..=128 {
let digests: Vec<Digest> = (0..length)