@@ -25,7 +25,7 @@ use core::str::FromStr;
2525use bitcoin:: blockdata:: witness:: Witness ;
2626use bitcoin:: hashes:: { hash160, ripemd160, sha256} ;
2727use bitcoin:: util:: { sighash, taproot} ;
28- use bitcoin:: { self , secp256k1, TxOut } ;
28+ use bitcoin:: { self , secp256k1, TxOut , LockTime } ;
2929
3030use crate :: miniscript:: context:: NoChecks ;
3131use crate :: miniscript:: ScriptContext ;
@@ -49,7 +49,7 @@ pub struct Interpreter<'txin> {
4949 /// is the leaf script; for key-spends it is `None`.
5050 script_code : Option < bitcoin:: Script > ,
5151 age : u32 ,
52- lock_time : u32 ,
52+ lock_time : LockTime ,
5353}
5454
5555// A type representing functions for checking signatures that accept both
@@ -173,8 +173,8 @@ impl<'txin> Interpreter<'txin> {
173173 spk : & bitcoin:: Script ,
174174 script_sig : & ' txin bitcoin:: Script ,
175175 witness : & ' txin Witness ,
176- age : u32 , // CSV, relative lock time.
177- lock_time : u32 , // CLTV, absolute lock time.
176+ age : u32 , // CSV, relative lock time.
177+ lock_time : LockTime , // CLTV, absolute lock time.
178178 ) -> Result < Self , Error > {
179179 let ( inner, stack, script_code) = inner:: from_txdata ( spk, script_sig, witness) ?;
180180 Ok ( Interpreter {
@@ -496,7 +496,7 @@ pub enum SatisfiedConstraint {
496496 ///Absolute Timelock for CLTV.
497497 AbsoluteTimelock {
498498 /// The value of Absolute timelock
499- time : u32 ,
499+ n : LockTime ,
500500 } ,
501501}
502502
@@ -532,7 +532,7 @@ pub struct Iter<'intp, 'txin: 'intp> {
532532 state : Vec < NodeEvaluationState < ' intp > > ,
533533 stack : Stack < ' txin > ,
534534 age : u32 ,
535- lock_time : u32 ,
535+ lock_time : LockTime ,
536536 has_errored : bool ,
537537}
538538
@@ -1145,7 +1145,7 @@ mod tests {
11451145 n_satisfied: 0 ,
11461146 } ] ,
11471147 age : 1002 ,
1148- lock_time : 1002 ,
1148+ lock_time : LockTime :: from_consensus ( 1002 ) ,
11491149 has_errored : false ,
11501150 }
11511151 }
@@ -1208,7 +1208,7 @@ mod tests {
12081208 let after_satisfied: Result < Vec < SatisfiedConstraint > , Error > = constraints. collect ( ) ;
12091209 assert_eq ! (
12101210 after_satisfied. unwrap( ) ,
1211- vec![ SatisfiedConstraint :: AbsoluteTimelock { time : 1000 } ]
1211+ vec![ SatisfiedConstraint :: AbsoluteTimelock { n : LockTime :: from_consensus ( 1000 ) } ]
12121212 ) ;
12131213
12141214 //Check Older
0 commit comments