File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,6 @@ pub mod psbt;
116116
117117mod util;
118118
119- use std:: io:: Write ;
120119use std:: str:: FromStr ;
121120use std:: { error, fmt, hash, str} ;
122121
@@ -157,11 +156,7 @@ impl MiniscriptKey for bitcoin::secp256k1::PublicKey {
157156 type Hash = hash160:: Hash ;
158157
159158 fn to_pubkeyhash ( & self ) -> Self :: Hash {
160- let mut engine = hash160:: Hash :: engine ( ) ;
161- engine
162- . write_all ( & self . serialize ( ) )
163- . expect ( "engines don't error" ) ;
164- hash160:: Hash :: from_engine ( engine)
159+ hash160:: Hash :: hash ( & self . serialize ( ) )
165160 }
166161}
167162
@@ -174,9 +169,7 @@ impl MiniscriptKey for bitcoin::PublicKey {
174169 type Hash = hash160:: Hash ;
175170
176171 fn to_pubkeyhash ( & self ) -> Self :: Hash {
177- let mut engine = hash160:: Hash :: engine ( ) ;
178- self . write_into ( & mut engine) . expect ( "engines don't error" ) ;
179- hash160:: Hash :: from_engine ( engine)
172+ hash160:: Hash :: hash ( & self . to_bytes ( ) )
180173 }
181174}
182175
You can’t perform that action at this time.
0 commit comments