foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.34k stars 1.77k forks source link

feat(`cheatcodes`): mockCall with bytes4 data #9267

Closed yash-atreya closed 2 weeks ago

yash-atreya commented 2 weeks ago

Motivation

Closes #9213

Solution

zerosnacks commented 2 weeks ago

I checked again the ticket and I think we got this wrong when discussed action, looks like the proposal is just to add 2 more sigs to make UX better but keep existings @zerosnacks could you also double check please

function mockCall(address where, bytes4 data, bytes calldata retdata) external;

function mockCall(
    address where,
    uint256 value,
    bytes4 data,
    bytes calldata retdata
) external;

You are correct, this should be additive - not deprecating the current implementation

grandizzy commented 2 weeks ago

looks good, I'll push a change to make the same for vm.mockCallRevert sigs and then merge if OK with you @yash-atreya

smartcontracts commented 2 weeks ago

Woot, thank you all!