From 5320c8353e05adecf0d18336d48934567257e64d Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Tue, 31 May 2022 17:47:26 +0200 Subject: [PATCH] taproot-tests: validate `tap_tree` in psbt outputs Co-authored-by: Daniela Brozzoni --- src/wallet/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index 13c7fa2a..6d2ff385 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -4289,6 +4289,8 @@ pub(crate) mod test { #[test] fn test_taproot_psbt_input_tap_tree() { + use crate::bitcoin::psbt::serialize::Deserialize; + use crate::bitcoin::psbt::TapTree; use bitcoin::hashes::hex::FromHex; use bitcoin::util::taproot; @@ -4328,6 +4330,11 @@ pub(crate) mod test { psbt.inputs[0].tap_internal_key, psbt.outputs[0].tap_internal_key ); + + assert_eq!( + psbt.outputs[0].tap_tree, + Some(TapTree::deserialize(&Vec::::from_hex("01c022208aee2b8120a5f157f1223f72b5e62b825831a27a9fdf427db7cc697494d4a642ac01c0222051494dc22e24a32fe9dcfbd7e85faf345fa1df296fb49d156e859ef345201295ac",).unwrap()).unwrap()) + ); } #[test]