@@ -25,7 +25,7 @@ use core::str::FromStr;
2525use bitcoin:: blockdata:: witness:: Witness ;
2626use bitcoin:: hashes:: { hash160, ripemd160, sha256, sha256d} ;
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- height : u32 ,
52+ lock_time : LockTime ,
5353}
5454
5555// A type representing functions for checking signatures that accept both
@@ -170,15 +170,15 @@ impl<'txin> Interpreter<'txin> {
170170 script_sig : & ' txin bitcoin:: Script ,
171171 witness : & ' txin Witness ,
172172 age : u32 , // CSV, relative lock time.
173- height : u32 , // CLTV, absolute lock time.
173+ lock_time : LockTime , // CLTV, absolute lock time.
174174 ) -> Result < Self , Error > {
175175 let ( inner, stack, script_code) = inner:: from_txdata ( spk, script_sig, witness) ?;
176176 Ok ( Interpreter {
177177 inner,
178178 stack,
179179 script_code,
180180 age,
181- height ,
181+ lock_time ,
182182 } )
183183 }
184184
@@ -209,7 +209,7 @@ impl<'txin> Interpreter<'txin> {
209209 // call interpreter.iter() without mutating interpreter
210210 stack : self . stack . clone ( ) ,
211211 age : self . age ,
212- height : self . height ,
212+ lock_time : self . lock_time ,
213213 has_errored : false ,
214214 }
215215 }
@@ -492,7 +492,7 @@ pub enum SatisfiedConstraint {
492492 ///Absolute Timelock for CLTV.
493493 AbsoluteTimelock {
494494 /// The value of Absolute timelock
495- time : u32 ,
495+ n : LockTime ,
496496 } ,
497497}
498498
@@ -528,7 +528,7 @@ pub struct Iter<'intp, 'txin: 'intp> {
528528 state : Vec < NodeEvaluationState < ' intp > > ,
529529 stack : Stack < ' txin > ,
530530 age : u32 ,
531- height : u32 ,
531+ lock_time : LockTime ,
532532 has_errored : bool ,
533533}
534534
@@ -605,7 +605,7 @@ where
605605 Terminal :: After ( ref n) => {
606606 debug_assert_eq ! ( node_state. n_evaluated, 0 ) ;
607607 debug_assert_eq ! ( node_state. n_satisfied, 0 ) ;
608- let res = self . stack . evaluate_after ( n, self . height ) ;
608+ let res = self . stack . evaluate_after ( n, self . lock_time ) ;
609609 if res. is_some ( ) {
610610 return res;
611611 }
@@ -1131,7 +1131,7 @@ mod tests {
11311131 n_satisfied: 0 ,
11321132 } ] ,
11331133 age : 1002 ,
1134- height : 1002 ,
1134+ lock_time : LockTime :: from ( 1002 ) ,
11351135 has_errored : false ,
11361136 }
11371137 }
@@ -1197,7 +1197,7 @@ mod tests {
11971197 let after_satisfied: Result < Vec < SatisfiedConstraint > , Error > = constraints. collect ( ) ;
11981198 assert_eq ! (
11991199 after_satisfied. unwrap( ) ,
1200- vec![ SatisfiedConstraint :: AbsoluteTimelock { time: 1000 } ]
1200+ vec![ SatisfiedConstraint :: AbsoluteTimelock { time: LockTime :: from ( 1000 ) } ]
12011201 ) ;
12021202
12031203 //Check Older
0 commit comments