[DEVEL] Add supplementary check in MockCCIPRouter
Hello, Congratulations for all your work ! The code is very clear to understand. A quick remark:
Description The function ccipSend in MockCCIPRouter doesn't check if:
-
msg.valueis enough to pay the fees in the case of using native tokens. - if
msg.value == 0if non native tokens are used
I think it could be a great improvement for automatic tests to add these checks in order to be closer to the true behavior of the router.
Basic Information Example:
function ccipSend( uint64 destinationChainSelector, Client.EVM2AnyMessage calldata message ) external payable returns (bytes32) { uint256 feeTokenAmount = getFee(destinationChainSelector, message); if (message.feeToken == address(0)) { if (msg.value < feeTokenAmount) revert InsufficientFeeTokenAmount(); } else{ if (msg.value > 0) revert InvalidMsgValue(); }
Thank you for the request. You can track progress on the issue at the following PR
https://github.com/smartcontractkit/ccip/pull/896
Great, thank you very much !
https://github.com/smartcontractkit/ccip/pull/896