Skip to content

Commit 3d1f72e

Browse files
taproot-tests: validate tap_tree in psbt outputs
Co-authored-by: Daniela Brozzoni <[email protected]>
1 parent 660f543 commit 3d1f72e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/wallet/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -4289,6 +4289,8 @@ pub(crate) mod test {
42894289

42904290
#[test]
42914291
fn test_taproot_psbt_input_tap_tree() {
4292+
use crate::bitcoin::psbt::serialize::Deserialize;
4293+
use crate::bitcoin::psbt::TapTree;
42924294
use bitcoin::hashes::hex::FromHex;
42934295
use bitcoin::util::taproot;
42944296

@@ -4328,6 +4330,11 @@ pub(crate) mod test {
43284330
psbt.inputs[0].tap_internal_key,
43294331
psbt.outputs[0].tap_internal_key
43304332
);
4333+
4334+
assert_eq!(
4335+
psbt.outputs[0].tap_tree,
4336+
Some(TapTree::deserialize(&Vec::<u8>::from_hex("01c022208aee2b8120a5f157f1223f72b5e62b825831a27a9fdf427db7cc697494d4a642ac01c0222051494dc22e24a32fe9dcfbd7e85faf345fa1df296fb49d156e859ef345201295ac",).unwrap()).unwrap())
4337+
);
43314338
}
43324339

43334340
#[test]

0 commit comments

Comments
 (0)