From b67fcbaa9bfa82e6b11d75aa8e51178c6d231222 Mon Sep 17 00:00:00 2001 From: 0xDiscotech <131301107+0xDiscotech@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:53:14 -0300 Subject: [PATCH] chore: move the mock to another file --- .../test/L2/SuperchainERC20.t.sol | 17 ++--------------- .../SuperchainERC20ImplementationMock.sol | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 packages/contracts-bedrock/test/mocks/SuperchainERC20ImplementationMock.sol diff --git a/packages/contracts-bedrock/test/L2/SuperchainERC20.t.sol b/packages/contracts-bedrock/test/L2/SuperchainERC20.t.sol index 37aeead1181d..007472069525 100644 --- a/packages/contracts-bedrock/test/L2/SuperchainERC20.t.sol +++ b/packages/contracts-bedrock/test/L2/SuperchainERC20.t.sol @@ -18,20 +18,7 @@ import { BeaconProxy } from "@openzeppelin/contracts-v5/proxy/beacon/BeaconProxy // Target contract import { SuperchainERC20, ISuperchainERC20Extension } from "src/L2/SuperchainERC20.sol"; import { ISuperchainERC20Errors } from "src/L2/interfaces/ISuperchainERC20.sol"; - -contract SuperchainERC20Implementation is SuperchainERC20 { - /// @notice Semantic version. - /// @custom:semver 1.0.0-mock - string public constant override version = "1.0.0-mock"; - - function name() public pure override returns (string memory) { - return "SuperchainERC20"; - } - - function symbol() public pure override returns (string memory) { - return "SCE"; - } -} +import { SuperchainERC20ImplementationMock } from "test/mocks/SuperchainERC20ImplementationMock.sol"; /// @title SuperchainERC20Test /// @notice Contract for testing the SuperchainERC20 contract. @@ -44,7 +31,7 @@ contract SuperchainERC20Test is Test { /// @notice Sets up the test suite. function setUp() public { - superchainERC20 = new SuperchainERC20Implementation(); + superchainERC20 = new SuperchainERC20ImplementationMock(); } /// @notice Helper function to setup a mock and expect a call to it. diff --git a/packages/contracts-bedrock/test/mocks/SuperchainERC20ImplementationMock.sol b/packages/contracts-bedrock/test/mocks/SuperchainERC20ImplementationMock.sol new file mode 100644 index 000000000000..f630f6bc7943 --- /dev/null +++ b/packages/contracts-bedrock/test/mocks/SuperchainERC20ImplementationMock.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.25; + +import { SuperchainERC20 } from "src/L2/SuperchainERC20.sol"; + +/// @notice Mock contract just to create tests over an implementation of the SuperchainERC20 abstract contract. +contract SuperchainERC20ImplementationMock is SuperchainERC20 { + /// @notice Semantic version. + /// @custom:semver 1.0.0-beta + string public constant override version = "1.0.0-beta"; + + function name() public pure override returns (string memory) { + return "SuperchainERC20"; + } + + function symbol() public pure override returns (string memory) { + return "SCE"; + } +}