Skip to content

Commit a21b15f

Browse files
author
Scott Robinson
committed
Extract DescriptorExtendedPublicKey type
1 parent d3af6d9 commit a21b15f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/descriptor/key.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ use crate::prelude::*;
1818
use crate::serde::{Deserialize, Deserializer, Serialize, Serializer};
1919
use crate::{hash256, MiniscriptKey, ToPublicKey};
2020

21+
type DescriptorExtendedPublicKey = DescriptorXKey<bip32::ExtendedPubKey>;
22+
2123
/// The descriptor pubkey, either a single pubkey or an xpub.
2224
#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Hash)]
2325
pub enum DescriptorPublicKey {
2426
/// Single public key.
2527
Single(SinglePub),
2628
/// Extended public key (xpub).
27-
XPub(DescriptorXKey<bip32::ExtendedPubKey>),
29+
XPub(DescriptorExtendedPublicKey),
2830
/// Multiple extended public keys.
2931
MultiXPub(DescriptorMultiXKey<bip32::ExtendedPubKey>),
3032
}
@@ -221,7 +223,7 @@ impl DescriptorXKey<bip32::ExtendedPrivKey> {
221223
fn to_public<C: Signing>(
222224
&self,
223225
secp: &Secp256k1<C>,
224-
) -> Result<DescriptorXKey<bip32::ExtendedPubKey>, DescriptorKeyParseError> {
226+
) -> Result<DescriptorExtendedPublicKey, DescriptorKeyParseError> {
225227
let unhardened = self
226228
.derivation_path
227229
.into_iter()

0 commit comments

Comments
 (0)