Merge rust-bitcoin/rust-bitcoin#1882: made ckd_priv function private and impl AsRef for ChildNumber
4be019180b
correcting formatting (startup-dreamer) Pull request description: closes #1866 ACKs for top commit: Kixunil: ACK4be019180b
junderw: ACK4be019180b
apoelstra: ACK4be019180b
Tree-SHA512: 9539c987a9636f3c50dde2d4448ca0c30c239f5a8e852e7bf560cc27a2681777fa1a91ace21bdf1fd67b1f60679dfb8eecef45b81506618285536599ad741f7e
This commit is contained in:
commit
ca17257884
|
@ -8,9 +8,9 @@
|
||||||
|
|
||||||
use core::convert::TryInto;
|
use core::convert::TryInto;
|
||||||
use core::default::Default;
|
use core::default::Default;
|
||||||
use core::fmt;
|
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
use core::str::FromStr;
|
use core::str::FromStr;
|
||||||
|
use core::{fmt, slice};
|
||||||
|
|
||||||
use hashes::{hex, sha512, Hash, HashEngine, Hmac, HmacEngine};
|
use hashes::{hex, sha512, Hash, HashEngine, Hmac, HmacEngine};
|
||||||
use internals::{impl_array_newtype, write_err};
|
use internals::{impl_array_newtype, write_err};
|
||||||
|
@ -209,6 +209,10 @@ impl FromStr for ChildNumber {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl AsRef<[ChildNumber]> for ChildNumber {
|
||||||
|
fn as_ref(&self) -> &[ChildNumber] { slice::from_ref(self) }
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
impl<'de> serde::Deserialize<'de> for ChildNumber {
|
impl<'de> serde::Deserialize<'de> for ChildNumber {
|
||||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||||
|
@ -563,7 +567,7 @@ impl ExtendedPrivKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Private->Private child key derivation
|
/// Private->Private child key derivation
|
||||||
pub fn ckd_priv<C: secp256k1::Signing>(
|
fn ckd_priv<C: secp256k1::Signing>(
|
||||||
&self,
|
&self,
|
||||||
secp: &Secp256k1<C>,
|
secp: &Secp256k1<C>,
|
||||||
i: ChildNumber,
|
i: ChildNumber,
|
||||||
|
|
Loading…
Reference in New Issue