Skip to main content

Module snapshot

Module snapshot 

Source

Re-exportsยง

use super::test; ๐Ÿ”’
use crate::result::SuiteTestResult; ๐Ÿ”’
use crate::result::TestKindReport; ๐Ÿ”’
use crate::result::TestOutcome; ๐Ÿ”’
use alloy_primitives::U256; ๐Ÿ”’
use alloy_primitives::map::HashMap; ๐Ÿ”’
use clap::Parser; ๐Ÿ”’
use clap::ValueHint; ๐Ÿ”’
use clap::builder::RangedU64ValueParser; ๐Ÿ”’
use comfy_table::Cell; ๐Ÿ”’
use comfy_table::Color; ๐Ÿ”’
use comfy_table::Row; ๐Ÿ”’
use comfy_table::Table; ๐Ÿ”’
use comfy_table::presets::ASCII_FULL; ๐Ÿ”’
use comfy_table::presets::ASCII_MARKDOWN; ๐Ÿ”’
use eyre::Context; ๐Ÿ”’
use eyre::Result; ๐Ÿ”’
use foundry_cli::utils::STATIC_FUZZ_SEED; ๐Ÿ”’
use foundry_common::shell; ๐Ÿ”’
use regex::Regex; ๐Ÿ”’
use std::cmp::Ordering; ๐Ÿ”’
use std::fs; ๐Ÿ”’
use std::io; ๐Ÿ”’
use std::io::BufRead; ๐Ÿ”’
use std::path::Path; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’
use std::str::FromStr; ๐Ÿ”’
use std::sync::LazyLock; ๐Ÿ”’
use yansi::Paint; ๐Ÿ”’

Structsยง

GasSnapshotArgs
CLI arguments for forge snapshot.
GasSnapshotConfig ๐Ÿ”’
Additional filters that can be applied on the test results
GasSnapshotDiff
A Gas snapshot entry diff.
GasSnapshotEntry
A general entry in a gas snapshot file

Enumsยง

DiffSortOrder ๐Ÿ”’
Sort order for diff output
Format

Staticsยง

RE_BASIC_SNAPSHOT_ENTRY
A regex that matches a basic snapshot entry like Test:testDeposit() (gas: 58804)

Functionsยง

build_gas_snapshot_table ๐Ÿ”’
check ๐Ÿ”’
Compares the set of tests with an existing gas snapshot.
diff ๐Ÿ”’
Compare the set of tests with an existing gas snapshot.
expand_invariant_snapshot_entries ๐Ÿ”’
Expands merged invariant campaigns into per-predicate gas snapshot rows.
fmt_change ๐Ÿ”’
fmt_pct_change ๐Ÿ”’
parse_snapshot_value ๐Ÿ”’
read_gas_snapshot ๐Ÿ”’
Reads a list of gas snapshot entries from a gas snapshot file.
within_tolerance ๐Ÿ”’
Returns true of the difference between the gas values exceeds the tolerance
write_to_gas_snapshot_file ๐Ÿ”’
Writes a series of tests to a gas snapshot file after sorting them.