Skip to content

Commit

Permalink
Add checkers for cycles and binary size
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Aug 1, 2024
1 parent f5da627 commit 74355f4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion tests/src/test_btc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ fn test_success() {
let tx_resolved =
ckb_types::core::cell::resolve_transaction(tx, &mut std::collections::HashSet::new(), &dl, &dl).unwrap();
let verifier = Verifier::default();
verifier.verify(&tx_resolved, &dl).unwrap();
let cycles = verifier.verify(&tx_resolved, &dl).unwrap();
assert!(cycles <= 4718592);
}

#[test]
Expand Down Expand Up @@ -255,3 +256,8 @@ fn test_success_e2e() {
let verifier = Verifier::default();
verifier.verify(&tx_resolved, &dl).unwrap();
}

#[test]
fn test_check_size() {
assert!(BINARY_CCC_LOCK_BTC.len() <= 150 * 1024);
}
8 changes: 7 additions & 1 deletion tests/src/test_eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ fn test_success() {
let tx_resolved =
ckb_types::core::cell::resolve_transaction(tx, &mut std::collections::HashSet::new(), &dl, &dl).unwrap();
let verifier = Verifier::default();
verifier.verify(&tx_resolved, &dl).unwrap();
let cycles = verifier.verify(&tx_resolved, &dl).unwrap();
assert!(cycles <= 4718592);
}

#[test]
Expand Down Expand Up @@ -235,3 +236,8 @@ fn test_success_e2e() {
let verifier = Verifier::default();
verifier.verify(&tx_resolved, &dl).unwrap();
}

#[test]
fn test_check_size() {
assert!(BINARY_CCC_LOCK_ETH.len() <= 150 * 1024);
}
8 changes: 7 additions & 1 deletion tests/src/test_sol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ fn test_success() {
let tx_resolved =
ckb_types::core::cell::resolve_transaction(tx, &mut std::collections::HashSet::new(), &dl, &dl).unwrap();
let verifier = Verifier::default();
verifier.verify(&tx_resolved, &dl).unwrap();
let cycles = verifier.verify(&tx_resolved, &dl).unwrap();
assert!(cycles <= 2621440);
}

#[test]
Expand Down Expand Up @@ -177,3 +178,8 @@ fn test_success_e2e() {
let verifier = Verifier::default();
verifier.verify(&tx_resolved, &dl).unwrap();
}

#[test]
fn test_check_size() {
assert!(BINARY_CCC_LOCK_SOL.len() <= 100 * 1024);
}

0 comments on commit 74355f4

Please sign in to comment.