Skip to content

Commit c745f81

Browse files
committed
comment fixes for ToPkCtx removal
1 parent b7d4536 commit c745f81

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/descriptor/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,6 @@ impl<
278278
{
279279
}
280280

281-
// There are some additional convenience functions we could add to `TranslatePk`
282-
// for the common special cases where `P::Hash == Q::Hash`, or when `P == P::Hash`,
283-
// but these are blocked on https://github.com/rust-lang/rust/issues/20041 which
284-
// is unlikely to arrive in Rust very soon, as of Jan 2021. Should revisit this.
285-
286281
/// Script descriptor
287282
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
288283
pub enum Descriptor<Pk: MiniscriptKey> {
@@ -559,6 +554,8 @@ where
559554

560555
impl Descriptor<DescriptorPublicKey> {
561556
/// Derives all wildcard keys in the descriptor using the supplied index
557+
///
558+
/// Panics if given an index ≥ 2^31
562559
pub fn derive(&self, index: u32) -> Descriptor<DescriptorPublicKey> {
563560
self.translate_pk2_infallible(|pk| pk.clone().derive(index))
564561
}

src/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@
6969
//! )))\
7070
//! ").unwrap();
7171
//!
72-
//! // Sometimes it is necessary to have additional information to get the bitcoin::PublicKey
73-
//! // from the MiniscriptKey which can supplied by `to_pk_ctx` parameter. For example,
74-
//! // when calculating the script pubkey of a descriptor with xpubs, the secp context and
75-
//! // child information maybe required.
76-
//!
7772
//! // Derive the P2SH address
7873
//! assert_eq!(
7974
//! desc.address(bitcoin::Network::Bitcoin).unwrap().to_string(),
@@ -189,11 +184,6 @@ impl MiniscriptKey for String {
189184
/// Trait describing public key types which can be converted to bitcoin pubkeys
190185
pub trait ToPublicKey: MiniscriptKey {
191186
/// Converts an object to a public key
192-
/// C represents additional context information that maybe
193-
/// required for deriving a bitcoin::PublicKey from MiniscriptKey
194-
/// You may require secp context for crypto operations
195-
/// or additional information for substituting the wildcard in
196-
/// extended pubkeys
197187
fn to_public_key(&self) -> bitcoin::PublicKey;
198188

199189
/// Converts a hashed version of the public key to a `hash160` hash.

0 commit comments

Comments
 (0)