@@ -155,7 +155,7 @@ pub fn test_desc_satisfy(
155155 match derived_desc {
156156 Descriptor :: Tr ( ref tr) => {
157157 // Fixme: take a parameter
158- let hash_ty = sighash:: TapSighashType :: Default ;
158+ let sighash_type = sighash:: TapSighashType :: Default ;
159159
160160 let internal_key_present = x_only_pks
161161 . iter ( )
@@ -170,15 +170,15 @@ pub fn test_desc_satisfy(
170170 . add_xonly_tweak ( & secp, & tr. spend_info ( ) . tap_tweak ( ) . to_scalar ( ) )
171171 . expect ( "Tweaking failed" ) ;
172172 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 )
174174 . unwrap ( ) ;
175175 let msg = secp256k1:: Message :: from_digest ( sighash_msg. to_byte_array ( ) ) ;
176176 let mut aux_rand = [ 0u8 ; 32 ] ;
177177 rand:: thread_rng ( ) . fill_bytes ( & mut aux_rand) ;
178178 let schnorr_sig =
179179 secp. sign_schnorr_with_aux_rand ( & msg, & internal_keypair, & aux_rand) ;
180180 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 } ) ;
182182 } else {
183183 // No internal key
184184 }
@@ -195,17 +195,17 @@ pub fn test_desc_satisfy(
195195 . collect ( ) ;
196196 for ( keypair, leaf_hash) in x_only_keypairs_reqd {
197197 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 )
199199 . unwrap ( ) ;
200200 let msg = secp256k1:: Message :: from_digest ( sighash_msg. to_byte_array ( ) ) ;
201201 let mut aux_rand = [ 0u8 ; 32 ] ;
202202 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) ;
204204 let x_only_pk =
205205 x_only_pks[ xonly_keypairs. iter ( ) . position ( |& x| x == keypair) . unwrap ( ) ] ;
206206 psbt. inputs [ 0 ]
207207 . 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 } ) ;
209209 }
210210 }
211211 _ => {
@@ -247,16 +247,16 @@ pub fn test_desc_satisfy(
247247 . to_secp_msg ( ) ;
248248
249249 // Fixme: Take a parameter
250- let hash_ty = sighash:: EcdsaSighashType :: All ;
250+ let sighash_type = sighash:: EcdsaSighashType :: All ;
251251
252252 // Finally construct the signature and add to psbt
253253 for sk in sks_reqd {
254- let sig = secp. sign_ecdsa ( & msg, & sk) ;
254+ let signature = secp. sign_ecdsa ( & msg, & sk) ;
255255 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( ) ) ;
257257 psbt. inputs [ 0 ]
258258 . partial_sigs
259- . insert ( pk, ecdsa:: Signature { sig , hash_ty : hash_ty } ) ;
259+ . insert ( pk, ecdsa:: Signature { signature , sighash_type } ) ;
260260 }
261261 }
262262 }
0 commit comments