Skip to content

Commit

Permalink
Merge #752: Document an error case for at_derivation_index()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
apoelstra committed Oct 11, 2024
2 parents 98104b9 + 3d9acd2 commit 307c1b3
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 307c1b3

Please sign in to comment.