@@ -25,7 +25,7 @@ use core::str::FromStr;
25
25
use bitcoin:: blockdata:: witness:: Witness ;
26
26
use bitcoin:: hashes:: { hash160, ripemd160, sha256, sha256d} ;
27
27
use bitcoin:: util:: { sighash, taproot} ;
28
- use bitcoin:: { self , secp256k1, TxOut } ;
28
+ use bitcoin:: { self , secp256k1, TxOut , LockTime } ;
29
29
30
30
use crate :: miniscript:: context:: NoChecks ;
31
31
use crate :: miniscript:: ScriptContext ;
@@ -49,7 +49,7 @@ pub struct Interpreter<'txin> {
49
49
/// is the leaf script; for key-spends it is `None`.
50
50
script_code : Option < bitcoin:: Script > ,
51
51
age : u32 ,
52
- lock_time : u32 ,
52
+ lock_time : LockTime ,
53
53
}
54
54
55
55
// A type representing functions for checking signatures that accept both
@@ -170,8 +170,8 @@ impl<'txin> Interpreter<'txin> {
170
170
spk : & bitcoin:: Script ,
171
171
script_sig : & ' txin bitcoin:: Script ,
172
172
witness : & ' txin Witness ,
173
- age : u32 , // CSV, relative lock time.
174
- lock_time : u32 , // CLTV, absolute lock time.
173
+ age : u32 , // CSV, relative lock time.
174
+ lock_time : LockTime , // CLTV, absolute lock time.
175
175
) -> Result < Self , Error > {
176
176
let ( inner, stack, script_code) = inner:: from_txdata ( spk, script_sig, witness) ?;
177
177
Ok ( Interpreter {
@@ -493,7 +493,7 @@ pub enum SatisfiedConstraint {
493
493
///Absolute Timelock for CLTV.
494
494
AbsoluteTimelock {
495
495
/// The value of Absolute timelock
496
- time : u32 ,
496
+ n : LockTime ,
497
497
} ,
498
498
}
499
499
@@ -529,7 +529,7 @@ pub struct Iter<'intp, 'txin: 'intp> {
529
529
state : Vec < NodeEvaluationState < ' intp > > ,
530
530
stack : Stack < ' txin > ,
531
531
age : u32 ,
532
- lock_time : u32 ,
532
+ lock_time : LockTime ,
533
533
has_errored : bool ,
534
534
}
535
535
@@ -1132,7 +1132,7 @@ mod tests {
1132
1132
n_satisfied: 0 ,
1133
1133
} ] ,
1134
1134
age : 1002 ,
1135
- lock_time : 1002 ,
1135
+ lock_time : LockTime :: from ( 1002 ) ,
1136
1136
has_errored : false ,
1137
1137
}
1138
1138
}
@@ -1198,7 +1198,7 @@ mod tests {
1198
1198
let after_satisfied: Result < Vec < SatisfiedConstraint > , Error > = constraints. collect ( ) ;
1199
1199
assert_eq ! (
1200
1200
after_satisfied. unwrap( ) ,
1201
- vec![ SatisfiedConstraint :: AbsoluteTimelock { time : 1000 } ]
1201
+ vec![ SatisfiedConstraint :: AbsoluteTimelock { n : LockTime :: from ( 1000 ) } ]
1202
1202
) ;
1203
1203
1204
1204
//Check Older
0 commit comments