@@ -13,8 +13,9 @@ use std::fmt;
13
13
use std:: str:: FromStr ;
14
14
15
15
use bitcoin;
16
- use elements:: hashes:: { hash160, ripemd160, sha256, Hash , HashEngine } ;
17
- use elements:: { self , secp256k1_zkp, sighash, EcdsaSigHashType , LockTime , Sequence , SigHash } ;
16
+ use bitcoin:: hashes:: { Hash , HashEngine } ;
17
+ use elements:: hashes:: { hash160, ripemd160, sha256} ;
18
+ use elements:: { self , secp256k1_zkp, sighash, EcdsaSighashType , LockTime , Sequence , Sighash } ;
18
19
19
20
use crate :: extensions:: { CovExtArgs , ParseableExt , TxEnv } ;
20
21
use crate :: miniscript:: context:: { NoChecks , SigType } ;
@@ -259,7 +260,7 @@ where
259
260
sighash:: Prevouts :: All ( prevouts) => prevouts. get ( input_index) ,
260
261
}
261
262
}
262
- let mut cache = elements:: sighash:: SigHashCache :: new ( tx) ;
263
+ let mut cache = elements:: sighash:: SighashCache :: new ( tx) ;
263
264
match sig {
264
265
KeySigPair :: Ecdsa ( key, ecdsa_sig) => {
265
266
let script_pubkey = self . script_code . as_ref ( ) . expect ( "Legacy have script code" ) ;
@@ -1101,7 +1102,7 @@ where
1101
1102
{
1102
1103
let sighash_bytes = self . stack [ 1 ] . as_push ( ) . expect ( "Push checked above" ) ;
1103
1104
let sighash_u32 = util:: slice_to_u32_le ( sighash_bytes) ;
1104
- let sighash_ty = EcdsaSigHashType :: from_u32 ( sighash_u32) ;
1105
+ let sighash_ty = EcdsaSighashType :: from_u32 ( sighash_u32) ;
1105
1106
let sig_vec = self . stack [ 0 ] . as_push ( ) . expect ( "Size checked above" ) ;
1106
1107
ser_sig. extend ( sig_vec) ;
1107
1108
ser_sig. push ( sighash_ty as u8 ) ;
@@ -1117,9 +1118,9 @@ where
1117
1118
. rev ( )
1118
1119
. flat_map ( |x| Vec :: from ( x. as_push ( ) . expect ( "Push checked above" ) ) )
1119
1120
. collect ( ) ;
1120
- let mut eng = SigHash :: engine ( ) ;
1121
+ let mut eng = Sighash :: engine ( ) ;
1121
1122
eng. input ( & sighash_msg) ;
1122
- let sighash_u256 = SigHash :: from_engine ( eng) ;
1123
+ let sighash_u256 = Sighash :: from_engine ( eng) ;
1123
1124
let msg = elements:: secp256k1_zkp:: Message :: from_slice ( & sighash_u256[ ..] ) . unwrap ( ) ;
1124
1125
1125
1126
// Legacy Cov scripts only operate on Ecdsa key sig pairs
@@ -1242,7 +1243,7 @@ mod tests {
1242
1243
compressed : true ,
1243
1244
} ;
1244
1245
let sig = secp. sign_ecdsa ( & msg, & sk) ;
1245
- ecdsa_sigs. push ( ( sig, elements:: EcdsaSigHashType :: All ) ) ;
1246
+ ecdsa_sigs. push ( ( sig, elements:: EcdsaSighashType :: All ) ) ;
1246
1247
let mut sigser = sig. serialize_der ( ) . to_vec ( ) ;
1247
1248
sigser. push ( 0x01 ) ; // sighash_all
1248
1249
pks. push ( pk) ;
@@ -1254,7 +1255,7 @@ mod tests {
1254
1255
let schnorr_sig = secp. sign_schnorr_with_aux_rand ( & msg, & keypair, & [ 0u8 ; 32 ] ) ;
1255
1256
let schnorr_sig = elements:: SchnorrSig {
1256
1257
sig : schnorr_sig,
1257
- hash_ty : elements:: SchnorrSigHashType :: Default ,
1258
+ hash_ty : elements:: SchnorrSighashType :: Default ,
1258
1259
} ;
1259
1260
ser_schnorr_sigs. push ( schnorr_sig. to_vec ( ) ) ;
1260
1261
schnorr_sigs. push ( schnorr_sig) ;
0 commit comments