Skip to main content

check_sequence_value

Function check_sequence_value 

Source
pub fn check_sequence_value<FEN>(
    executor: Executor<FEN>,
    calls: &[BasicTxDetails],
    sequence: &[usize],
    test_address: Address,
    calldata: Bytes,
    fail_on_revert: bool,
    targets: &[Address],
) -> Result<Option<Signed<256, 4>>, Report>
where FEN: FoundryEvmNetwork,
Expand description

Executes a call sequence and returns the optimization value (int256) from the invariant function. Used during shrinking for optimization mode.

Returns None if the invariant call fails or doesn’t return a valid int256, or if the campaign would not have scored the sequence or would have failed the test: a kept call is rejected by vm.assume, fails an assertion, or fails its handler gate with fail_on_revert, or the last kept call fails its handler gate. Unlike check_sequence, this applies warp/roll from ALL calls (including removed ones).

targets are the campaign’s fuzz targets, whose failed() the handler gate checks under legacy assertions.