Skip to main content

Module revert_handlers

Module revert_handlers 

Source

Re-exportsΒ§

use crate::Error; πŸ”’
use crate::Result; πŸ”’
use alloy_primitives::Address; πŸ”’
use alloy_primitives::Bytes; πŸ”’
use alloy_primitives::hex; πŸ”’
use alloy_primitives::hex; πŸ”’
use alloy_sol_types::SolError; πŸ”’
use alloy_sol_types::SolValue; πŸ”’
use foundry_common::ContractsByArtifact; πŸ”’
use foundry_evm_core::decode::RevertDecoder; πŸ”’
use revm::interpreter::InstructionResult; πŸ”’
use spec::Vm; πŸ”’
use super::assume::AcceptableRevertParameters; πŸ”’
use super::assume::AssumeNoRevert; πŸ”’
use super::expect::ExpectedRevert; πŸ”’

ConstantsΒ§

DUMMY_CREATE_ADDRESS πŸ”’
Same reasoning as DUMMY_CALL_OUTPUT, but for creates.

StaticsΒ§

DUMMY_CALL_OUTPUT πŸ”’
For some cheatcodes we may internally change the status of the call, i.e. in expectRevert. Solidity will see a successful call and attempt to decode the return data. Therefore, we need to populate the return with dummy bytes so the decode doesn’t fail.

TraitsΒ§

RevertParameters πŸ”’
Common parameters for expected or assumed reverts. Allows for code reuse.

FunctionsΒ§

decode_revert πŸ”’
handle_assume_no_revert πŸ”’
handle_expect_revert πŸ”’
handle_revert πŸ”’
Core logic for handling reverts that may or may not be expected (or assumed).
stringify πŸ”’