-
Notifications
You must be signed in to change notification settings - Fork 465
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It would be nice to have this:
vm.expectAndMockCall(
inboxes_[0],
abi.encodeWithSelector(
MockERC20Inbox.sendContractTransaction.selector,
100_001,
1_000_000,
_appChainGateway,
0,
abi.encodeCall(IAppChainGatewayLike.receiveParameters, (0, keyChains_, values_))
),
abi.encode(uint256(11))
);instead of this:
vm.expectCall(
inboxes_[0],
abi.encodeWithSelector(
MockERC20Inbox.sendContractTransaction.selector,
100_000,
1_000_000,
_appChainGateway,
0,
abi.encodeCall(IAppChainGatewayLike.receiveParameters, (0, keyChains_, values_))
)
);
vm.mockCall(
inboxes_[0],
abi.encodeWithSelector(
MockERC20Inbox.sendContractTransaction.selector,
100_001,
1_000_000,
_appChainGateway,
0,
abi.encodeCall(IAppChainGatewayLike.receiveParameters, (0, keyChains_, values_))
),
abi.encode(uint256(11))
);Sure, we could make a helper function:
function _expectAndMockCall(address callee, bytes memory data, bytes memory returnData) internal {
vm.expectCall(callee, data);
vm.mockCall(callee, data, returnData);
}but forge-std is that helper tooling, so it probably makes sense that it lives there.
See this foundry issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request