Skip to content

Commit

Permalink
chore: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sujithsomraaj committed Oct 9, 2023
1 parent b4df6ed commit 0a3501c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MultiBridgeMessageSender.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ contract MultiBridgeMessageSender {
function remoteCall(
uint256 _dstChainId,
address _target,
bytes memory _callData,
bytes calldata _callData,
uint256 _nativeValue,
uint256 _expiration,
address _refundAddress,
uint256[] memory _fees,
uint256[] calldata _fees,
uint256 _successThreshold,
address[] memory _excludedAdapters
) external payable onlyCaller validateExpiration(_expiration) {
Expand Down
20 changes: 20 additions & 0 deletions test/unit-tests/MultiBridgeMessageSender.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -812,4 +812,24 @@ contract MultiBridgeMessageSenderTest is Setup {
new address[](0)
);
}

function test_revert_for_invalid_success_threshold() public {
vm.startPrank(caller);

uint256 nativeValue = 2 ether;
uint256 invalidSuccessThrehsold = 10;

vm.expectRevert(Error.MULTI_MESSAGE_SEND_FAILED.selector);
sender.remoteCall{value: nativeValue}(
DST_CHAIN_ID,
address(42),
bytes("42"),
0,
EXPIRATION_CONSTANT,
refundAddress,
new uint256[](2),
invalidSuccessThrehsold,
new address[](0)
);
}
}

0 comments on commit 0a3501c

Please sign in to comment.