File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -777,6 +777,21 @@ impl DefiniteDescriptorKey {
777777 pub fn full_derivation_path ( & self ) -> bip32:: DerivationPath {
778778 self . 0 . full_derivation_path ( )
779779 }
780+
781+ /// Reference to the underlying `DescriptorPublicKey`
782+ pub fn as_descriptor_public_key ( & self ) -> & DescriptorPublicKey {
783+ & self . 0
784+ }
785+
786+ /// Converts the definite key into a generic one
787+ pub fn into_descriptor_public_key ( self ) -> DescriptorPublicKey {
788+ self . 0
789+ }
790+
791+ /// Converts the definite key into a generic one
792+ pub fn to_descriptor_public_key ( & self ) -> DescriptorPublicKey {
793+ self . 0 . clone ( )
794+ }
780795}
781796
782797impl FromStr for DefiniteDescriptorKey {
@@ -842,6 +857,12 @@ impl From<DefiniteDescriptorKey> for DescriptorPublicKey {
842857 }
843858}
844859
860+ impl Borrow < DescriptorPublicKey > for DefiniteDescriptorKey {
861+ fn borrow ( & self ) -> & DescriptorPublicKey {
862+ & self . 0
863+ }
864+ }
865+
845866#[ cfg( test) ]
846867mod test {
847868 use core:: str:: FromStr ;
You can’t perform that action at this time.
0 commit comments