@@ -157,15 +157,15 @@ pub trait MiniscriptKey: Clone + Eq + Ord + fmt::Debug + fmt::Display + hash::Ha
157157
158158 /// The associated [`sha256::Hash`] type for this [`MiniscriptKey`] type.
159159 /// Used in the sha256 fragment
160- type Sha256Hash : Clone + Eq + Ord + fmt:: Display + fmt:: Debug + hash:: Hash ;
160+ type Sha256 : Clone + Eq + Ord + fmt:: Display + fmt:: Debug + hash:: Hash ;
161161
162162 /// Converts this key to the associated pubkey hash.
163163 fn to_pubkeyhash ( & self ) -> Self :: Hash ;
164164}
165165
166166impl MiniscriptKey for bitcoin:: secp256k1:: PublicKey {
167167 type Hash = hash160:: Hash ;
168- type Sha256Hash = sha256:: Hash ;
168+ type Sha256 = sha256:: Hash ;
169169
170170 fn to_pubkeyhash ( & self ) -> Self :: Hash {
171171 hash160:: Hash :: hash ( & self . serialize ( ) )
@@ -179,7 +179,7 @@ impl MiniscriptKey for bitcoin::PublicKey {
179179 }
180180
181181 type Hash = hash160:: Hash ;
182- type Sha256Hash = sha256:: Hash ;
182+ type Sha256 = sha256:: Hash ;
183183
184184 fn to_pubkeyhash ( & self ) -> Self :: Hash {
185185 hash160:: Hash :: hash ( & self . to_bytes ( ) )
@@ -188,7 +188,7 @@ impl MiniscriptKey for bitcoin::PublicKey {
188188
189189impl MiniscriptKey for bitcoin:: secp256k1:: XOnlyPublicKey {
190190 type Hash = hash160:: Hash ;
191- type Sha256Hash = sha256:: Hash ;
191+ type Sha256 = sha256:: Hash ;
192192
193193 fn to_pubkeyhash ( & self ) -> Self :: Hash {
194194 hash160:: Hash :: hash ( & self . serialize ( ) )
@@ -201,7 +201,7 @@ impl MiniscriptKey for bitcoin::secp256k1::XOnlyPublicKey {
201201
202202impl MiniscriptKey for String {
203203 type Hash = String ;
204- type Sha256Hash = String ; // specify hashes as string
204+ type Sha256 = String ; // specify hashes as string
205205
206206 fn to_pubkeyhash ( & self ) -> Self :: Hash {
207207 ( & self ) . to_string ( )
@@ -227,8 +227,8 @@ pub trait ToPublicKey: MiniscriptKey {
227227 /// the result directly.
228228 fn hash_to_hash160 ( hash : & <Self as MiniscriptKey >:: Hash ) -> hash160:: Hash ;
229229
230- /// Converts the generic associated [`MiniscriptKey::Sha256Hash `] to [`sha256::Hash`]
231- fn to_sha256 ( hash : & <Self as MiniscriptKey >:: Sha256Hash ) -> sha256:: Hash ;
230+ /// Converts the generic associated [`MiniscriptKey::Sha256 `] to [`sha256::Hash`]
231+ fn to_sha256 ( hash : & <Self as MiniscriptKey >:: Sha256 ) -> sha256:: Hash ;
232232}
233233
234234impl ToPublicKey for bitcoin:: PublicKey {
@@ -299,7 +299,7 @@ impl str::FromStr for DummyKey {
299299
300300impl MiniscriptKey for DummyKey {
301301 type Hash = DummyKeyHash ;
302- type Sha256Hash = DummySha256Hash ;
302+ type Sha256 = DummySha256Hash ;
303303
304304 fn to_pubkeyhash ( & self ) -> Self :: Hash {
305305 DummyKeyHash
@@ -402,8 +402,8 @@ where
402402 /// Provides the translation public keys hashes P::Hash -> Q::Hash
403403 fn f_pkh ( & mut self , pkh : & P :: Hash ) -> Result < Q :: Hash , E > ;
404404
405- /// Provides the translation from P::Sha256Hash -> Q::Sha256Hash
406- fn f_sha256 ( & mut self , sha256 : & P :: Sha256Hash ) -> Result < Q :: Sha256Hash , E > ;
405+ /// Provides the translation from P::Sha256 -> Q::Sha256
406+ fn f_sha256 ( & mut self , sha256 : & P :: Sha256 ) -> Result < Q :: Sha256 , E > ;
407407}
408408
409409/// Provides the conversion information required in [`TranslatePk`].
@@ -412,7 +412,7 @@ where
412412pub trait PkTranslator < P , Q , E >
413413where
414414 P : MiniscriptKey ,
415- Q : MiniscriptKey < Sha256Hash = P :: Sha256Hash > ,
415+ Q : MiniscriptKey < Sha256 = P :: Sha256 > ,
416416{
417417 /// Provides the translation public keys P -> Q
418418 fn f_pk ( & mut self , pk : & P ) -> Result < Q , E > ;
@@ -425,7 +425,7 @@ impl<P, Q, E, T> Translator<P, Q, E> for T
425425where
426426 T : PkTranslator < P , Q , E > ,
427427 P : MiniscriptKey ,
428- Q : MiniscriptKey < Sha256Hash = P :: Sha256Hash > ,
428+ Q : MiniscriptKey < Sha256 = P :: Sha256 > ,
429429{
430430 fn f_pk ( & mut self , pk : & P ) -> Result < Q , E > {
431431 <Self as PkTranslator < P , Q , E > >:: f_pk ( self , pk)
@@ -435,10 +435,7 @@ where
435435 <Self as PkTranslator < P , Q , E > >:: f_pkh ( self , pkh)
436436 }
437437
438- fn f_sha256 (
439- & mut self ,
440- sha256 : & <P as MiniscriptKey >:: Sha256Hash ,
441- ) -> Result < <Q >:: Sha256Hash , E > {
438+ fn f_sha256 ( & mut self , sha256 : & <P as MiniscriptKey >:: Sha256 ) -> Result < <Q >:: Sha256 , E > {
442439 Ok ( sha256. clone ( ) )
443440 }
444441}
0 commit comments