Skip to content

Commit

Permalink
fix: commenting & refund fee test
Browse files Browse the repository at this point in the history
  • Loading branch information
sujithsomraaj committed Sep 11, 2023
1 parent 7b969bf commit 0f7524b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/MultiMessageSender.sol
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ contract MultiMessageSender {
/// @param _target is the target execution point on dst chain
/// @param _callData is the data to be sent to _target by low-level call(eg. address(_target).call(_callData))
/// @param _nativeValue is the value to be sent to _target by low-level call (eg. address(_target).call{value: _nativeValue}(_callData))
/// @param _expiration is the validity of the calldata; before which it should be executed on the remote chain
/// @param _expiration refers to the number of days that a message remains valid before it is considered stale and can no longer be executed.
function remoteCall(
uint256 _dstChainId,
address _target,
Expand All @@ -133,7 +133,7 @@ contract MultiMessageSender {
/// @param _callData is the data to be sent to _target by low-level call(eg. address(_target).call(_callData))
/// @param _nativeValue is the value to be sent to _target by low-level call (eg. address(_target).call{value: _nativeValue}(_callData))
/// @param _excludedAdapters are the sender adapters to be excluded from relaying the message
/// @param _expiration is the validity of the calldata; before which it should be executed on the remote chain
/// @param _expiration refers to the number of days that a message remains valid before it is considered stale and can no longer be executed.
function remoteCall(
uint256 _dstChainId,
address _target,
Expand Down
3 changes: 1 addition & 2 deletions test/unit-tests/MultiMessageSender.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,12 @@ contract MultiMessageSenderTest is Setup {

uint256 expiration = block.timestamp + EXPIRATION_CONSTANT;

// NOTE: caller is also configured as the refund address in this test setup
uint256 balanceBefore = gac.getRefundAddress().balance;
sender.remoteCall{value: 2 ether}(DST_CHAIN_ID, address(42), bytes("42"), 0, expiration);

uint256 balanceAfter = gac.getRefundAddress().balance;
uint256 fee = sender.estimateTotalMessageFee(DST_CHAIN_ID, receiver, address(42), bytes("42"), 0);
assertGt(balanceAfter, balanceBefore);
assertEq(balanceAfter - balanceBefore, 2 ether - fee);
}

/// @dev perform remote call with an excluded adapter
Expand Down

0 comments on commit 0f7524b

Please sign in to comment.