Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions crates/cheatcodes/assets/cheatcodes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/cheatcodes/spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ impl Cheatcodes<'static> {
Vm::Wallet::STRUCT.clone(),
Vm::FfiResult::STRUCT.clone(),
Vm::ChainInfo::STRUCT.clone(),
Vm::Chain::STRUCT.clone(),
Vm::AccountAccess::STRUCT.clone(),
Vm::StorageAccess::STRUCT.clone(),
Vm::Gas::STRUCT.clone(),
Expand Down
16 changes: 16 additions & 0 deletions crates/cheatcodes/spec/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,18 @@ interface Vm {
uint256 chainId;
}

/// Information about a blockchain.
struct Chain {
/// The chain name.
string name;
/// The chain's Chain ID.
uint256 chainId;
/// The chain's alias. (i.e. what gets specified in `foundry.toml`).
string chainAlias;
/// A default RPC endpoint for this chain.
string rpcUrl;
}

/// The storage accessed during an `AccountAccess`.
struct StorageAccess {
/// The account whose storage was accessed.
Expand Down Expand Up @@ -967,6 +979,10 @@ interface Vm {
#[cheatcode(group = Testing, safety = Safe)]
function rpcUrlStructs() external view returns (Rpc[] memory urls);

/// Returns a Chain struct for specific alias
#[cheatcode(group = Testing, safety = Safe)]
function getChain(string calldata chainAlias) external view returns (Chain memory chain);

/// Suspends execution of the main thread for `duration` milliseconds.
#[cheatcode(group = Testing, safety = Safe)]
function sleep(uint256 duration) external;
Expand Down
Loading
Loading