From 46728788ebef22db9facaf8c16c204eea42555b8 Mon Sep 17 00:00:00 2001 From: mohanson Date: Wed, 22 Jan 2025 14:28:10 +0800 Subject: [PATCH] Fix ci --- .../tests/ckb_latest/features_since_v2021.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/script/src/verify/tests/ckb_latest/features_since_v2021.rs b/script/src/verify/tests/ckb_latest/features_since_v2021.rs index 522cb732e2..4d274616fe 100644 --- a/script/src/verify/tests/ckb_latest/features_since_v2021.rs +++ b/script/src/verify/tests/ckb_latest/features_since_v2021.rs @@ -890,12 +890,17 @@ fn _check_typical_secp256k1_blake160_2_in_2_out_tx_with_state(step_cycles: Cycle #[test] fn check_typical_secp256k1_blake160_2_in_2_out_tx_with_state() { + let cycle_bound = if SCRIPT_VERSION >= ScriptVersion::V2 { + V2_CYCLE_BOUND + } else { + CYCLE_BOUND + }; if SCRIPT_VERSION >= ScriptVersion::V1 { let mut rng = thread_rng(); let step_cycles1 = rng.sample(Uniform::from(1..100u64)); _check_typical_secp256k1_blake160_2_in_2_out_tx_with_state(step_cycles1); - let step_cycles2 = rng.sample(Uniform::from(100u64..TWO_IN_TWO_OUT_CYCLES - CYCLE_BOUND)); + let step_cycles2 = rng.sample(Uniform::from(100u64..TWO_IN_TWO_OUT_CYCLES - cycle_bound)); _check_typical_secp256k1_blake160_2_in_2_out_tx_with_state(step_cycles2); } } @@ -977,13 +982,18 @@ fn _check_typical_secp256k1_blake160_2_in_2_out_tx_with_snap(step_cycles: Cycle) #[test] fn check_typical_secp256k1_blake160_2_in_2_out_tx_with_snap() { + let cycle_bound = if SCRIPT_VERSION >= ScriptVersion::V2 { + V2_CYCLE_BOUND + } else { + CYCLE_BOUND + }; if SCRIPT_VERSION >= ScriptVersion::V1 { let mut rng = thread_rng(); let step_cycles1 = rng.sample(Uniform::from(1..100u64)); _check_typical_secp256k1_blake160_2_in_2_out_tx_with_snap(step_cycles1); let step_cycles2 = rng.sample(Uniform::from( - TWO_IN_TWO_OUT_CYCLES / 10..TWO_IN_TWO_OUT_CYCLES - CYCLE_BOUND, + TWO_IN_TWO_OUT_CYCLES / 10..TWO_IN_TWO_OUT_CYCLES - cycle_bound, )); _check_typical_secp256k1_blake160_2_in_2_out_tx_with_snap(step_cycles2); }