INNER CODE UNIT · Rust
handle_expect_emit
fuzzland/ityfuzz · src/evm/middlewares/cheatcode/mod.rs:620
fn handle_expect_emit(
expected_emits: &mut VecDeque<ExpectedEmit>,
address: &Address,
topics: &[B256],
data: &AlloyBytes,
) {
if expected_emits.iter().all(|expected| expected.found) {
return;
}
// if there's anything to fill, we need to pop back.
// Otherwise, if there are any events that are unmatched, we try to match to
// match them in the order declared, so we start popping from the front
// (like a queue).
let mut event_to_fill_or_check = if expected_emits.iter().any(|expected| expected.log.is_none()) {
expected_emits.pop_back()
} else {
expected_emits.pop_front()