Skip to content

Commit

Permalink
feat: add new fork cheatcodes (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
mds1 authored Sep 20, 2022
1 parent 340fe86 commit e68214f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Vm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,12 @@ interface Vm {
function createFork(string calldata,uint256) external returns(uint256);
// Creates a new fork with the given endpoint and the _latest_ block and returns the identifier of the fork
function createFork(string calldata) external returns(uint256);
// Creates a new fork with the given endpoint and at the block the given transaction was mined in, and replays all transaction mined in the block before the transaction
function createFork(string calldata, bytes32) external returns (uint256);
// Creates _and_ also selects a new fork with the given endpoint and block and returns the identifier of the fork
function createSelectFork(string calldata,uint256) external returns(uint256);
// Creates _and_ also selects new fork with the given endpoint and at the block the given transaction was mined in, and replays all transaction mined in the block before the transaction
function createSelectFork(string calldata, bytes32) external returns (uint256);
// Creates _and_ also selects a new fork with the given endpoint and the latest block and returns the identifier of the fork
function createSelectFork(string calldata) external returns(uint256);
// Takes a fork identifier created by `createFork` and sets the corresponding forked state as active.
Expand All @@ -184,8 +188,13 @@ interface Vm {
// Updates the currently active fork to given block number
// This is similar to `roll` but for the currently active fork
function rollFork(uint256) external;
// Updates the currently active fork to given transaction
// this will `rollFork` with the number of the block the transaction was mined it and replays all transaction mined before it in the block
function rollFork(bytes32) external;
// Updates the given fork to given block number
function rollFork(uint256 forkId, uint256 blockNumber) external;
// Updates the given fork to block number of the given transaction and replays all transaction mined before it in the block
function rollFork(uint256 forkId, bytes32 transaction) external;

// Marks that the account(s) should use persistent storage across fork swaps in a multifork setup
// Meaning, changes made to the state of this account will be kept when switching forks
Expand Down

0 comments on commit e68214f

Please sign in to comment.