From aaadd25ddc3ed9da986988d73ad4b839d2cda26d Mon Sep 17 00:00:00 2001 From: sanket1729 Date: Thu, 28 Jul 2022 17:38:26 -0700 Subject: [PATCH] Add breaking test that allowed incomplete builders to be created --- src/util/taproot.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/taproot.rs b/src/util/taproot.rs index 90f7c820..17d1ac94 100644 --- a/src/util/taproot.rs +++ b/src/util/taproot.rs @@ -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();