Skip to content

Commit 3d9acd2

Browse files
committed
Document an error case for at_derivation_index()
1 parent 98104b9 commit 3d9acd2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/descriptor/key.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ impl DescriptorPublicKey {
627627
/// # Errors
628628
///
629629
/// - If `index` is hardened.
630+
/// - If the key contains multi-path derivations
630631
pub fn at_derivation_index(self, index: u32) -> Result<DefiniteDescriptorKey, ConversionError> {
631632
let definite = match self {
632633
DescriptorPublicKey::Single(_) => self,

src/descriptor/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ impl Descriptor<DescriptorPublicKey> {
596596
///
597597
/// # Errors
598598
/// - If index ≥ 2^31
599+
/// - If the descriptor contains multi-path derivations
599600
pub fn at_derivation_index(
600601
&self,
601602
index: u32,
@@ -650,7 +651,8 @@ impl Descriptor<DescriptorPublicKey> {
650651
///
651652
/// # Errors
652653
///
653-
/// This function will return an error if hardened derivation is attempted.
654+
/// This function will return an error for multi-path descriptors
655+
/// or if hardened derivation is attempted,
654656
pub fn derived_descriptor<C: secp256k1::Verification>(
655657
&self,
656658
secp: &secp256k1::Secp256k1<C>,

0 commit comments

Comments
 (0)