diff --git a/packages/contracts-bedrock/scripts/checks/semver-natspec/main.go b/packages/contracts-bedrock/scripts/checks/semver-natspec/main.go index c6650d9bc2b7..7b290dd9a734 100644 --- a/packages/contracts-bedrock/scripts/checks/semver-natspec/main.go +++ b/packages/contracts-bedrock/scripts/checks/semver-natspec/main.go @@ -63,7 +63,6 @@ func run() error { artifactsDir := filepath.Join(cwd, "forge-artifacts") srcDir := filepath.Join(cwd, "src") - testDir := filepath.Join(cwd, "test") artifactFiles, err := glob(artifactsDir, ".json") if err != nil { @@ -73,10 +72,6 @@ func run() error { if err != nil { return fmt.Errorf("failed to get contract files: %w", err) } - testFiles, err := glob(testDir, ".sol") - if err != nil { - return fmt.Errorf("failed to get test files: %w", err) - } var hasErr int32 var outMtx sync.Mutex @@ -134,12 +129,13 @@ func run() error { return } - var contractPath string - if path, ok := contractFiles[contractName]; ok { - contractPath = path - } else if path, ok := testFiles[contractName]; ok { - contractPath = path - } else { + // Skip mock contracts + if strings.Contains(contractName, "_MockContract") { + return + } + + contractPath := contractFiles[contractName] + if contractPath == "" { fail("%s: Source file not found", contractName) return } diff --git a/packages/contracts-bedrock/test/L2/SuperchainERC20.t.sol b/packages/contracts-bedrock/test/L2/SuperchainERC20.t.sol index b4909bf26134..30b758a38e6d 100644 --- a/packages/contracts-bedrock/test/L2/SuperchainERC20.t.sol +++ b/packages/contracts-bedrock/test/L2/SuperchainERC20.t.sol @@ -18,7 +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"; -import { SuperchainERC20ImplementationMock } from "test/mocks/SuperchainERC20ImplementationMock.sol"; +import { SuperchainERC20Implementation_MockContract } from "test/mocks/SuperchainERC20Implementation.sol"; /// @title SuperchainERC20Test /// @notice Contract for testing the SuperchainERC20 contract. @@ -31,7 +31,7 @@ contract SuperchainERC20Test is Test { /// @notice Sets up the test suite. function setUp() public { - superchainERC20 = new SuperchainERC20ImplementationMock(); + superchainERC20 = new SuperchainERC20Implementation_MockContract(); } /// @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/SuperchainERC20Implementation.sol similarity index 81% rename from packages/contracts-bedrock/test/mocks/SuperchainERC20ImplementationMock.sol rename to packages/contracts-bedrock/test/mocks/SuperchainERC20Implementation.sol index c4eb67259e38..4f3dec45896c 100644 --- a/packages/contracts-bedrock/test/mocks/SuperchainERC20ImplementationMock.sol +++ b/packages/contracts-bedrock/test/mocks/SuperchainERC20Implementation.sol @@ -3,9 +3,9 @@ pragma solidity 0.8.25; import { SuperchainERC20 } from "src/L2/SuperchainERC20.sol"; -/// @title SuperchainERC20ImplementationMock +/// @title SuperchainERC20Implementation Mock contract /// @notice Mock contract just to create tests over an implementation of the SuperchainERC20 abstract contract. -contract SuperchainERC20ImplementationMock is SuperchainERC20 { +contract SuperchainERC20Implementation_MockContract is SuperchainERC20 { /// @notice Semantic version. /// @custom:semver 1.0.0-beta.1 string public constant override version = "1.0.0-beta.1";