diff --git a/src/util/psbt/serialize.rs b/src/util/psbt/serialize.rs index 589b4193..438693f9 100644 --- a/src/util/psbt/serialize.rs +++ b/src/util/psbt/serialize.rs @@ -388,6 +388,14 @@ mod tests { builder } + #[test] + fn taptree_hidden() { + let mut builder = compose_taproot_builder(0x51, &[2, 2, 2]); + builder = builder.add_leaf_with_ver(3, Script::from_hex("b9").unwrap(), LeafVersion::from_consensus(0xC2).unwrap()).unwrap(); + builder = builder.add_hidden_node(3, sha256::Hash::default()).unwrap(); + assert!(TapTree::from_inner(builder.clone()).is_err()); + } + #[test] fn taptree_roundtrip() { let mut builder = compose_taproot_builder(0x51, &[2, 2, 2, 3]);