fix: test in harness

This commit is contained in:
Roman 2026-06-05 18:55:53 +08:00
parent a8d0355b9f
commit fd95df7c6f
No known key found for this signature in database
GPG Key ID: 583BDF43C238B83E

View File

@ -255,8 +255,10 @@ fn assert_replay_rejection_panics_when_replay_not_rejected() {
// We do NOT apply the tx first. The state nonce is still 0, so calling
// execute_check_on_state would SUCCEED — making this a "successful replay".
// assert_replay_rejection is supposed to panic here (INVARIANT VIOLATION [ReplayRejection]).
// block_id=0 is the genesis block; transactions are only valid from block_id=1 onwards,
// so use (1, 0) to ensure execute_check_on_state accepts the tx (triggering the panic).
let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
assert_replay_rejection(tx, &mut state, 0, 0);
assert_replay_rejection(tx, &mut state, 1, 0);
}));
assert!(