@@ -153,34 +153,39 @@ use crate::prelude::*;
153
153
pub use crate :: primitives:: absolute_locktime:: { AbsLockTime , AbsLockTimeError } ;
154
154
pub use crate :: primitives:: relative_locktime:: { RelLockTime , RelLockTimeError } ;
155
155
156
- /// Public key trait which can be converted to Hash type
156
+ /// Trait representing a key which can be converted to a hash type.
157
157
pub trait MiniscriptKey : Clone + Eq + Ord + fmt:: Debug + fmt:: Display + hash:: Hash {
158
- /// Returns true if the pubkey is uncompressed. Defaults to `false`.
158
+ /// Returns true if the key is serialized uncompressed, defaults to `false`.
159
159
fn is_uncompressed ( & self ) -> bool { false }
160
160
161
- /// Returns true if the pubkey is an x-only pubkey. Defaults to `false`.
161
+ /// Returns true if the key is an x-only pubkey, defaults to `false`.
162
162
// This is required to know what in DescriptorPublicKey to know whether the inner
163
163
// key in allowed in descriptor context
164
164
fn is_x_only_key ( & self ) -> bool { false }
165
165
166
- /// Returns the number of different derivation paths in this key. Only >1 for keys
167
- /// in BIP389 multipath descriptors.
166
+ /// Returns the number of different derivation paths in this key, defaults to `0`.
167
+ ///
168
+ /// Only >1 for keys in BIP389 multipath descriptors.
168
169
fn num_der_paths ( & self ) -> usize { 0 }
169
170
170
- /// The associated [`bitcoin::hashes::sha256::Hash`] for this [`MiniscriptKey`], used in the
171
- /// sha256 fragment.
171
+ /// The associated [`sha256::Hash`] for this `MiniscriptKey`, used in the sha256 fragment.
172
+ ///
173
+ /// [`sha256::Hash`]: bitcoin::hashes::sha256::Hash
172
174
type Sha256 : Clone + Eq + Ord + fmt:: Display + fmt:: Debug + hash:: Hash ;
173
175
174
- /// The associated [`miniscript::hash256::Hash`] for this [`MiniscriptKey`], used in the
175
- /// hash256 fragment.
176
+ /// The associated [`hash256::Hash`] for this `MiniscriptKey`, used in the hash256 fragment.
177
+ ///
178
+ /// [`hash256::Hash`]: crate::hash256::Hash
176
179
type Hash256 : Clone + Eq + Ord + fmt:: Display + fmt:: Debug + hash:: Hash ;
177
180
178
- /// The associated [`bitcoin::hashes::ripemd160::Hash`] for this [`MiniscriptKey`] type, used
179
- /// in the ripemd160 fragment.
181
+ /// The associated [`ripemd160::Hash`] for this `MiniscriptKey` type, used in the ripemd160 fragment.
182
+ ///
183
+ /// [`ripemd160::Hash`]: bitcoin::hashes::ripemd160::Hash
180
184
type Ripemd160 : Clone + Eq + Ord + fmt:: Display + fmt:: Debug + hash:: Hash ;
181
185
182
- /// The associated [`bitcoin::hashes::hash160::Hash`] for this [`MiniscriptKey`] type, used in
183
- /// the hash160 fragment.
186
+ /// The associated [`hash160::Hash`] for this `MiniscriptKey` type, used in the hash160 fragment.
187
+ ///
188
+ /// [`hash160::Hash`]: bitcoin::hashes::hash160::Hash
184
189
type Hash160 : Clone + Eq + Ord + fmt:: Display + fmt:: Debug + hash:: Hash ;
185
190
}
186
191
0 commit comments