From 97c948d73ae726b3eb11b71e0e7c322d997256a3 Mon Sep 17 00:00:00 2001 From: Velnbur Date: Fri, 27 Mar 2026 19:42:24 +0100 Subject: [PATCH] Fix hardened derivation path error handling in `at_derivation_index` --- src/descriptor/key.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/descriptor/key.rs b/src/descriptor/key.rs index 5bbb92c79..33f9c6290 100644 --- a/src/descriptor/key.rs +++ b/src/descriptor/key.rs @@ -906,6 +906,7 @@ impl DescriptorPublicKey { /// # Errors /// /// - If `index` is hardened. + /// - If derivation path contains a hardened step. /// - If the key contains multi-path derivations pub fn at_derivation_index( self, @@ -937,8 +938,7 @@ impl DescriptorPublicKey { DescriptorPublicKey::MultiXPub(_) => return Err(NonDefiniteKeyError::Multipath), }; - Ok(DefiniteDescriptorKey::new(definite) - .expect("The key should not contain any wildcards at this point")) + DefiniteDescriptorKey::new(definite) } /// Whether or not this key has multiple derivation paths.