fn from_tree(top: &expression::Tree) -> Result<PreTaprootDescriptor<Pk>, Error> {
        Ok(match (top.name, top.args.len() as u32) {
            ("pkh", 1) => PreTaprootDescriptor::Pkh(Pkh::from_tree(top)?),
            ("wpkh", 1) => PreTaprootDescriptor::Wpkh(Wpkh::from_tree(top)?),
            ("sh", 1) => PreTaprootDescriptor::Sh(Sh::from_tree(top)?),
            ("wsh", 1) => PreTaprootDescriptor::Wsh(Wsh::from_tree(top)?),
            _ => PreTaprootDescriptor::Bare(Bare::from_tree(top)?),
        })
    }
/// Parse an expression tree into a descriptor
Parse an expression tree into a descriptor
Parse an expression tree into a descriptor
fn from_tree(top: &expression::Tree) -> Result<PreTaprootDescriptor<Pk>, Error> {
        Ok(match (top.name, top.args.len() as u32) {
            ("pkh", 1) => PreTaprootDescriptor::Pkh(Pkh::from_tree(top)?),
            ("wpkh", 1) => PreTaprootDescriptor::Wpkh(Wpkh::from_tree(top)?),
            ("sh", 1) => PreTaprootDescriptor::Sh(Sh::from_tree(top)?),
            ("wsh", 1) => PreTaprootDescriptor::Wsh(Wsh::from_tree(top)?),
            _ => PreTaprootDescriptor::Bare(Bare::from_tree(top)?),
        })
    }
fn from_tree ( top : & expression :: Tree ) -> Result < PreTaprootDescriptor < Pk > , Error > { Ok ( match ( top . name , top . args . len ( ) as u32 ) { ( " " , 1 ) => PreTaprootDescriptor :: Pkh ( Pkh :: from_tree ( top ) ? ) , ( " " , 1 ) => PreTaprootDescriptor :: Wpkh ( Wpkh :: from_tree ( top ) ? ) , ( " " , 1 ) => PreTaprootDescriptor :: Sh ( Sh :: from_tree ( top ) ? ) , ( " " , 1 ) => PreTaprootDescriptor :: Wsh ( Wsh :: from_tree ( top ) ? ) , _ => PreTaprootDescriptor :: Bare ( Bare :: from_tree ( top ) ? ) , } ) }
Parse an expression tree into a descriptor
Parse an expression tree into a descriptor
top
&expression::Tree
top
&expression::Tree