@@ -1039,9 +1039,9 @@ mod tests {
1039
1039
Prevouts :: All ( & prevouts)
1040
1040
} ;
1041
1041
1042
- let mut sig_hash_cache = SighashCache :: new ( & tx) ;
1042
+ let mut sighash_cache = SighashCache :: new ( & tx) ;
1043
1043
1044
- let hash = sig_hash_cache
1044
+ let hash = sighash_cache
1045
1045
. taproot_signature_hash ( input_index, & prevouts, annex, leaf_hash, sighash_type)
1046
1046
. unwrap ( ) ;
1047
1047
let expected = Vec :: from_hex ( expected_hash) . unwrap ( ) ;
@@ -1093,7 +1093,7 @@ mod tests {
1093
1093
let expected_tweak = hex_hash ! ( TapTweakHash , inp[ "intermediary" ] [ "tweak" ] . as_str( ) . unwrap( ) ) ;
1094
1094
let expected_tweaked_priv_key = hex_hash ! ( SecretKey , inp[ "intermediary" ] [ "tweakedPrivkey" ] . as_str( ) . unwrap( ) ) ;
1095
1095
let expected_sig_msg = Vec :: < u8 > :: from_hex ( inp[ "intermediary" ] [ "sigMsg" ] . as_str ( ) . unwrap ( ) ) . unwrap ( ) ;
1096
- let expected_sig_hash = hex_hash ! ( TapSighashHash , inp[ "intermediary" ] [ "sigHash" ] . as_str( ) . unwrap( ) ) ;
1096
+ let expected_sighash = hex_hash ! ( TapSighashHash , inp[ "intermediary" ] [ "sigHash" ] . as_str( ) . unwrap( ) ) ;
1097
1097
let sig_str = inp[ "expected" ] [ "witness" ] [ 0 ] . as_str ( ) . unwrap ( ) ;
1098
1098
let ( expected_key_spend_sig, expected_hash_ty) = if sig_str. len ( ) == 128 {
1099
1099
( secp256k1:: schnorr:: Signature :: from_str ( sig_str) . unwrap ( ) , SchnorrSighashType :: Default )
@@ -1117,21 +1117,21 @@ mod tests {
1117
1117
None ,
1118
1118
hash_ty
1119
1119
) . unwrap ( ) ;
1120
- let sig_hash = cache. taproot_signature_hash (
1120
+ let sighash = cache. taproot_signature_hash (
1121
1121
tx_ind,
1122
1122
& Prevouts :: All ( & utxos) ,
1123
1123
None ,
1124
1124
None ,
1125
1125
hash_ty
1126
1126
) . unwrap ( ) ;
1127
1127
1128
- let msg = secp256k1:: Message :: from_slice ( & sig_hash ) . unwrap ( ) ;
1128
+ let msg = secp256k1:: Message :: from_slice ( & sighash ) . unwrap ( ) ;
1129
1129
let key_spend_sig = secp. sign_schnorr_with_aux_rand ( & msg, & tweaked_keypair, & [ 0u8 ; 32 ] ) ;
1130
1130
1131
1131
assert_eq ! ( expected_internal_pk, internal_key) ;
1132
1132
assert_eq ! ( expected_tweak, tweak) ;
1133
1133
assert_eq ! ( expected_sig_msg, sig_msg) ;
1134
- assert_eq ! ( expected_sig_hash , sig_hash ) ;
1134
+ assert_eq ! ( expected_sighash , sighash ) ;
1135
1135
assert_eq ! ( expected_hash_ty, hash_ty) ;
1136
1136
assert_eq ! ( expected_key_spend_sig, key_spend_sig) ;
1137
1137
0 commit comments