From af64f43a28832f73f90c70279078403d7ee6c6fd Mon Sep 17 00:00:00 2001 From: 0xIryna Date: Thu, 21 Nov 2024 08:23:27 -0800 Subject: [PATCH] chore: cleanup unused imports and variables --- src/HubPortal.sol | 4 ++-- src/SpokePortal.sol | 2 -- test/harnesses/SpokePortalHarness.sol | 9 --------- test/unit/Portal.t.sol | 3 +-- test/unit/SpokePortal.t.sol | 8 +++----- 5 files changed, 6 insertions(+), 20 deletions(-) delete mode 100644 test/harnesses/SpokePortalHarness.sol diff --git a/src/HubPortal.sol b/src/HubPortal.sol index b871541..00b15c2 100644 --- a/src/HubPortal.sol +++ b/src/HubPortal.sol @@ -145,7 +145,7 @@ contract HubPortal is IHubPortal, Portal { function _sendMessage( uint16 destinationChainId_, bytes32 refundAddress_, - uint64 _sequence, + uint64 sequence_, bytes memory payload_ ) private returns (bytes32 messageId_) { if (refundAddress_ == bytes32(0)) revert InvalidRefundAddress(); @@ -158,7 +158,7 @@ contract HubPortal is IHubPortal, Portal { ) = _prepareForTransfer(destinationChainId_, DEFAULT_TRANSCEIVER_INSTRUCTIONS); TransceiverStructs.NttManagerMessage memory message_ = TransceiverStructs.NttManagerMessage( - bytes32(uint256(_sequence)), + bytes32(uint256(sequence_)), msg.sender.toBytes32(), payload_ ); diff --git a/src/SpokePortal.sol b/src/SpokePortal.sol index 75f6629..263c2cd 100644 --- a/src/SpokePortal.sol +++ b/src/SpokePortal.sol @@ -2,9 +2,7 @@ pragma solidity 0.8.26; -import { IERC20 } from "../lib/common/src/interfaces/IERC20.sol"; import { UIntMath } from "../lib/common/src/libs/UIntMath.sol"; -import { IndexingMath } from "../lib/common/src/libs/IndexingMath.sol"; import { ISpokeMTokenLike } from "./interfaces/ISpokeMTokenLike.sol"; import { IRegistrarLike } from "./interfaces/IRegistrarLike.sol"; diff --git a/test/harnesses/SpokePortalHarness.sol b/test/harnesses/SpokePortalHarness.sol deleted file mode 100644 index 0fa8708..0000000 --- a/test/harnesses/SpokePortalHarness.sol +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity 0.8.26; - -import { SpokePortal } from "../../src/SpokePortal.sol"; - -contract SpokePortalHarness is SpokePortal { - constructor(address mToken_, address registrar_, uint16 chainId_) SpokePortal(mToken_, registrar_, chainId_) {} -} diff --git a/test/unit/Portal.t.sol b/test/unit/Portal.t.sol index 7e4230e..51ef005 100644 --- a/test/unit/Portal.t.sol +++ b/test/unit/Portal.t.sol @@ -131,10 +131,9 @@ contract PortalTests is UnitTestBase { function test_handleMsg_invalidFork() external { uint256 amount_ = 1_000e6; uint128 index_ = 0; - uint256 msgValue_ = 2; bytes32 recipient_ = _alice.toBytes32(); - (TransceiverStructs.NttManagerMessage memory message_, bytes32 messageId_) = _createTransferMessage( + (TransceiverStructs.NttManagerMessage memory message_, ) = _createTransferMessage( amount_, index_, recipient_, diff --git a/test/unit/SpokePortal.t.sol b/test/unit/SpokePortal.t.sol index 5bbd486..7e8bbad 100644 --- a/test/unit/SpokePortal.t.sol +++ b/test/unit/SpokePortal.t.sol @@ -12,8 +12,6 @@ import { SpokePortal } from "../../src/SpokePortal.sol"; import { PayloadEncoder } from "../../src/libs/PayloadEncoder.sol"; import { TypeConverter } from "../../src/libs/TypeConverter.sol"; -import { SpokePortalHarness } from "../harnesses/SpokePortalHarness.sol"; - import { UnitTestBase } from "./UnitTestBase.t.sol"; import { MockSpokeMToken } from "../mocks/MockSpokeMToken.sol"; import { MockSpokeRegistrar } from "../mocks/MockSpokeRegistrar.sol"; @@ -25,7 +23,7 @@ contract SpokePortalTests is UnitTestBase { MockSpokeMToken internal _mToken; MockSpokeRegistrar internal _registrar; - SpokePortalHarness internal _portal; + SpokePortal internal _portal; function setUp() external { _mToken = new MockSpokeMToken(); @@ -36,8 +34,8 @@ contract SpokePortalTests is UnitTestBase { _registrar = new MockSpokeRegistrar(); _transceiver = new MockTransceiver(); - SpokePortal implementation_ = new SpokePortalHarness(address(_mToken), address(_registrar), _LOCAL_CHAIN_ID); - _portal = SpokePortalHarness(_createProxy(address(implementation_))); + SpokePortal implementation_ = new SpokePortal(address(_mToken), address(_registrar), _LOCAL_CHAIN_ID); + _portal = SpokePortal(_createProxy(address(implementation_))); _initializePortal(_portal); }