Skip to content

Commit ffdd320

Browse files
authored
Merge pull request #120 from sanket1729/more_cltv_csv_fixes
More csv ctlv fixes
2 parents efd3321 + b0103a7 commit ffdd320

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/descriptor/satisfied_constraints.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ impl<'stack> Stack<'stack> {
871871
}
872872

873873
/// Helper function to evaluate a After Node. Takes no argument from stack
874-
/// `n CHECKSEQUENCEVERIFY 0NOTEQUAL` and `n CHECKSEQUENCEVERIFY`
874+
/// `n CHECKLOCKTIMEVERIFY 0NOTEQUAL` and `n CHECKLOCKTIMEVERIFY`
875875
/// Ideally this should return int value as n: build_scriptint(t as i64)),
876876
/// The reason we don't need to copy the Script semantics is that
877877
/// Miniscript never evaluates integers and it is safe to treat them as
@@ -883,14 +883,14 @@ impl<'stack> Stack<'stack> {
883883
) -> Option<Result<SatisfiedConstraint<'desc, 'stack>, Error>> {
884884
if age >= *n {
885885
self.push(StackElement::Satisfied);
886-
Some(Ok(SatisfiedConstraint::RelativeTimeLock { time: n }))
886+
Some(Ok(SatisfiedConstraint::AbsoluteTimeLock { time: n }))
887887
} else {
888888
Some(Err(Error::AbsoluteLocktimeNotMet(*n)))
889889
}
890890
}
891891

892892
/// Helper function to evaluate a Older Node. Takes no argument from stack
893-
/// `n CHECKLOCKTIMEVERIFY 0NOTEQUAL` and `n CHECKLOCKTIMEVERIFY`
893+
/// `n CHECKSEQUENCEVERIFY 0NOTEQUAL` and `n CHECKSEQUENCEVERIFY`
894894
/// Ideally this should return int value as n: build_scriptint(t as i64)),
895895
/// The reason we don't need to copy the Script semantics is that
896896
/// Miniscript never evaluates integers and it is safe to treat them as
@@ -902,7 +902,7 @@ impl<'stack> Stack<'stack> {
902902
) -> Option<Result<SatisfiedConstraint<'desc, 'stack>, Error>> {
903903
if height >= *n {
904904
self.push(StackElement::Satisfied);
905-
Some(Ok(SatisfiedConstraint::AbsoluteTimeLock { time: n }))
905+
Some(Ok(SatisfiedConstraint::RelativeTimeLock { time: n }))
906906
} else {
907907
Some(Err(Error::RelativeLocktimeNotMet(*n)))
908908
}
@@ -1183,7 +1183,7 @@ mod tests {
11831183
let after_satisfied: Result<Vec<SatisfiedConstraint>, Error> = constraints.collect();
11841184
assert_eq!(
11851185
after_satisfied.unwrap(),
1186-
vec![SatisfiedConstraint::RelativeTimeLock { time: &1000 }]
1186+
vec![SatisfiedConstraint::AbsoluteTimeLock { time: &1000 }]
11871187
);
11881188

11891189
//Check Older
@@ -1192,7 +1192,7 @@ mod tests {
11921192
let older_satisfied: Result<Vec<SatisfiedConstraint>, Error> = constraints.collect();
11931193
assert_eq!(
11941194
older_satisfied.unwrap(),
1195-
vec![SatisfiedConstraint::AbsoluteTimeLock { time: &1000 }]
1195+
vec![SatisfiedConstraint::RelativeTimeLock { time: &1000 }]
11961196
);
11971197

11981198
//Check Sha256

0 commit comments

Comments
 (0)