Skip to main content

Module decode

Module decode 

Source
Expand description

Various utilities to decode test results.

Re-exportsΒ§

use crate::abi::Vm; πŸ”’
use crate::abi::console; πŸ”’
use alloy_dyn_abi::JsonAbiExt; πŸ”’
use alloy_json_abi::Error; πŸ”’
use alloy_json_abi::JsonAbi; πŸ”’
use alloy_primitives::Log; πŸ”’
use alloy_primitives::Selector; πŸ”’
use alloy_primitives::hex; πŸ”’
use alloy_primitives::hex; πŸ”’
use alloy_primitives::map::HashMap; πŸ”’
use alloy_sol_types::ContractError::Revert; πŸ”’
use alloy_sol_types::RevertReason; πŸ”’
use alloy_sol_types::RevertReason::ContractError; πŸ”’
use alloy_sol_types::SolEventInterface; πŸ”’
use alloy_sol_types::SolInterface; πŸ”’
use alloy_sol_types::SolValue; πŸ”’
use foundry_common::SELECTOR_LEN; πŸ”’
use itertools::Itertools; πŸ”’
use revm::interpreter::InstructionResult; πŸ”’
use std::fmt; πŸ”’
use std::sync::OnceLock; πŸ”’

StructsΒ§

RevertDecoder
Decodes revert data.
SkipReason
A skip reason.

ConstantsΒ§

ASSERTION_FAILED_PREFIX
Prefix used by Foundry assertion helpers in user-visible failure messages.
EMPTY_REVERT_DATA
Stable user-facing fallback for empty revert payloads.

FunctionsΒ§

decode_as_non_empty_string πŸ”’
Helper function that decodes provided error as an ABI encoded or an ASCII string (if not empty).
decode_console_log
Decode a single log.
decode_console_logs
Decode a set of logs, only returning logs from DSTest logging events and Hardhat’s console.log
trimmed_hex πŸ”’