Add breaking test that allowed incomplete builders to be created

This commit is contained in:
sanket1729 2022-07-28 17:38:26 -07:00
parent 0b88051318
commit aaadd25ddc
1 changed files with 3 additions and 0 deletions

View File

@ -1340,6 +1340,9 @@ mod test {
let builder = builder.add_leaf(2, b.clone()).unwrap(); let builder = builder.add_leaf(2, b.clone()).unwrap();
let builder = builder.add_leaf(2, c.clone()).unwrap(); let builder = builder.add_leaf(2, c.clone()).unwrap();
let builder = builder.add_leaf(3, d.clone()).unwrap(); let builder = builder.add_leaf(3, d.clone()).unwrap();
// Trying to finalize an incomplete tree returns the Err(builder)
let builder = builder.finalize(&secp, internal_key).unwrap_err();
let builder = builder.add_leaf(3, e.clone()).unwrap(); let builder = builder.add_leaf(3, e.clone()).unwrap();
let tree_info = builder.finalize(&secp, internal_key).unwrap(); let tree_info = builder.finalize(&secp, internal_key).unwrap();