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;
116
116
117
117
mod util;
118
118
119
- use std:: io:: Write ;
120
119
use std:: str:: FromStr ;
121
120
use std:: { error, fmt, hash, str} ;
122
121
@@ -157,11 +156,7 @@ impl MiniscriptKey for bitcoin::secp256k1::PublicKey {
157
156
type Hash = hash160:: Hash ;
158
157
159
158
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 ( ) )
165
160
}
166
161
}
167
162
@@ -174,9 +169,7 @@ impl MiniscriptKey for bitcoin::PublicKey {
174
169
type Hash = hash160:: Hash ;
175
170
176
171
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 ( ) )
180
173
}
181
174
}
182
175
You can’t perform that action at this time.
0 commit comments