Skip to content

Commit fb3cb90

Browse files
committed
desc keys: rename parse_xkey_origin to parse_key_origin
It's not specific to extended keys.
1 parent 60732fb commit fb3cb90

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/descriptor/key.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl FromStr for DescriptorPublicKey {
304304
));
305305
}
306306

307-
let (key_part, origin) = parse_xkey_origin(s)?;
307+
let (key_part, origin) = parse_key_origin(s)?;
308308

309309
if key_part.contains("pub") {
310310
let (xpub, derivation_path, wildcard) =
@@ -491,7 +491,7 @@ impl FromStr for DescriptorSecretKey {
491491
type Err = DescriptorKeyParseError;
492492

493493
fn from_str(s: &str) -> Result<Self, Self::Err> {
494-
let (key_part, origin) = parse_xkey_origin(s)?;
494+
let (key_part, origin) = parse_key_origin(s)?;
495495

496496
if key_part.len() <= 52 {
497497
let sk = bitcoin::PrivateKey::from_str(key_part)
@@ -514,7 +514,7 @@ impl FromStr for DescriptorSecretKey {
514514
}
515515

516516
// Parse the origin information part of a descriptor key.
517-
fn parse_xkey_origin(s: &str) -> Result<(&str, Option<bip32::KeySource>), DescriptorKeyParseError> {
517+
fn parse_key_origin(s: &str) -> Result<(&str, Option<bip32::KeySource>), DescriptorKeyParseError> {
518518
for ch in s.as_bytes() {
519519
if *ch < 20 || *ch > 127 {
520520
return Err(DescriptorKeyParseError(

0 commit comments

Comments
 (0)