From 28cb203a1cc203296a0cbd18c8bd0f24b12b15ee Mon Sep 17 00:00:00 2001 From: Jay Paik Date: Mon, 22 Jan 2024 19:51:46 -0500 Subject: [PATCH] refactor: libraries/AccountStorageV1 -> account/AccountStorageV1 --- src/account/AccountLoupe.sol | 4 +--- src/account/AccountStorageInitializable.sol | 2 +- src/{libraries => account}/AccountStorageV1.sol | 0 src/account/PluginManagerInternals.sol | 4 +--- test/libraries/AccountStorage.t.sol | 6 ++++-- test/plugin/TokenReceiverPlugin.t.sol | 4 ++-- 6 files changed, 9 insertions(+), 11 deletions(-) rename src/{libraries => account}/AccountStorageV1.sol (100%) diff --git a/src/account/AccountLoupe.sol b/src/account/AccountLoupe.sol index ef67bcd3..2174c906 100644 --- a/src/account/AccountLoupe.sol +++ b/src/account/AccountLoupe.sol @@ -1,12 +1,10 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.22; +import {AccountStorageV1} from "../account/AccountStorageV1.sol"; import {KnownSelectors} from "../helpers/KnownSelectors.sol"; - import {IAccountLoupe} from "../interfaces/IAccountLoupe.sol"; import {FunctionReference} from "../interfaces/IPluginManager.sol"; - -import {AccountStorageV1} from "../libraries/AccountStorageV1.sol"; import {CastLib} from "../libraries/CastLib.sol"; import {CountableLinkedListSetLib} from "../libraries/CountableLinkedListSetLib.sol"; import {LinkedListSet, LinkedListSetLib} from "../libraries/LinkedListSetLib.sol"; diff --git a/src/account/AccountStorageInitializable.sol b/src/account/AccountStorageInitializable.sol index f57d3a8a..2230a989 100644 --- a/src/account/AccountStorageInitializable.sol +++ b/src/account/AccountStorageInitializable.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.22; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; -import {AccountStorageV1} from "../libraries/AccountStorageV1.sol"; +import {AccountStorageV1} from "../account/AccountStorageV1.sol"; /// @title Account Storage Initializable /// @author Alchemy diff --git a/src/libraries/AccountStorageV1.sol b/src/account/AccountStorageV1.sol similarity index 100% rename from src/libraries/AccountStorageV1.sol rename to src/account/AccountStorageV1.sol diff --git a/src/account/PluginManagerInternals.sol b/src/account/PluginManagerInternals.sol index b19cee5b..cba62402 100644 --- a/src/account/PluginManagerInternals.sol +++ b/src/account/PluginManagerInternals.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.22; import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; +import {AccountStorageV1} from "../account/AccountStorageV1.sol"; import {KnownSelectors} from "../helpers/KnownSelectors.sol"; - import { IPlugin, ManifestAssociatedFunction, @@ -15,8 +15,6 @@ import { PluginManifest } from "../interfaces/IPlugin.sol"; import {FunctionReference, IPluginManager} from "../interfaces/IPluginManager.sol"; - -import {AccountStorageV1} from "../libraries/AccountStorageV1.sol"; import {CastLib} from "../libraries/CastLib.sol"; import {CountableLinkedListSetLib} from "../libraries/CountableLinkedListSetLib.sol"; import {FunctionReferenceLib} from "../libraries/FunctionReferenceLib.sol"; diff --git a/test/libraries/AccountStorage.t.sol b/test/libraries/AccountStorage.t.sol index 16847ae7..33091a04 100644 --- a/test/libraries/AccountStorage.t.sol +++ b/test/libraries/AccountStorage.t.sol @@ -2,10 +2,12 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; -import {AccountStorageV1} from "../../src/libraries/AccountStorageV1.sol"; + +import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; + import {AccountStorageInitializable} from "../../src/account/AccountStorageInitializable.sol"; +import {AccountStorageV1} from "../../src/account/AccountStorageV1.sol"; import {MockDiamondStorageContract} from "../mocks/MockDiamondStorageContract.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; // Test implementation of AccountStorageInitializable which is contained in UpgradeableModularAccount contract AccountStorageTest is Test, AccountStorageV1 { diff --git a/test/plugin/TokenReceiverPlugin.t.sol b/test/plugin/TokenReceiverPlugin.t.sol index 22b38ca7..c9b1e656 100644 --- a/test/plugin/TokenReceiverPlugin.t.sol +++ b/test/plugin/TokenReceiverPlugin.t.sol @@ -10,12 +10,12 @@ import {ERC721PresetMinterPauserAutoId} from import {IERC777Recipient} from "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol"; import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; -import {TokenReceiverPlugin} from "../../src/plugins/TokenReceiverPlugin.sol"; +import {AccountStorageV1} from "../../src/account/AccountStorageV1.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; import {FunctionReference} from "../../src/interfaces/IPluginManager.sol"; -import {AccountStorageV1} from "../../src/libraries/AccountStorageV1.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; +import {TokenReceiverPlugin} from "../../src/plugins/TokenReceiverPlugin.sol"; import {MockERC777} from "../mocks/tokens/MockERC777.sol"; import {MockERC1155} from "../mocks/tokens/MockERC1155.sol";