@@ -18,7 +18,7 @@ use std::fmt;
1818use common:: chain:: timelock:: OutputTimeLock ;
1919use serialization:: hex_encoded:: HexEncoded ;
2020
21- use crate :: script:: HashType ;
21+ use crate :: script:: HashChallenge ;
2222
2323use super :: { DissatisfiedScript , ScriptCondition , Threshold , WitnessScript } ;
2424
@@ -69,20 +69,20 @@ impl WitnessScript {
6969 OutputTimeLock :: ForSeconds ( s) => write ! ( f, "after_seconds({s})" ) ,
7070 } ,
7171 WitnessScript :: HashLock {
72- hash_type ,
72+ hash_challenge ,
7373 preimage,
7474 } => {
7575 let preimage = HexEncoded :: new ( preimage) ;
7676 let mut write_fn = |algo : & str , hash : & [ u8 ] | {
7777 let hash = HexEncoded :: new ( hash) ;
7878 write ! ( f, "{algo}(0x{hash}, 0x{preimage})" )
7979 } ;
80- match hash_type {
81- HashType :: RIPEMD160 ( hash) => write_fn ( "RIPEMD160" , hash. as_slice ( ) ) ,
82- HashType :: SHA1 ( hash) => write_fn ( "SHA1" , hash. as_slice ( ) ) ,
83- HashType :: SHA256 ( hash) => write_fn ( "SHA256" , hash. as_slice ( ) ) ,
84- HashType :: HASH160 ( hash) => write_fn ( "HASH160" , hash. as_slice ( ) ) ,
85- HashType :: HASH256 ( hash) => write_fn ( "HASH256" , hash. as_slice ( ) ) ,
80+ match hash_challenge {
81+ HashChallenge :: RIPEMD160 ( hash) => write_fn ( "RIPEMD160" , hash. as_slice ( ) ) ,
82+ HashChallenge :: SHA1 ( hash) => write_fn ( "SHA1" , hash. as_slice ( ) ) ,
83+ HashChallenge :: SHA256 ( hash) => write_fn ( "SHA256" , hash. as_slice ( ) ) ,
84+ HashChallenge :: HASH160 ( hash) => write_fn ( "HASH160" , hash. as_slice ( ) ) ,
85+ HashChallenge :: HASH256 ( hash) => write_fn ( "HASH256" , hash. as_slice ( ) ) ,
8686 }
8787 }
8888 }
0 commit comments