2121
2222use std:: borrow:: Borrow ;
2323use crate :: encode:: { self , Encodable } ;
24- use crate :: hash_types:: SigHash ;
24+ use crate :: hash_types:: Sighash ;
2525use crate :: hashes:: { sha256d, Hash , sha256} ;
2626use crate :: script:: Script ;
2727use std:: ops:: { Deref , DerefMut } ;
@@ -552,9 +552,9 @@ impl<R: Deref<Target = Transaction>> SighashCache<R> {
552552 if sighash != EcdsaSighashType :: Single && sighash != EcdsaSighashType :: None {
553553 self . segwit_cache ( ) . outputs . consensus_encode ( & mut writer) ?;
554554 } else if sighash == EcdsaSighashType :: Single && input_index < self . tx . output . len ( ) {
555- let mut single_enc = SigHash :: engine ( ) ;
555+ let mut single_enc = Sighash :: engine ( ) ;
556556 self . tx . output [ input_index] . consensus_encode ( & mut single_enc) ?;
557- SigHash :: from_engine ( single_enc) . consensus_encode ( & mut writer) ?;
557+ Sighash :: from_engine ( single_enc) . consensus_encode ( & mut writer) ?;
558558 } else {
559559 zero_hash. consensus_encode ( & mut writer) ?;
560560 }
@@ -579,11 +579,11 @@ impl<R: Deref<Target = Transaction>> SighashCache<R> {
579579 script_code : & Script ,
580580 value : confidential:: Value ,
581581 sighash_type : EcdsaSighashType
582- ) -> SigHash {
583- let mut enc = SigHash :: engine ( ) ;
582+ ) -> Sighash {
583+ let mut enc = Sighash :: engine ( ) ;
584584 self . encode_segwitv0_signing_data_to ( & mut enc, input_index, script_code, value, sighash_type)
585585 . expect ( "engines don't error" ) ;
586- SigHash :: from_engine ( enc)
586+ Sighash :: from_engine ( enc)
587587 }
588588
589589 /// Encodes the signing data from which a signature hash for a given input index with a given
@@ -692,11 +692,11 @@ impl<R: Deref<Target = Transaction>> SighashCache<R> {
692692 input_index : usize ,
693693 script_pubkey : & Script ,
694694 sighash_type : EcdsaSighashType ,
695- ) -> SigHash {
696- let mut engine = SigHash :: engine ( ) ;
695+ ) -> Sighash {
696+ let mut engine = Sighash :: engine ( ) ;
697697 self . encode_legacy_signing_data_to ( & mut engine, input_index, script_pubkey, sighash_type)
698698 . expect ( "engines don't error" ) ;
699- SigHash :: from_engine ( engine)
699+ Sighash :: from_engine ( engine)
700700 }
701701
702702 #[ inline]
@@ -977,7 +977,7 @@ mod tests{
977977 let script = Script :: from ( Vec :: < u8 > :: from_hex ( script) . unwrap ( ) ) ;
978978 // A hack to parse sha256d strings are sha256 so that we don't reverse them...
979979 let raw_expected = crate :: hashes:: sha256:: Hash :: from_str ( expected_result) . unwrap ( ) ;
980- let expected_result = SigHash :: from_slice ( & raw_expected[ ..] ) . unwrap ( ) ;
980+ let expected_result = Sighash :: from_slice ( & raw_expected[ ..] ) . unwrap ( ) ;
981981
982982 let mut cache = SighashCache :: new ( & tx) ;
983983 let value : confidential:: Value = deserialize ( & Vec :: < u8 > :: from_hex ( value) . unwrap ( ) [ ..] ) . unwrap ( ) ;
@@ -1011,7 +1011,7 @@ mod tests{
10111011 let script = Script :: from ( Vec :: < u8 > :: from_hex ( script) . unwrap ( ) ) ;
10121012 // A hack to parse sha256d strings are sha256 so that we don't reverse them...
10131013 let raw_expected = crate :: hashes:: sha256:: Hash :: from_str ( expected_result) . unwrap ( ) ;
1014- let expected_result = SigHash :: from_slice ( & raw_expected[ ..] ) . unwrap ( ) ;
1014+ let expected_result = Sighash :: from_slice ( & raw_expected[ ..] ) . unwrap ( ) ;
10151015 let sighash_cache = SighashCache :: new ( & tx) ;
10161016 let actual_result = sighash_cache. legacy_sighash ( input_index, & script, hash_type) ;
10171017 assert_eq ! ( actual_result, expected_result) ;
0 commit comments