Skip to content

Commit 74948ea

Browse files
committed
fix issues with documentation
1 parent 0e20b8a commit 74948ea

11 files changed

Lines changed: 47 additions & 48 deletions

File tree

src/confidential.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl Value {
9999
}
100100

101101
/// Returns the explicit inner value.
102-
/// Returns [None] if [is_explicit] returns false.
102+
/// Returns [None] if [Value::is_explicit] returns false.
103103
pub fn explicit(&self) -> Option<u64> {
104104
match *self {
105105
Value::Explicit(i) => Some(i),
@@ -108,7 +108,7 @@ impl Value {
108108
}
109109

110110
/// Returns the confidential commitment in case of a confidential value.
111-
/// Returns [None] if [is_confidential] returns false.
111+
/// Returns [None] if [Value::is_confidential] returns false.
112112
pub fn commitment(&self) -> Option<PedersenCommitment> {
113113
match *self {
114114
Value::Confidential(i) => Some(i),
@@ -306,7 +306,7 @@ impl Asset {
306306
}
307307

308308
/// Returns the explicit inner value.
309-
/// Returns [None] if [is_explicit] returns false.
309+
/// Returns [None] if [Asset::is_explicit] returns false.
310310
pub fn explicit(&self) -> Option<AssetId> {
311311
match *self {
312312
Asset::Explicit(i) => Some(i),
@@ -315,7 +315,7 @@ impl Asset {
315315
}
316316

317317
/// Returns the confidential commitment in case of a confidential value.
318-
/// Returns [None] if [is_confidential] returns false.
318+
/// Returns [None] if [Asset::is_confidential] returns false.
319319
pub fn commitment(&self) -> Option<Generator> {
320320
match *self {
321321
Asset::Confidential(i) => Some(i),
@@ -579,7 +579,7 @@ impl Nonce {
579579
}
580580

581581
/// Returns the explicit inner value.
582-
/// Returns [None] if [is_explicit] returns false.
582+
/// Returns [None] if [Nonce::is_explicit] returns false.
583583
pub fn explicit(&self) -> Option<[u8; 32]> {
584584
match *self {
585585
Nonce::Explicit(i) => Some(i),
@@ -588,7 +588,7 @@ impl Nonce {
588588
}
589589

590590
/// Returns the confidential commitment in case of a confidential value.
591-
/// Returns [None] if [is_confidential] returns false.
591+
/// Returns [None] if [Nonce::is_confidential] returns false.
592592
pub fn commitment(&self) -> Option<PublicKey> {
593593
match *self {
594594
Nonce::Confidential(i) => Some(i),

src/dynafed.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ impl Params {
262262
}
263263
}
264264

265-
/// Get the signblockscript. Is [None] for [Null] params.
265+
/// Get the signblockscript. Is [None] for [Params::Null] params.
266266
pub fn signblockscript(&self) -> Option<&Script> {
267267
match *self {
268268
Params::Null => None,
@@ -271,7 +271,7 @@ impl Params {
271271
}
272272
}
273273

274-
/// Get the signblock_witness_limit. Is [None] for [Null] params.
274+
/// Get the signblock_witness_limit. Is [None] for [Params::Null] params.
275275
pub fn signblock_witness_limit(&self) -> Option<u32> {
276276
match *self {
277277
Params::Null => None,
@@ -280,7 +280,7 @@ impl Params {
280280
}
281281
}
282282

283-
/// Get the fedpeg_program. Is [None] for non-[Full] params.
283+
/// Get the fedpeg_program. Is [None] for non-[Params::Full] params.
284284
pub fn fedpeg_program(&self) -> Option<&bitcoin::ScriptBuf> {
285285
match *self {
286286
Params::Null => None,
@@ -289,7 +289,7 @@ impl Params {
289289
}
290290
}
291291

292-
/// Get the fedpegscript. Is [None] for non-[Full] params.
292+
/// Get the fedpegscript. Is [None] for non-[Params::Full] params.
293293
pub fn fedpegscript(&self) -> Option<&Vec<u8>> {
294294
match *self {
295295
Params::Null => None,
@@ -298,7 +298,7 @@ impl Params {
298298
}
299299
}
300300

301-
/// Get the extension_space. Is [None] for non-[Full] params.
301+
/// Get the extension_space. Is [None] for non-[Params::Full] params.
302302
pub fn extension_space(&self) -> Option<&Vec<Vec<u8>>> {
303303
match *self {
304304
Params::Null => None,
@@ -307,7 +307,7 @@ impl Params {
307307
}
308308
}
309309

310-
/// Get the elided_root. Is [None] for non-[Compact] params.
310+
/// Get the elided_root. Is [None] for non-[Params::Compact] params.
311311
pub fn elided_root(&self) -> Option<&sha256::Midstate> {
312312
match *self {
313313
Params::Null => None,

src/opcodes.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -196,41 +196,41 @@ pub mod all {
196196
pub const OP_PUSHDATA2: All = All {code: 0x4d};
197197
/// Read the next 4 bytes as N; push the next N bytes as an array onto the stack
198198
pub const OP_PUSHDATA4: All = All {code: 0x4e};
199-
/// Push the array [0x81] onto the stack
199+
/// Push the array `[0x81]` onto the stack
200200
pub const OP_PUSHNUM_NEG1: All = All {code: 0x4f};
201201
/// Synonym for OP_RETURN
202202
pub const OP_RESERVED: All = All {code: 0x50};
203-
/// Push the array [0x01] onto the stack
203+
/// Push the array `[0x01]` onto the stack
204204
pub const OP_PUSHNUM_1: All = All {code: 0x51};
205-
/// Push the array [0x02] onto the stack
205+
/// Push the array `[0x02]` onto the stack
206206
pub const OP_PUSHNUM_2: All = All {code: 0x52};
207-
/// Push the array [0x03] onto the stack
207+
/// Push the array `[0x03]` onto the stack
208208
pub const OP_PUSHNUM_3: All = All {code: 0x53};
209-
/// Push the array [0x04] onto the stack
209+
/// Push the array `[0x04]` onto the stack
210210
pub const OP_PUSHNUM_4: All = All {code: 0x54};
211-
/// Push the array [0x05] onto the stack
211+
/// Push the array `[0x05]` onto the stack
212212
pub const OP_PUSHNUM_5: All = All {code: 0x55};
213-
/// Push the array [0x06] onto the stack
213+
/// Push the array `[0x06]` onto the stack
214214
pub const OP_PUSHNUM_6: All = All {code: 0x56};
215-
/// Push the array [0x07] onto the stack
215+
/// Push the array `[0x07]` onto the stack
216216
pub const OP_PUSHNUM_7: All = All {code: 0x57};
217-
/// Push the array [0x08] onto the stack
217+
/// Push the array `[0x08]` onto the stack
218218
pub const OP_PUSHNUM_8: All = All {code: 0x58};
219-
/// Push the array [0x09] onto the stack
219+
/// Push the array `[0x09]` onto the stack
220220
pub const OP_PUSHNUM_9: All = All {code: 0x59};
221-
/// Push the array [0x0a] onto the stack
221+
/// Push the array `[0x0a]` onto the stack
222222
pub const OP_PUSHNUM_10: All = All {code: 0x5a};
223-
/// Push the array [0x0b] onto the stack
223+
/// Push the array `[0x0b]` onto the stack
224224
pub const OP_PUSHNUM_11: All = All {code: 0x5b};
225-
/// Push the array [0x0c] onto the stack
225+
/// Push the array `[0x0c]` onto the stack
226226
pub const OP_PUSHNUM_12: All = All {code: 0x5c};
227-
/// Push the array [0x0d] onto the stack
227+
/// Push the array `[0x0d]` onto the stack
228228
pub const OP_PUSHNUM_13: All = All {code: 0x5d};
229-
/// Push the array [0x0e] onto the stack
229+
/// Push the array `[0x0e]` onto the stack
230230
pub const OP_PUSHNUM_14: All = All {code: 0x5e};
231-
/// Push the array [0x0f] onto the stack
231+
/// Push the array `[0x0f]` onto the stack
232232
pub const OP_PUSHNUM_15: All = All {code: 0x5f};
233-
/// Push the array [0x10] onto the stack
233+
/// Push the array `[0x10]` onto the stack
234234
pub const OP_PUSHNUM_16: All = All {code: 0x60};
235235
/// Does nothing
236236
pub const OP_NOP: All = All {code: 0x61};
@@ -385,9 +385,9 @@ pub mod all {
385385
pub const OP_HASH256: All = All {code: 0xaa};
386386
/// Ignore this and everything preceding when deciding what to sign when signature-checking
387387
pub const OP_CODESEPARATOR: All = All {code: 0xab};
388-
/// https://en.bitcoin.it/wiki/OP_CHECKSIG pushing 1/0 for success/failure
388+
/// <https://en.bitcoin.it/wiki/OP_CHECKSIG> pushing 1/0 for success/failure
389389
pub const OP_CHECKSIG: All = All {code: 0xac};
390-
/// https://en.bitcoin.it/wiki/OP_CHECKSIG returning success/failure
390+
/// <https://en.bitcoin.it/wiki/OP_CHECKSIG> returning success/failure
391391
pub const OP_CHECKSIGVERIFY: All = All {code: 0xad};
392392
/// Pop N, N pubkeys, M, M signatures, a dummy (due to bug in reference code), and verify that all M signatures are valid.
393393
/// Push 1 for "all valid", 0 otherwise
@@ -396,9 +396,9 @@ pub mod all {
396396
pub const OP_CHECKMULTISIGVERIFY: All = All {code: 0xaf};
397397
/// Does nothing
398398
pub const OP_NOP1: All = All {code: 0xb0};
399-
/// https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki
399+
/// <https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki>
400400
pub const OP_CLTV: All = All {code: 0xb1};
401-
/// https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki
401+
/// <https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki>
402402
pub const OP_CSV: All = All {code: 0xb2};
403403
/// Does nothing
404404
pub const OP_NOP4: All = All {code: 0xb3};

src/pset/map/input.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub struct Input {
222222
pub required_height_locktime: Option<locktime::Height>,
223223
/// Serialized schnorr signature with sighash type for key spend
224224
pub tap_key_sig: Option<schnorr::SchnorrSig>,
225-
/// Map of <xonlypubkey>|<leafhash> with signature
225+
/// Map of `<xonlypubkey>|<leafhash>` with signature
226226
#[cfg_attr(feature = "serde", serde(with = "crate::serde_utils::btreemap_as_seq"))]
227227
pub tap_script_sigs: BTreeMap<(XOnlyPublicKey, TapLeafHash), schnorr::SchnorrSig>,
228228
/// Map of Control blocks to Script version pair
@@ -292,7 +292,7 @@ impl Default for Input {
292292
}
293293

294294
/// A Signature hash type for the corresponding input. As of taproot upgrade, the signature hash
295-
/// type can be either [`SigHashType`] or [`SchnorrSigHashType`] but it is not possible to know
295+
/// type can be either [`EcdsaSigHashType`] or [`SchnorrSigHashType`] but it is not possible to know
296296
/// directly which signature hash type the user is dealing with. Therefore, the user is responsible
297297
/// for converting to/from [`PsbtSighashType`] from/to the desired signature hash type they need.
298298
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -358,7 +358,7 @@ impl From<SchnorrSigHashType> for PsbtSighashType {
358358
}
359359

360360
impl PsbtSighashType {
361-
/// Returns the [`SigHashType`] if the [`PsbtSighashType`] can be
361+
/// Returns the [`EcdsaSigHashType`] if the [`PsbtSighashType`] can be
362362
/// converted to one.
363363
pub fn ecdsa_hash_ty(self) -> Option<EcdsaSigHashType> {
364364
EcdsaSigHashType::from_standard(self.inner).ok()
@@ -376,8 +376,7 @@ impl PsbtSighashType {
376376

377377
/// Creates a [`PsbtSighashType`] from a raw `u32`.
378378
///
379-
/// Allows construction of a non-standard or non-valid sighash flag
380-
/// ([`SigHashType`], [`SchnorrSigHashType`] respectively).
379+
/// Allows construction of a non-standard or non-valid sighash flag.
381380
pub fn from_u32(n: u32) -> PsbtSighashType {
382381
PsbtSighashType { inner: n }
383382
}

src/pset/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
//! # Partially Signed Elements Transactions (PSET)
1616
//!
1717
//! Implementation of BIP174 Partially Signed Bitcoin Transaction Format as
18-
//! defined at https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki
18+
//! defined at <https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki>
1919
//! except we define PSETs containing non-standard SigHash types as invalid.
2020
//! Extension for PSET is based on PSET defined in BIP370.
21-
//! https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki
21+
//! <https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki>
2222
2323
use std::collections::HashMap;
2424
use std::{cmp, io};

src/pset/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! # Raw PSET Key-Value Pairs
1616
//!
1717
//! Raw PSET key-value pairs as defined at
18-
//! https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki.
18+
//! <https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki>.
1919
2020
use std::{fmt, io};
2121

src/schnorr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl TweakedPublicKey {
140140
TweakedPublicKey(xonly)
141141
}
142142

143-
/// Create a new [TweakedPublicKey] from a [PublicKey]. No tweak is applied.
143+
/// Create a new [`TweakedPublicKey`] from a [`XOnlyPublicKey`]. No tweak is applied.
144144
pub fn new(key: XOnlyPublicKey) -> TweakedPublicKey {
145145
TweakedPublicKey(key)
146146
}
@@ -173,7 +173,7 @@ impl TweakedKeyPair {
173173
self.0
174174
}
175175

176-
/// Returns the [`TweakedPublicKey`] and its [`Parity`] for this [`TweakedKeyPair`].
176+
/// Returns the [`TweakedPublicKey`] and its [`secp256k1_zkp::Parity`] for this [`TweakedKeyPair`].
177177
#[inline]
178178
pub fn public_parts(&self) -> (TweakedPublicKey, secp256k1_zkp::Parity) {
179179
let (xonly, parity) = self.0.x_only_public_key();

src/script.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ impl Script {
448448
/// iterator will end. To instead iterate over the script as sequence of bytes, treat
449449
/// it as a slice using `script[..]` or convert it to a vector using `into_bytes()`.
450450
///
451-
/// To force minimal pushes, use [instructions_minimal].
451+
/// To force minimal pushes, use [Script::instructions_minimal].
452452
pub fn instructions(&self) -> Instructions {
453453
Instructions {
454454
data: &self.0[..],

src/sighash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ impl<R: Deref<Target = Transaction>> SigHashCache<R> {
468468
/// Compute the BIP341 sighash for a script spend
469469
///
470470
/// Assumes the default `OP_CODESEPARATOR` position of `0xFFFFFFFF`. Custom values can be
471-
/// provided through the more fine-grained API of [`SighashCache::taproot_encode_signing_data_to`].
471+
/// provided through the more fine-grained API of [`SigHashCache::taproot_encode_signing_data_to`].
472472
pub fn taproot_script_spend_signature_hash<S: Into<TapLeafHash>, T: Borrow<TxOut>>(
473473
&mut self,
474474
input_index: usize,

src/slip77.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Implemenation of SLIP-0077: Deterministic blinding key derivation
22
//! for Confidential Transactions
33
//!
4-
//! Spec: https://github.com/satoshilabs/slips/blob/master/slip-0077.md
4+
//! Spec: <https://github.com/satoshilabs/slips/blob/master/slip-0077.md>
55
66
use crate::hashes::{Hash, HashEngine, hmac, sha256, sha256d};
77
use secp256k1_zkp;
@@ -35,7 +35,7 @@ impl MasterBlindingKey {
3535
}
3636

3737
/// Derive a shared nonce for a given scriptPubkey and a blinding pubkey.
38-
/// This is the same as performing ECDH with the secret key that [derive_blinding_key] returns.
38+
/// This is the same as performing ECDH with the secret key that [MasterBlindingKey::derive_blinding_key] returns.
3939
pub fn derive_shared_nonce(&self,
4040
script_pubkey: &Script,
4141
other: &secp256k1_zkp::PublicKey,

0 commit comments

Comments
 (0)