Skip to content

Commit 244e8a5

Browse files
committed
remove "hardened derivation is currently not supported" error
1 parent fc7441a commit 244e8a5

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/descriptor/key.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,7 @@ impl<K: InnerXKey> DescriptorXKey<K> {
514514
})
515515
.collect::<Result<bip32::DerivationPath, _>>()?;
516516

517-
if !K::can_derive_hardened() && !(&derivation_path).into_iter().all(|c| c.is_normal()) {
518-
Err(DescriptorKeyParseError(
519-
"Hardened derivation is currently not supported.",
520-
))
521-
} else {
522-
Ok((xkey, derivation_path, wildcard))
523-
}
517+
Ok((xkey, derivation_path, wildcard))
524518
}
525519

526520
/// Compares this key with a `keysource` and returns the matching derivation path, if any.
@@ -615,15 +609,6 @@ mod test {
615609

616610
#[test]
617611
fn parse_descriptor_key_errors() {
618-
// We refuse creating descriptors which claim to be able to derive hardened children
619-
let desc = "[78412e3a/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/1/42'/*";
620-
assert_eq!(
621-
DescriptorPublicKey::from_str(desc),
622-
Err(DescriptorKeyParseError(
623-
"Hardened derivation is currently not supported."
624-
))
625-
);
626-
627612
// And ones with misplaced wildcard
628613
let desc = "[78412e3a/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/1/*/44";
629614
assert_eq!(

0 commit comments

Comments
 (0)