Skip to content

Commit 307c1b3

Browse files
committed
Merge #752: Document an error case for at_derivation_index()
3d9acd2 Document an error case for at_derivation_index() (Nadav Ivgi) Pull request description: ACKs for top commit: apoelstra: ACK 3d9acd2 successfully ran local tests; thanks! Tree-SHA512: 8b4958e40342dd1a8955a4aeedb424c326afc7f01b086662f9e11c57258e28e8e6dd5bde1f846f7bd72f6ebab8fdb053ca3305bb4a99524a3bf66064c0e82419
2 parents 98104b9 + 3d9acd2 commit 307c1b3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/descriptor/key.rs

+1
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

+3-1
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)