-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(cheatcodes
): mockCall with bytes4 data
#9267
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
looks good, I'll push a change to make the same for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation LGTM, small note regarding name of never mind, this is OKbytes4 data
Woot, thank you all! |
Ref: foundry-rs/foundry#9267 Adds the following overloads for `vm.mockCall`. ```solidity function mockCall(address callee, bytes4 data, bytes calldata returnData) external; function mockCall(address callee, uint256 msgValue, bytes4 data, bytes calldata returnData) external; function mockCallRevert(address callee, uint256 msgValue, bytes4 data, bytes calldata revertData) external; function mockCallRevert(address callee, bytes4 data, bytes calldata revertData) external; ```
* feat(`cheatcodes`): mockCall with bytes4 * fix * fix
Ref: foundry-rs/foundry#9267 Adds the following overloads for `vm.mockCall`. ```solidity function mockCall(address callee, bytes4 data, bytes calldata returnData) external; function mockCall(address callee, uint256 msgValue, bytes4 data, bytes calldata returnData) external; function mockCallRevert(address callee, uint256 msgValue, bytes4 data, bytes calldata revertData) external; function mockCallRevert(address callee, bytes4 data, bytes calldata revertData) external; ```
Motivation
Closes #9213
Solution
bytes4 data
arg to pass the selector liketoken.balanceOf.selector
instead ofabi.encodeWithSelector