@@ -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
@@ -171,8 +171,8 @@ impl<'txin> Interpreter<'txin> {
171171 spk : & bitcoin:: Script ,
172172 script_sig : & ' txin bitcoin:: Script ,
173173 witness : & ' txin Witness ,
174- age : u32 , // CSV, relative lock time.
175- lock_time : u32 , // CLTV, absolute lock time.
174+ age : u32 , // CSV, relative lock time.
175+ lock_time : LockTime , // CLTV, absolute lock time.
176176 ) -> Result < Self , Error > {
177177 let ( inner, stack, script_code) = inner:: from_txdata ( spk, script_sig, witness) ?;
178178 Ok ( Interpreter {
@@ -494,7 +494,7 @@ pub enum SatisfiedConstraint {
494494 ///Absolute Timelock for CLTV.
495495 AbsoluteTimelock {
496496 /// The value of Absolute timelock
497- time : u32 ,
497+ n : LockTime ,
498498 } ,
499499}
500500
@@ -530,7 +530,7 @@ pub struct Iter<'intp, 'txin: 'intp> {
530530 state : Vec < NodeEvaluationState < ' intp > > ,
531531 stack : Stack < ' txin > ,
532532 age : u32 ,
533- lock_time : u32 ,
533+ lock_time : LockTime ,
534534 has_errored : bool ,
535535}
536536
@@ -1143,7 +1143,7 @@ mod tests {
11431143 n_satisfied: 0 ,
11441144 } ] ,
11451145 age : 1002 ,
1146- lock_time : 1002 ,
1146+ lock_time : LockTime :: from_consensus ( 1002 ) ,
11471147 has_errored : false ,
11481148 }
11491149 }
@@ -1206,7 +1206,7 @@ mod tests {
12061206 let after_satisfied: Result < Vec < SatisfiedConstraint > , Error > = constraints. collect ( ) ;
12071207 assert_eq ! (
12081208 after_satisfied. unwrap( ) ,
1209- vec![ SatisfiedConstraint :: AbsoluteTimelock { time : 1000 } ]
1209+ vec![ SatisfiedConstraint :: AbsoluteTimelock { n : LockTime :: from_consensus ( 1000 ) } ]
12101210 ) ;
12111211
12121212 //Check Older
0 commit comments