Skip to content

Commit 1cbc018

Browse files
committed
Add unit test for check_timelocks API
Add a unit test that attempts to parse a `concrete::Policy` with both absolute height and time locks. Done in preparation for patching `check_timelocks_helper`.
1 parent 64488d6 commit 1cbc018

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/policy/concrete.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,4 +1241,11 @@ mod tests {
12411241
let policy = Policy::<String>::from_str("or(and(pk(A),pk(B)),pk(C))").unwrap();
12421242
assert_eq!(policy.num_tap_leaves(), 2);
12431243
}
1244+
1245+
#[test]
1246+
#[should_panic]
1247+
fn check_timelocks() {
1248+
// This implicitly tests the check_timelocks API (has height and time locks).
1249+
let _ = Policy::<String>::from_str("and(after(10),after(500000000))").unwrap();
1250+
}
12441251
}

0 commit comments

Comments
 (0)