@@ -155,7 +155,7 @@ pub fn test_desc_satisfy(
155
155
match derived_desc {
156
156
Descriptor :: Tr ( ref tr) => {
157
157
// Fixme: take a parameter
158
- let hash_ty = sighash:: TapSighashType :: Default ;
158
+ let sighash_type = sighash:: TapSighashType :: Default ;
159
159
160
160
let internal_key_present = x_only_pks
161
161
. iter ( )
@@ -170,15 +170,15 @@ pub fn test_desc_satisfy(
170
170
. add_xonly_tweak ( & secp, & tr. spend_info ( ) . tap_tweak ( ) . to_scalar ( ) )
171
171
. expect ( "Tweaking failed" ) ;
172
172
let sighash_msg = sighash_cache
173
- . taproot_key_spend_signature_hash ( 0 , & prevouts, hash_ty )
173
+ . taproot_key_spend_signature_hash ( 0 , & prevouts, sighash_type )
174
174
. unwrap ( ) ;
175
175
let msg = secp256k1:: Message :: from_digest ( sighash_msg. to_byte_array ( ) ) ;
176
176
let mut aux_rand = [ 0u8 ; 32 ] ;
177
177
rand:: thread_rng ( ) . fill_bytes ( & mut aux_rand) ;
178
178
let schnorr_sig =
179
179
secp. sign_schnorr_with_aux_rand ( & msg, & internal_keypair, & aux_rand) ;
180
180
psbt. inputs [ 0 ] . tap_key_sig =
181
- Some ( taproot:: Signature { sig : schnorr_sig, hash_ty : hash_ty } ) ;
181
+ Some ( taproot:: Signature { signature : schnorr_sig, sighash_type } ) ;
182
182
} else {
183
183
// No internal key
184
184
}
@@ -195,17 +195,17 @@ pub fn test_desc_satisfy(
195
195
. collect ( ) ;
196
196
for ( keypair, leaf_hash) in x_only_keypairs_reqd {
197
197
let sighash_msg = sighash_cache
198
- . taproot_script_spend_signature_hash ( 0 , & prevouts, leaf_hash, hash_ty )
198
+ . taproot_script_spend_signature_hash ( 0 , & prevouts, leaf_hash, sighash_type )
199
199
. unwrap ( ) ;
200
200
let msg = secp256k1:: Message :: from_digest ( sighash_msg. to_byte_array ( ) ) ;
201
201
let mut aux_rand = [ 0u8 ; 32 ] ;
202
202
rand:: thread_rng ( ) . fill_bytes ( & mut aux_rand) ;
203
- let sig = secp. sign_schnorr_with_aux_rand ( & msg, & keypair, & aux_rand) ;
203
+ let signature = secp. sign_schnorr_with_aux_rand ( & msg, & keypair, & aux_rand) ;
204
204
let x_only_pk =
205
205
x_only_pks[ xonly_keypairs. iter ( ) . position ( |& x| x == keypair) . unwrap ( ) ] ;
206
206
psbt. inputs [ 0 ]
207
207
. tap_script_sigs
208
- . insert ( ( x_only_pk, leaf_hash) , taproot:: Signature { sig , hash_ty : hash_ty } ) ;
208
+ . insert ( ( x_only_pk, leaf_hash) , taproot:: Signature { signature , sighash_type } ) ;
209
209
}
210
210
}
211
211
_ => {
@@ -247,16 +247,16 @@ pub fn test_desc_satisfy(
247
247
. to_secp_msg ( ) ;
248
248
249
249
// Fixme: Take a parameter
250
- let hash_ty = sighash:: EcdsaSighashType :: All ;
250
+ let sighash_type = sighash:: EcdsaSighashType :: All ;
251
251
252
252
// Finally construct the signature and add to psbt
253
253
for sk in sks_reqd {
254
- let sig = secp. sign_ecdsa ( & msg, & sk) ;
254
+ let signature = secp. sign_ecdsa ( & msg, & sk) ;
255
255
let pk = pks[ sks. iter ( ) . position ( |& x| x == sk) . unwrap ( ) ] ;
256
- assert ! ( secp. verify_ecdsa( & msg, & sig , & pk. inner) . is_ok( ) ) ;
256
+ assert ! ( secp. verify_ecdsa( & msg, & signature , & pk. inner) . is_ok( ) ) ;
257
257
psbt. inputs [ 0 ]
258
258
. partial_sigs
259
- . insert ( pk, ecdsa:: Signature { sig , hash_ty : hash_ty } ) ;
259
+ . insert ( pk, ecdsa:: Signature { signature , sighash_type } ) ;
260
260
}
261
261
}
262
262
}
0 commit comments