File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -231,18 +231,27 @@ impl MiniscriptKey for DescriptorPublicKey {
231
231
type Hash = hash160:: Hash ;
232
232
233
233
fn to_pubkeyhash ( & self ) -> Self :: Hash {
234
+ self . to_public_key ( ) . to_pubkeyhash ( )
235
+ }
236
+ }
237
+
238
+ impl ToPublicKey for DescriptorPublicKey {
239
+ fn to_public_key ( & self ) -> bitcoin:: PublicKey {
234
240
match * self {
235
- DescriptorPublicKey :: PukKey ( ref pk) => pk . to_pubkeyhash ( ) ,
241
+ DescriptorPublicKey :: PukKey ( ref pk) => * pk ,
236
242
DescriptorPublicKey :: XPub ( ref xpub) => {
237
243
let ctx = secp256k1:: Secp256k1 :: verification_only ( ) ;
238
244
xpub. xpub
239
245
. derive_pub ( & ctx, & xpub. derivation_path )
240
- . expect ( "Won 't fail, only normal derivations" )
246
+ . expect ( "Shouldn 't fail, only normal derivations" )
241
247
. public_key
242
- . to_pubkeyhash ( )
243
248
}
244
249
}
245
250
}
251
+
252
+ fn hash_to_hash160 ( hash : & Self :: Hash ) -> hash160:: Hash {
253
+ * hash
254
+ }
246
255
}
247
256
248
257
impl < Pk : MiniscriptKey > Descriptor < Pk > {
You can’t perform that action at this time.
0 commit comments