Fix failing struct vec vectors

This commit is contained in:
Paul Hauner
2019-04-12 16:52:11 +10:00
parent 48cf75e394
commit d79616fee6
3 changed files with 11 additions and 17 deletions

View File

@@ -473,9 +473,14 @@ fn test_inner_vec_modifications(original: Vec<Inner>, modified: Vec<Inner>, refe
full_bytes.append(&mut merkle);
}
let num_leaves = leaves.len() / HASHSIZE;
let mut expected = merkleize(leaves);
expected.splice(3 * HASHSIZE.., full_bytes);
expected.append(&mut vec![0; HASHSIZE]);
for _ in num_leaves..num_leaves.next_power_of_two() {
expected.append(&mut vec![0; HASHSIZE]);
}
// Compare the cached tree to the reference tree.
assert_trees_eq(&expected, &modified_cache);