Skip to content

Commit ef8d730

Browse files
committed
fix incorrect doc links
1 parent e04b409 commit ef8d730

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

fuzz/fuzz_targets/parse_descriptor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
extern crate miniscript;
22

3-
use miniscript::descriptor::DescriptorPublicKey;
3+
use miniscript::DescriptorPublicKey;
44
use std::str::FromStr;
55

66
fn do_test(data: &[u8]) {

src/descriptor/mod.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,14 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
174174
}
175175

176176
impl<Pk: MiniscriptKey> Descriptor<Pk> {
177+
///
177178
/// Computes the Bitcoin address of the descriptor, if one exists
178179
/// `to_pk_ctx` denotes the ToPkCtx required for deriving bitcoin::PublicKey
179180
/// from MiniscriptKey using [ToPublicKey].
180181
/// If MiniscriptKey is already is [bitcoin::PublicKey], then the context
181-
/// would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]
182+
/// would be [NullCtx](crate::NullCtx) and [DescriptorPublicKeyCtx] if MiniscriptKey is [DescriptorPublicKey]
182183
///
183-
/// In general, this is defined by generic for the trait [trait.ToPublicKey]
184+
/// In general, this is defined by generic for the trait [ToPublicKey]
184185
pub fn address<ToPkCtx: Copy>(
185186
&self,
186187
network: bitcoin::Network,
@@ -232,7 +233,7 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
232233
/// `to_pk_ctx` denotes the ToPkCtx required for deriving bitcoin::PublicKey
233234
/// from MiniscriptKey using [ToPublicKey].
234235
/// If MiniscriptKey is already is [bitcoin::PublicKey], then the context
235-
/// would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]
236+
/// would be [NullCtx](crate::NullCtx) and [DescriptorPublicKeyCtx] if MiniscriptKey is [DescriptorPublicKey]
236237
///
237238
/// In general, this is defined by generic for the trait [ToPublicKey]
238239
pub fn script_pubkey<ToPkCtx: Copy>(&self, to_pk_ctx: ToPkCtx) -> Script
@@ -290,7 +291,7 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
290291
/// `to_pk_ctx` denotes the ToPkCtx required for deriving bitcoin::PublicKey
291292
/// from MiniscriptKey using [ToPublicKey].
292293
/// If MiniscriptKey is already is [bitcoin::PublicKey], then the context
293-
/// would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]
294+
/// would be [NullCtx](crate::NullCtx) and [DescriptorPublicKeyCtx] if MiniscriptKey is [DescriptorPublicKey]
294295
///
295296
/// In general, this is defined by generic for the trait [ToPublicKey]
296297
pub fn unsigned_script_sig<ToPkCtx: Copy>(&self, to_pk_ctx: ToPkCtx) -> Script
@@ -342,7 +343,7 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
342343
/// `to_pk_ctx` denotes the ToPkCtx required for deriving bitcoin::PublicKey
343344
/// from MiniscriptKey using [ToPublicKey].
344345
/// If MiniscriptKey is already is [bitcoin::PublicKey], then the context
345-
/// would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]
346+
/// would be [NullCtx](crate::NullCtx) and [DescriptorPublicKeyCtx] if MiniscriptKey is [DescriptorPublicKey]
346347
///
347348
/// In general, this is defined by generic for the trait [ToPublicKey]
348349
pub fn witness_script<ToPkCtx: Copy>(&self, to_pk_ctx: ToPkCtx) -> Script
@@ -377,7 +378,7 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
377378
/// `to_pk_ctx` denotes the ToPkCtx required for deriving bitcoin::PublicKey
378379
/// from MiniscriptKey using [ToPublicKey].
379380
/// If MiniscriptKey is already is [bitcoin::PublicKey], then the context
380-
/// would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]
381+
/// would be [NullCtx](crate::NullCtx) and [DescriptorPublicKeyCtx] if MiniscriptKey is [DescriptorPublicKey]
381382
///
382383
/// In general, this is defined by generic for the trait [ToPublicKey]
383384
pub fn get_satisfication<ToPkCtx, S>(
@@ -595,7 +596,7 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
595596
/// `to_pk_ctx` denotes the ToPkCtx required for deriving bitcoin::PublicKey
596597
/// from MiniscriptKey using [ToPublicKey].
597598
/// If MiniscriptKey is already is [bitcoin::PublicKey], then the context
598-
/// would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]
599+
/// would be [NullCtx](crate::NullCtx) and [DescriptorPublicKeyCtx] if MiniscriptKey is [DescriptorPublicKey]
599600
///
600601
/// In general, this is defined by generic for the trait [ToPublicKey]
601602
pub fn script_code<ToPkCtx: Copy>(&self, to_pk_ctx: ToPkCtx) -> Script

src/miniscript/iter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
116116
/// if any. Otherwise returns an empty `Vec`.
117117
///
118118
/// NB: The function analyzes only single miniscript item and not any of its descendants in AST.
119-
/// To obtain a list of all public keys within AST use [fn.iter_pk()] function, for example
119+
/// To obtain a list of all public keys within AST use [Miniscript::iter_pk()] function, for example
120120
/// `miniscript.iter_pubkeys().collect()`.
121121
pub fn get_leaf_pk(&self) -> Vec<Pk> {
122122
match self.node {
@@ -133,7 +133,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
133133
/// returns its cloned copy.
134134
///
135135
/// NB: The function analyzes only single miniscript item and not any of its descendants in AST.
136-
/// To obtain a list of all public key hashes within AST use [fn.iter_pkh()] function,
136+
/// To obtain a list of all public key hashes within AST use [Miniscript::iter_pkh()] function,
137137
/// for example `miniscript.iter_pubkey_hashes().collect()`.
138138
pub fn get_leaf_pkh(&self) -> Vec<Pk::Hash> {
139139
match self.node {
@@ -149,7 +149,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
149149
/// keys or hashes, the function returns an empty `Vec`.
150150
///
151151
/// NB: The function analyzes only single miniscript item and not any of its descendants in AST.
152-
/// To obtain a list of all public keys or hashes within AST use [fn.iter_pk_pkh()]
152+
/// To obtain a list of all public keys or hashes within AST use [Miniscript::iter_pk_pkh()]
153153
/// function, for example `miniscript.iter_pubkeys_and_hashes().collect()`.
154154
pub fn get_leaf_pk_pkh(&self) -> Vec<PkPkh<Pk>> {
155155
match self.node {
@@ -364,7 +364,7 @@ pub enum PkPkh<Pk: MiniscriptKey> {
364364

365365
/// Iterator for traversing all [MiniscriptKey]'s and hashes, depending what data are present in AST,
366366
/// starting from some specific node which constructs the iterator via
367-
/// [fn.Miniscript::iter_keys_and_hashes()] method.
367+
/// [Miniscript::iter_pk_pkh] method.
368368
pub struct PkPkhIter<'a, Pk: 'a + MiniscriptKey, Ctx: 'a + ScriptContext> {
369369
node_iter: Iter<'a, Pk, Ctx>,
370370
curr_node: Option<&'a Miniscript<Pk, Ctx>>,
@@ -390,7 +390,7 @@ impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> PkPkhIter<'a, Pk, Ctx> {
390390
/// * Differs from `Miniscript::iter_pubkeys_and_hashes().collect()` in the way that it lists
391391
/// only public keys, and not their hashes
392392
///
393-
/// Unlike these functions, [fn.pk_only] returns an `Option` value with `Vec`, not an iterator,
393+
/// Unlike these functions, [PkPkhIter::pk_only] returns an `Option` value with `Vec`, not an iterator,
394394
/// and consumes the iterator object.
395395
pub fn pk_only(self) -> Option<Vec<Pk>> {
396396
let mut keys = vec![];

src/miniscript/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<Ctx: ScriptContext> Miniscript<bitcoin::PublicKey, Ctx> {
166166

167167
/// Attempt to parse a Script into Miniscript representation.
168168
/// This function will fail parsing for scripts that do not clear
169-
/// the [fn.analyzable.sanity_check] checks. Use [fn.parse_insane] to
169+
/// the [Miniscript::sanity_check] checks. Use [Miniscript::parse_insane] to
170170
/// parse such scripts.
171171
pub fn parse(script: &script::Script) -> Result<Miniscript<bitcoin::PublicKey, Ctx>, Error> {
172172
let ms = Self::parse_insane(script)?;
@@ -372,6 +372,9 @@ where
372372
}
373373
}
374374

375+
/// Parse a Miniscript from string and perform sanity checks
376+
/// See [Miniscript::from_str_insane] to parse scripts from string that
377+
/// do not clear the [Miniscript::sanity_check] checks.
375378
impl<Pk, Ctx> str::FromStr for Miniscript<Pk, Ctx>
376379
where
377380
Pk: MiniscriptKey,
@@ -381,9 +384,6 @@ where
381384
{
382385
type Err = Error;
383386

384-
/// Parse a Miniscript from string and perform sanity checks
385-
/// See [fn.from_str_insane] to parse scripts from string that
386-
/// do not clear the [fn.analyzable.sanity_check] checks.
387387
fn from_str(s: &str) -> Result<Miniscript<Pk, Ctx>, Error> {
388388
let ms = Self::from_str_insane(s)?;
389389
ms.sanity_check()?;

src/miniscript/satisfy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub trait Satisfier<ToPkCtx: Copy, Pk: MiniscriptKey + ToPublicKey<ToPkCtx>> {
5757
/// `to_pk_ctx` denotes the ToPkCtx required for deriving bitcoin::PublicKey
5858
/// from MiniscriptKey using [ToPublicKey].
5959
/// If MiniscriptKey is already is [bitcoin::PublicKey], then the context
60-
/// would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]
60+
/// would be [NullCtx] and [DescriptorPublicKeyCtx](crate::DescriptorPublicKeyCtx) if MiniscriptKey is [DescriptorPublicKey](crate::DescriptorPublicKey)
6161
///
6262
/// In general, this is defined by generic for the trait [ToPublicKey]
6363
fn lookup_sig(&self, _: &Pk, _to_pk_ctx: ToPkCtx) -> Option<BitcoinSig> {
@@ -76,7 +76,7 @@ pub trait Satisfier<ToPkCtx: Copy, Pk: MiniscriptKey + ToPublicKey<ToPkCtx>> {
7676
/// `to_pk_ctx` denotes the ToPkCtx required for deriving bitcoin::PublicKey
7777
/// from MiniscriptKey using [ToPublicKey].
7878
/// If MiniscriptKey is already is [bitcoin::PublicKey], then the context
79-
/// would be [NullCtx] and [descriptor.DescriptorPublicKeyCtx] if MiniscriptKey is [descriptor.DescriptorPublicKey]
79+
/// would be [NullCtx] and [DescriptorPublicKeyCtx](crate::DescriptorPublicKeyCtx) if MiniscriptKey is [DescriptorPublicKey](crate::DescriptorPublicKey)
8080
///
8181
/// In general, this is defined by generic for the trait [ToPublicKey]
8282
fn lookup_pkh_sig(

src/policy/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const ENTAILMENT_MAX_TERMINALS: usize = 20;
4646
/// After Lifting all policies are converted into `KeyHash(Pk::HasH)` to
4747
/// maintain the following invariant(modulo resource limits):
4848
/// `Lift(Concrete) == Concrete -> Miniscript -> Script -> Miniscript -> Semantic`
49-
/// Lifting from [miniscript.Miniscript], [descriptor.Descriptor] can fail
49+
/// Lifting from [Miniscript], [Descriptor] can fail
5050
/// if the miniscript contains a timelock combination or if it contains a
5151
/// branch that exceeds resource limits.
5252
/// Lifting from Concrete policies can fail if it contains a timelock

0 commit comments

Comments
 (0)