Skip to content

Commit

Permalink
fix: forge fmt MockCCIPRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejrakic committed Nov 18, 2024
1 parent 456fd79 commit 30a37ee
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions contracts/src/v0.8/ccip/test/mocks/MockRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,15 @@ contract MockCCIPRouter is IRouter, IRouterClient {
return mockMsgId;
}

function _fromBytes(bytes calldata extraArgs) internal pure returns (Client.EVMExtraArgsV2 memory) {
function _fromBytes(
bytes calldata extraArgs
) internal pure returns (Client.EVMExtraArgsV2 memory) {
if (extraArgs.length == 0) {
return Client.EVMExtraArgsV2({gasLimit: DEFAULT_GAS_LIMIT, allowOutOfOrderExecution: false});
}

bytes4 extraArgsTag = bytes4(extraArgs);

if (extraArgsTag == Client.EVM_EXTRA_ARGS_V2_TAG) {
return abi.decode(extraArgs[4:], (Client.EVMExtraArgsV2));
} else if (extraArgsTag == Client.EVM_EXTRA_ARGS_V1_TAG) {
Expand All @@ -136,12 +138,16 @@ contract MockCCIPRouter is IRouter, IRouterClient {
}

/// @notice Always returns true to make sure this check can be performed on any chain.
function isChainSupported(uint64) external pure returns (bool supported) {
function isChainSupported(
uint64
) external pure returns (bool supported) {
return true;
}

/// @notice Returns an empty array.
function getSupportedTokens(uint64) external pure returns (address[] memory tokens) {
function getSupportedTokens(
uint64
) external pure returns (address[] memory tokens) {
return new address[](0);
}

Expand All @@ -151,12 +157,16 @@ contract MockCCIPRouter is IRouter, IRouterClient {
}

/// @notice Sets the fees returned by getFee but is only checked when using native fee tokens
function setFee(uint256 feeAmount) external {
function setFee(
uint256 feeAmount
) external {
s_mockFeeTokenAmount = feeAmount;
}

/// @notice Always returns address(1234567890)
function getOnRamp(uint64 /* destChainSelector */ ) external pure returns (address onRampAddress) {
function getOnRamp(
uint64 /* destChainSelector */
) external pure returns (address onRampAddress) {
return address(1234567890);
}

Expand Down

0 comments on commit 30a37ee

Please sign in to comment.