From 6dd3f14386fbf096c3f78ea6679cc54fc988b89a Mon Sep 17 00:00:00 2001 From: Frederik Gartenmeister Date: Tue, 23 Jul 2024 17:32:06 +0200 Subject: [PATCH] fix: lints --- test/integration/LocalAdapter.sol | 1 + test/integration/PassthroughAdapter.s.sol | 10 +++++----- test/integration/PassthroughAdapter.sol | 10 ++++------ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/test/integration/LocalAdapter.sol b/test/integration/LocalAdapter.sol index 47a0e94a..cfb949df 100644 --- a/test/integration/LocalAdapter.sol +++ b/test/integration/LocalAdapter.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.26; import {Auth} from "./../../src/Auth.sol"; + interface PrecompileLike { function execute( bytes32 commandId, diff --git a/test/integration/PassthroughAdapter.s.sol b/test/integration/PassthroughAdapter.s.sol index afd8598c..aec4cf70 100644 --- a/test/integration/PassthroughAdapter.s.sol +++ b/test/integration/PassthroughAdapter.s.sol @@ -25,19 +25,19 @@ contract PassthroughAdapterScript is Deployer { vm.stopBroadcast(); } - function toString(address account) public pure returns(string memory) { + function toString(address account) public pure returns (string memory) { return toString(abi.encodePacked(account)); } - function toString(bytes memory data) public pure returns(string memory) { + function toString(bytes memory data) public pure returns (string memory) { bytes memory alphabet = "0123456789abcdef"; bytes memory str = new bytes(2 + data.length * 2); str[0] = "0"; str[1] = "x"; - for (uint i = 0; i < data.length; i++) { - str[2+i*2] = alphabet[uint(uint8(data[i] >> 4))]; - str[3+i*2] = alphabet[uint(uint8(data[i] & 0x0f))]; + for (uint256 i = 0; i < data.length; i++) { + str[2 + i * 2] = alphabet[uint256(uint8(data[i] >> 4))]; + str[3 + i * 2] = alphabet[uint256(uint8(data[i] & 0x0f))]; } return string(str); } diff --git a/test/integration/PassthroughAdapter.sol b/test/integration/PassthroughAdapter.sol index 17d33ecc..2dcf3270 100644 --- a/test/integration/PassthroughAdapter.sol +++ b/test/integration/PassthroughAdapter.sol @@ -77,7 +77,7 @@ contract PassthroughAdapter is Auth { /// @notice Execute message on centrifuge function executeOnCentrifuge(string calldata _sourceChain, string calldata _sourceAddress, bytes calldata payload) - external + external { PrecompileLike precompile = PrecompileLike(PRECOMPILE); precompile.execute(FAKE_COMMAND_ID, _sourceChain, _sourceAddress, payload); @@ -86,11 +86,9 @@ contract PassthroughAdapter is Auth { } /// @notice Execute message on other domain - function executeOnDomain( - string calldata _sourceChain, - string calldata _sourceAddress, - bytes calldata payload - ) external { + function executeOnDomain(string calldata _sourceChain, string calldata _sourceAddress, bytes calldata payload) + external + { gateway.handle(payload); emit ExecuteOnDomain(_sourceChain, _sourceAddress, payload); }