pub fn derive(self, child_number: bip32::ChildNumber) -> DescriptorPublicKey {
        debug_assert!(child_number.is_normal());

        match self {
            DescriptorPublicKey::SinglePub(_) => self,
            DescriptorPublicKey::XPub(xpub) => {
                if xpub.is_wildcard {
                    DescriptorPublicKey::XPub(DescriptorXPub {
                        origin: xpub.origin,
                        xpub: xpub.xpub,
                        derivation_path: xpub.derivation_path.into_child(child_number),
                        is_wildcard: false,
                    })
                } else {
                    DescriptorPublicKey::XPub(xpub)
                }
            }
        }
    }
/// Derives the specified child key if self is a wildcard xpub. Otherwise returns self.
///
/// Panics if given a hardened child number
Derives the specified child key if self is a wildcard xpub. Otherwise returns self.
Panics if given a hardened child number
Derives the specified child key if self is a wildcard xpub . Otherwise returns self . Panics if given a hardened child number
pub fn derive(self, child_number: bip32::ChildNumber) -> DescriptorPublicKey {
        debug_assert!(child_number.is_normal());
        match self {
            DescriptorPublicKey::SinglePub(_) => self,
            DescriptorPublicKey::XPub(xpub) => {
                if xpub.is_wildcard {
                    DescriptorPublicKey::XPub(DescriptorXPub {
                        origin: xpub.origin,
                        xpub: xpub.xpub,
                        derivation_path: xpub.derivation_path.into_child(child_number),
                        is_wildcard: false,
                    })
                } else {
                    DescriptorPublicKey::XPub(xpub)
                }
            }
        }
    }
pub fn derive ( self , child_number : bip32 :: ChildNumber ) -> DescriptorPublicKey { debug_assert ! ( child_number is_normal ( ) ) ; match self { DescriptorPublicKey :: SinglePub ( _ ) => self , DescriptorPublicKey :: XPub ( xpub ) => { if xpub . is_wildcard { DescriptorPublicKey :: XPub ( DescriptorXPub { origin : xpub . origin , xpub : xpub . xpub , derivation_path : xpub . derivation_path . into_child ( child_number ) , is_wildcard : false , } ) } else { DescriptorPublicKey :: XPub ( xpub ) } } } }
Derives the specified child key if self is a wildcard xpub.
Derives the specified child key if self is a wildcard xpub .
self
child_number
bip32::ChildNumber
self
child_number
bip32::ChildNumber