Skip to main content

Module expected_emit

Module expected_emit 

Source
Expand description

Engine-free matching for the expectEmit cheatcodes.

Re-exportsΒ§

use crate::Error; πŸ”’
use alloy_dyn_abi::EventExt; πŸ”’
use alloy_primitives::Address; πŸ”’
use alloy_primitives::Bytes; πŸ”’
use alloy_primitives::Log; πŸ”’
use alloy_primitives::LogData as RawLog; πŸ”’
use alloy_primitives::hex; πŸ”’
use alloy_primitives::hex; πŸ”’
use alloy_primitives::map::HashMap; πŸ”’
use alloy_primitives::map::hash_map::Entry; πŸ”’
use alloy_sol_types::SolValue; πŸ”’
use foundry_common::abi::get_indexed_event; πŸ”’
use foundry_common::abi::reconstruct_event_params; πŸ”’
use foundry_common::fmt::format_token; πŸ”’
use foundry_evm_traces::DecodedCallLog; πŸ”’
use foundry_evm_traces::identifier::SignaturesIdentifier; πŸ”’
use std::collections::VecDeque; πŸ”’

StructsΒ§

ExpectedEmit
LogCountMap

EnumsΒ§

EmitMismatch
UnmetEmit πŸ”’
Why the tracked expected emits were not satisfied when a call ended.

FunctionsΒ§

check_call_emits πŸ”’
Checks the entire tracker when a non-static call ends at any tracked expectation’s depth.
checked_topic_count πŸ”’
checks_topics_and_data πŸ”’
decode_event πŸ”’
first_unmet_root_emit πŸ”’
Checks for leftover expected emits when the root call ends without reverting.
get_emit_mismatch_message πŸ”’
Gets a detailed mismatch message for emit assertions
name_mismatched_logs πŸ”’
Formats the generic mismatch message: β€œlog != expected log” to include event names if available
observe_log πŸ”’
Fills or checks the expected emits against an emitted log.

Type AliasesΒ§

ExpectedEmitTracker
Handles expected emits specified by the expectEmit cheatcodes.