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