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 {
777
777
pub fn full_derivation_path ( & self ) -> bip32:: DerivationPath {
778
778
self . 0 . full_derivation_path ( )
779
779
}
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
+ }
780
795
}
781
796
782
797
impl FromStr for DefiniteDescriptorKey {
@@ -842,6 +857,12 @@ impl From<DefiniteDescriptorKey> for DescriptorPublicKey {
842
857
}
843
858
}
844
859
860
+ impl < ' a > From < & ' a DefiniteDescriptorKey > for & ' a DescriptorPublicKey {
861
+ fn from ( d : & ' a DefiniteDescriptorKey ) -> Self {
862
+ & d. 0
863
+ }
864
+ }
865
+
845
866
#[ cfg( test) ]
846
867
mod test {
847
868
use core:: str:: FromStr ;
You can’t perform that action at this time.
0 commit comments