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.