Skip to content

Commit

Permalink
Document an error case for at_derivation_index()
Browse files Browse the repository at this point in the history
  • Loading branch information
shesek committed Oct 10, 2024
1 parent 98104b9 commit 3d9acd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/descriptor/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ impl DescriptorPublicKey {
/// # Errors
///
/// - If `index` is hardened.
/// - If the key contains multi-path derivations
pub fn at_derivation_index(self, index: u32) -> Result<DefiniteDescriptorKey, ConversionError> {
let definite = match self {
DescriptorPublicKey::Single(_) => self,
Expand Down
4 changes: 3 additions & 1 deletion src/descriptor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ impl Descriptor<DescriptorPublicKey> {
///
/// # Errors
/// - If index ≥ 2^31
/// - If the descriptor contains multi-path derivations
pub fn at_derivation_index(
&self,
index: u32,
Expand Down Expand Up @@ -650,7 +651,8 @@ impl Descriptor<DescriptorPublicKey> {
///
/// # Errors
///
/// This function will return an error if hardened derivation is attempted.
/// This function will return an error for multi-path descriptors
/// or if hardened derivation is attempted,
pub fn derived_descriptor<C: secp256k1::Verification>(
&self,
secp: &secp256k1::Secp256k1<C>,
Expand Down

0 comments on commit 3d9acd2

Please sign in to comment.