Skip to content

Commit

Permalink
Add breaking test that allowed incomplete builders to be created
Browse files Browse the repository at this point in the history
  • Loading branch information
sanket1729 committed Jul 29, 2022
1 parent 0b88051 commit aaadd25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/util/taproot.rs
Expand Up @@ -1340,6 +1340,9 @@ mod test {
let builder = builder.add_leaf(2, b.clone()).unwrap();
let builder = builder.add_leaf(2, c.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 tree_info = builder.finalize(&secp, internal_key).unwrap();
Expand Down

0 comments on commit aaadd25

Please sign in to comment.