[descriptor] Add descriptor templates, add DerivableKey

This commit is contained in:
Alekos Filini
2020-09-22 16:12:09 +02:00
parent c51ba4a99f
commit c93cd1414a
7 changed files with 553 additions and 44 deletions

View File

@@ -37,6 +37,7 @@ macro_rules! impl_top_level_sh {
#[macro_export]
macro_rules! impl_top_level_pk {
( $descriptor_variant:ident, $ctx:ty, $key:expr ) => {{
#[allow(unused_imports)]
use $crate::keys::{DescriptorKey, ToDescriptorKey};
$key.to_descriptor_key()
@@ -254,7 +255,7 @@ macro_rules! descriptor {
$crate::impl_top_level_pk!(Wpkh, $crate::miniscript::Segwitv0, $key)
});
( sh ( wpkh ( $key:expr ) ) ) => ({
$crate::descriptor!(shwpkh ($( $minisc )*))
$crate::descriptor!(shwpkh ( $key ))
});
( shwpkh ( $key:expr ) ) => ({
$crate::impl_top_level_pk!(ShWpkh, $crate::miniscript::Segwitv0, $key)