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

[DEVEL] Add supplementary check in MockCCIPRouter #755

Closed
rya-sge opened this issue Apr 25, 2024 · 3 comments
Closed

[DEVEL] Add supplementary check in MockCCIPRouter #755

rya-sge opened this issue Apr 25, 2024 · 3 comments
Assignees

Comments

@rya-sge
Copy link

rya-sge commented Apr 25, 2024

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.value is enough to pay the fees in the case of using native tokens.
  • if msg.value == 0 if 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();
}

@jhweintraub
Copy link
Collaborator

jhweintraub commented May 8, 2024

Thank you for the request. You can track progress on the issue at the following PR

#896

@rya-sge
Copy link
Author

rya-sge commented May 13, 2024

Great, thank you very much !

@RensR
Copy link
Collaborator

RensR commented May 27, 2024

#896

@RensR RensR closed this as completed May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants