-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: fix new clippy lint about excessively long initial line #730
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,9 @@ | |
//! Malleability-related Type properties | ||
|
||
/// Whether the fragment has a dissatisfaction, and if so, whether | ||
/// it is unique. Affects both correctness and malleability-freeness, | ||
/// it is unique. | ||
/// | ||
/// Affects both correctness and malleability-freeness, | ||
/// since we assume 3rd parties are able to produce dissatisfactions | ||
/// for all fragments. | ||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] | ||
|
@@ -12,11 +14,15 @@ pub enum Dissat { | |
/// input. | ||
None, | ||
/// Fragment has a unique dissatisfaction, which is always available, | ||
/// and will push 0 given this dissatisfaction as input. The combination | ||
/// and will push 0 given this dissatisfaction as input. | ||
/// | ||
/// The combination | ||
/// of `Dissat::Unique` and `Input::Zero` implies that a fragment is | ||
/// impossible to satisfy (is a `0` or equivalent). | ||
Unique, | ||
/// No assumptions may be made about dissatisfying this fragment. This | ||
/// No assumptions may be made about dissatisfying this fragment. | ||
/// | ||
/// This | ||
/// does not necessarily mean that there are multiple dissatisfactions; | ||
/// there may be none, or none that are always available (e.g. for a | ||
/// `pk_h` the key preimage may not be available). | ||
Comment on lines
-19
to
28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an example that would be better with the column width fixing. |
||
|
@@ -52,8 +58,9 @@ pub struct Malleability { | |
/// Properties of dissatisfying inputs | ||
pub dissat: Dissat, | ||
/// `true` if satisfactions cannot be created by any 3rd party | ||
/// who has not yet seen a satisfaction. (Hash preimages and | ||
/// signature checks are safe; timelocks are not.) Affects | ||
/// who has not yet seen a satisfaction. | ||
/// | ||
/// Hash preimages and signature checks are safe; timelocks are not. Affects | ||
/// malleability. | ||
pub safe: bool, | ||
/// Whether a non-malleable satisfaction is guaranteed to exist for | ||
|
@@ -69,7 +76,8 @@ impl Malleability { | |
pub const FALSE: Self = | ||
Malleability { dissat: Dissat::Unique, safe: true, non_malleable: true }; | ||
|
||
/// Check whether the `self` is a subtype of `other` argument . | ||
/// Check whether the `self` is a subtype of `other` argument. | ||
/// | ||
/// This checks whether the argument `other` has attributes which are present | ||
/// in the given `Type`. This returns `true` on same arguments | ||
/// `a.is_subtype(a)` is `true`. | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,9 @@ | ||||||
// SPDX-License-Identifier: CC0-1.0 | ||||||
|
||||||
//! A spending plan or *plan* for short is a representation of a particular spending path on a | ||||||
//! descriptor. This allows us to analayze a choice of spending path without producing any | ||||||
//! A spending plan (or *plan*) is a representation of a particular spending path on a | ||||||
//! descriptor. | ||||||
//! | ||||||
//! This allows us to analayze a choice of spending path without producing any | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok can I review-beg this typo at least 😢 @apoelstra? |
||||||
//! signatures or other witness data for it. | ||||||
//! | ||||||
//! To make a plan you provide the descriptor with "assets" like which keys you are able to use, hash | ||||||
|
@@ -67,7 +69,9 @@ pub trait AssetProvider<Pk: MiniscriptKey> { | |||||
} | ||||||
|
||||||
/// Given a keyhash, look up the EC signature and the associated key. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
/// | ||||||
/// Returns the key if a signature is found. | ||||||
/// | ||||||
/// Even if signatures for public key Hashes are not available, the users | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why capital H? |
||||||
/// can use this map to provide pkh -> pk mapping which can be useful | ||||||
/// for dissatisfying pkh. | ||||||
|
@@ -76,7 +80,9 @@ pub trait AssetProvider<Pk: MiniscriptKey> { | |||||
} | ||||||
|
||||||
/// Given a keyhash, look up the schnorr signature and the associated key. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
/// | ||||||
/// Returns the key and sig len if a signature is found. | ||||||
/// | ||||||
/// Even if signatures for public key Hashes are not available, the users | ||||||
/// can use this map to provide pkh -> pk mapping which can be useful | ||||||
/// for dissatisfying pkh. | ||||||
|
@@ -211,7 +217,9 @@ where | |||||
fn check_after(&self, l: absolute::LockTime) -> bool { Satisfier::check_after(self, l) } | ||||||
} | ||||||
|
||||||
/// Representation of a particular spending path on a descriptor. Contains the witness template | ||||||
/// Representation of a particular spending path on a descriptor. | ||||||
/// | ||||||
/// Contains the witness template | ||||||
/// and the timelocks needed for satisfying the plan. | ||||||
/// Calling `plan` on a Descriptor will return this structure, | ||||||
/// containing the cheapest spending path possible (considering the `Assets` given) | ||||||
|
@@ -499,7 +507,9 @@ impl TaprootAvailableLeaves { | |||||
/// The Assets we can use to satisfy a particular spending path | ||||||
#[derive(Debug, Default)] | ||||||
pub struct Assets { | ||||||
/// Keys the user can sign for, and how. A pair `(fingerprint, derivation_path)` is | ||||||
/// Keys the user can sign for, and how. | ||||||
/// | ||||||
/// A pair `(fingerprint, derivation_path)` is | ||||||
/// provided, meaning that the user can sign using the key with `fingerprint`, | ||||||
/// derived with either `derivation_path` or a derivation path that extends `derivation_path` | ||||||
/// by exactly one child number. For example, if the derivation path `m/0/1` is provided, the | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||
// Written in 2020 by Sanket Kanjalkar <[email protected]> | ||||||
// SPDX-License-Identifier: CC0-1.0 | ||||||
|
||||||
//! # Partially-Signed Bitcoin Transactions | ||||||
//! Partially-Signed Bitcoin Transactions | ||||||
//! | ||||||
//! This module implements the Finalizer and Extractor roles defined in | ||||||
//! BIP 174, PSBT, described at | ||||||
|
@@ -298,7 +298,8 @@ fn get_descriptor(psbt: &Psbt, index: usize) -> Result<Descriptor<PublicKey>, In | |||||
} | ||||||
|
||||||
/// Interprets all psbt inputs and checks whether the | ||||||
/// script is correctly interpreted according to the context | ||||||
/// script is correctly interpreted according to the context. | ||||||
/// | ||||||
/// The psbt must have included final script sig and final witness. | ||||||
/// In other words, this checks whether the finalized psbt interprets | ||||||
/// correctly | ||||||
|
@@ -351,7 +352,9 @@ fn interpreter_inp_check<C: secp256k1::Verification, T: Borrow<TxOut>>( | |||||
Ok(()) | ||||||
} | ||||||
|
||||||
/// Finalize the psbt. This function takes in a mutable reference to psbt | ||||||
/// Finalize the psbt. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe
Suggested change
to adhere with other docstrings? |
||||||
/// | ||||||
/// This function takes in a mutable reference to psbt | ||||||
/// and populates the final_witness and final_scriptsig | ||||||
/// of the psbt assuming all of the inputs are miniscript as per BIP174. | ||||||
/// If any of the inputs is not miniscript, this returns a parsing error | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot annotate above but in L40 there's a "look" -> "looks" and "schnorr" -> "Schnorr"