From: Alekos Filini Date: Tue, 31 May 2022 15:47:26 +0000 (+0200) Subject: taproot-tests: validate `tap_tree` in psbt outputs X-Git-Tag: v0.19.0~5^2~2 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/enum.FileStoreError.html?a=commitdiff_plain;h=5320c8353e05adecf0d18336d48934567257e64d;p=bdk taproot-tests: validate `tap_tree` in psbt outputs Co-authored-by: Daniela Brozzoni --- 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]