Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add count to expectCall cheatcodes #26

Merged
merged 1 commit into from
Apr 29, 2023
Merged
Changes from all 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
20 changes: 20 additions & 0 deletions src/Vm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -513,15 +513,35 @@ interface Vm is VmSafe {
/// Calldata can be either a strict or a partial match.
function expectCall(address callee, bytes calldata data) external;

/// @dev Expects given number of calls to an address with the specified calldata.
function expectCall(address callee, bytes calldata data, uint64 count) external;

/// @dev Expects a call to an address with the specified msg.value and calldata.
function expectCall(address callee, uint256 msgValue, bytes calldata data) external;

/// @dev Expects given number of calls to an address with the specified msg.value and calldata
function expectCall(address callee, uint256 msgValue, bytes calldata data, uint64 count) external;

/// @dev Expects a call to an address with the specified msg.value, gas, and calldata.
function expectCall(address callee, uint256 msgValue, uint64 gas, bytes calldata data) external;

/// @dev Expects given number of calls to an address with the specified msg.value, gas, and calldata.
function expectCall(address callee, uint256 msgValue, uint64 gas, bytes calldata data, uint64 count) external;

/// @dev Expects a call to an address with the specified msg.value and calldata, and a *minimum* amount of gas.
function expectCallMinGas(address callee, uint256 msgValue, uint64 minGas, bytes calldata data) external;

/// @dev Expect given number of calls to an address with the specified msg.value and calldata, and a *minimum*
/// amount of gas.
function expectCallMinGas(
address callee,
uint256 msgValue,
uint64 minGas,
bytes calldata data,
uint64 count
)
external;

/// @dev Prepare an expected log with all four checks enabled.
/// Call this function, then emit an event, then call a function. Internally after the call, we check if
/// logs were emitted in the expected order with the expected topics and data.
Expand Down