Skip to content

Commit 220ecb0

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 38308c6 commit 220ecb0

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
@@ -1267,4 +1267,11 @@ mod tests {
12671267
let policy = Policy::<String>::from_str("or(and(pk(A),pk(B)),pk(C))").unwrap();
12681268
assert_eq!(policy.num_tap_leaves(), 2);
12691269
}
1270+
1271+
#[test]
1272+
#[should_panic]
1273+
fn check_timelocks() {
1274+
// This implicitly tests the check_timelocks API (has height and time locks).
1275+
let _ = Policy::<String>::from_str("and(after(10),after(500000000))").unwrap();
1276+
}
12701277
}

0 commit comments

Comments
 (0)