Merge commit 'refs/pull/385/head' of github.com:bitcoindevkit/bdk into release/0.9.0

This commit is contained in:
Alekos Filini 2021-07-06 09:57:22 +02:00
commit d1658a2eda
No known key found for this signature in database
GPG Key ID: 431401E4A4530061

View File

@ -175,7 +175,7 @@ macro_rules! impl_node_opcode_two {
#[doc(hidden)]
#[macro_export]
macro_rules! impl_node_opcode_three {
( $terminal_variant:ident, $( $inner:tt )* ) => {
( $terminal_variant:ident, $( $inner:tt )* ) => ({
use $crate::descriptor::CheckMiniscript;
let inner = $crate::fragment_internal!( @t $( $inner )* );
@ -201,7 +201,7 @@ macro_rules! impl_node_opcode_three {
Ok((minisc, a_keymap, networks))
})
};
});
}
#[doc(hidden)]
@ -790,6 +790,25 @@ mod test {
);
}
#[test]
fn test_fixed_threeop_descriptors() {
let redeem_key = bitcoin::PublicKey::from_str(
"03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd",
)
.unwrap();
let move_key = bitcoin::PublicKey::from_str(
"032e58afe51f9ed8ad3cc7897f634d881fdbe49a81564629ded8156bebd2ffd1af",
)
.unwrap();
check(
descriptor!(sh(wsh(and_or(pk(redeem_key), older(1000), pk(move_key))))),
true,
true,
&["2MypGwr5eQWAWWJtiJgUEToVxc4zuokjQRe"],
);
}
#[test]
fn test_bip32_legacy_descriptors() {
let xprv = bip32::ExtendedPrivKey::from_str("tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy").unwrap();