Skip to main content

Module assert

Module assert 

Source

Re-exportsยง

use crate::CheatcodesExecutor; ๐Ÿ”’
use crate::CheatsCtxt; ๐Ÿ”’
use crate::Result; ๐Ÿ”’
use alloy_primitives::Address; ๐Ÿ”’
use alloy_primitives::B256; ๐Ÿ”’
use alloy_primitives::Bytes; ๐Ÿ”’
use alloy_primitives::I256; ๐Ÿ”’
use alloy_primitives::U256; ๐Ÿ”’
use alloy_primitives::U512; ๐Ÿ”’
use alloy_primitives::keccak256; ๐Ÿ”’
use alloy_sol_types::SolCall; ๐Ÿ”’
use evm2::interpreter::InstrStop; ๐Ÿ”’
use evm2::interpreter::op; ๐Ÿ”’
use evm2::interpreter::opcode::OpCode; ๐Ÿ”’
use foundry_evm_core::abi::console::format_units_int; ๐Ÿ”’
use foundry_evm_core::abi::console::format_units_uint; ๐Ÿ”’
use foundry_evm_core::backend::GLOBAL_FAIL_SLOT; ๐Ÿ”’
use foundry_evm_core::constants::CHEATCODE_ADDRESS; ๐Ÿ”’
use foundry_evm_core::decode::ASSERTION_FAILED_PREFIX; ๐Ÿ”’
use foundry_evm_core::evm::FoundryEvmNetwork; ๐Ÿ”’
use foundry_evm_core::evm::InterpreterFor; ๐Ÿ”’
use foundry_evm_core::evm::MessageResultFor; ๐Ÿ”’
use itertools::Itertools; ๐Ÿ”’
use std::borrow::Cow; ๐Ÿ”’
use std::fmt; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use std::sync::atomic::AtomicBool; ๐Ÿ”’
use std::sync::atomic::Ordering; ๐Ÿ”’
use crate::Vm::*; ๐Ÿ”’

Macrosยง

impl_assertions ๐Ÿ”’
Implements crate::Cheatcode for pairs of cheatcodes.

Structsยง

ComparisonAssertionError ๐Ÿ”’
EqAbsAssertionError ๐Ÿ”’
EqRelAssertionFailure ๐Ÿ”’
FailureProvenance
Records where a call failed, cheaply enough to run during campaigns, so a replay of the same input can be checked to fail the same way, unlike its revert data, exit reason and gas, which other failure paths can reproduce.
FailureTrace
Records the failed assertions and frames of a call by value-independent call sites, so a minimizer can tell whether a smaller input fails the same way.
SiteFrame ๐Ÿ”’
Call site tracking of one executing frame.

Enumsยง

AssertionKind ๐Ÿ”’
EqRelAssertionError ๐Ÿ”’
EqRelDelta ๐Ÿ”’
FailureEvent ๐Ÿ”’
A failure recorded by FailureTrace.

Constantsยง

EQ_REL_DELTA_RESOLUTION ๐Ÿ”’

Functionsยง

assert_eq ๐Ÿ”’
assert_false ๐Ÿ”’
assert_ge ๐Ÿ”’
assert_gt ๐Ÿ”’
assert_le ๐Ÿ”’
assert_lt ๐Ÿ”’
assert_not_eq ๐Ÿ”’
assert_true ๐Ÿ”’
calc_delta_full ๐Ÿ”’
Calculates the relative delta for an absolute difference.
format_delta_percent ๐Ÿ”’
get_delta_int ๐Ÿ”’
handle_assertion_result ๐Ÿ”’
handle_assertion_result_mono ๐Ÿ”’
int_assert_approx_eq_abs ๐Ÿ”’
int_assert_approx_eq_rel ๐Ÿ”’
is_return_label ๐Ÿ”’
Returns whether value is the pc of a JUMPDEST right after a JUMP in code, as the return label of an internal function call is.
memory_end ๐Ÿ”’
Returns the end of the memory that opcode accesses with stack, whose top is last, or zero when it accesses none.
uint_assert_approx_eq_abs ๐Ÿ”’
uint_assert_approx_eq_rel ๐Ÿ”’

Type Aliasesยง

ComparisonResult ๐Ÿ”’