From acbb7f6fc57bcc1cdce2e0a8a3149085b147a663 Mon Sep 17 00:00:00 2001 From: JohnGuilding Date: Thu, 1 Aug 2024 11:21:53 +0100 Subject: [PATCH] Remove duplicate tests --- .../EmailRecoveryManager/addGuardian.t.sol | 67 ------------------- .../changeThreshold.t.sol | 51 -------------- .../EmailRecoveryManager/removeGuardian.t.sol | 57 ---------------- .../EmailRecoveryManager/setupGuardians.t.sol | 54 --------------- .../addGuardian.t.sol | 25 ++++++- .../changeThreshold.t.sol | 15 ++++- .../getGuardian.t.sol | 2 +- .../getGuardianConfig.t.sol | 0 .../removeAllGuardians.t.sol | 4 +- .../removeGuardian.t.sol | 22 +++++- .../setupGuardians.t.sol | 4 +- .../updateGuardianStatus.t.sol | 4 +- .../EmailRecoveryFactory/constructor.t.sol | 2 +- .../deployEmailRecoveryModule.t.sol | 2 +- .../constructor.t.sol | 2 +- .../deployUniversalEmailRecoveryModule.t.sol | 2 +- .../libraries/GuardianUtils/getGuardian.t.sol | 14 ---- 17 files changed, 66 insertions(+), 261 deletions(-) delete mode 100644 test/unit/EmailRecoveryManager/addGuardian.t.sol delete mode 100644 test/unit/EmailRecoveryManager/changeThreshold.t.sol delete mode 100644 test/unit/EmailRecoveryManager/removeGuardian.t.sol delete mode 100644 test/unit/EmailRecoveryManager/setupGuardians.t.sol rename test/unit/{libraries/GuardianUtils => GuardianManager}/addGuardian.t.sol (78%) rename test/unit/{libraries/GuardianUtils => GuardianManager}/changeThreshold.t.sol (81%) rename test/unit/{EmailRecoveryManager => GuardianManager}/getGuardian.t.sol (93%) rename test/unit/{EmailRecoveryManager => GuardianManager}/getGuardianConfig.t.sol (100%) rename test/unit/{libraries/GuardianUtils => GuardianManager}/removeAllGuardians.t.sol (92%) rename test/unit/{libraries/GuardianUtils => GuardianManager}/removeGuardian.t.sol (83%) rename test/unit/{libraries/GuardianUtils => GuardianManager}/setupGuardians.t.sol (98%) rename test/unit/{libraries/GuardianUtils => GuardianManager}/updateGuardianStatus.t.sol (97%) rename test/unit/{ => factories}/EmailRecoveryFactory/constructor.t.sol (96%) rename test/unit/{ => factories}/EmailRecoveryFactory/deployEmailRecoveryModule.t.sol (97%) rename test/unit/{ => factories}/EmailRecoveryUniversalFactory/constructor.t.sol (96%) rename test/unit/{ => factories}/EmailRecoveryUniversalFactory/deployUniversalEmailRecoveryModule.t.sol (97%) delete mode 100644 test/unit/libraries/GuardianUtils/getGuardian.t.sol diff --git a/test/unit/EmailRecoveryManager/addGuardian.t.sol b/test/unit/EmailRecoveryManager/addGuardian.t.sol deleted file mode 100644 index 7fe4d64f..00000000 --- a/test/unit/EmailRecoveryManager/addGuardian.t.sol +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.25; - -import { console2 } from "forge-std/console2.sol"; -import { ModuleKitHelpers } from "modulekit/ModuleKit.sol"; -import { MODULE_TYPE_EXECUTOR } from "modulekit/external/ERC7579.sol"; -import { UnitBase } from "../UnitBase.t.sol"; -import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol"; -import { GuardianManager } from "src/GuardianManager.sol"; -import { IGuardianManager } from "src/interfaces/IGuardianManager.sol"; -import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; - -contract EmailRecoveryManager_addGuardian_Test is UnitBase { - using ModuleKitHelpers for *; - - function setUp() public override { - super.setUp(); - } - - function test_AddGuardian_RevertWhen_AlreadyRecovering() public { - acceptGuardian(accountSalt1); - acceptGuardian(accountSalt2); - vm.warp(12 seconds); - handleRecovery(recoveryModuleAddress, calldataHash, accountSalt1); - - vm.startPrank(accountAddress); - vm.expectRevert(IGuardianManager.RecoveryInProcess.selector); - emailRecoveryModule.addGuardian(guardians[0], guardianWeights[0]); - } - - function test_AddGuardian_RevertWhen_SetupNotCalled() public { - vm.prank(accountAddress); - instance.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); - vm.stopPrank(); - - vm.startPrank(accountAddress); - vm.expectRevert(IGuardianManager.SetupNotCalled.selector); - emailRecoveryModule.addGuardian(guardians[0], guardianWeights[0]); - } - - function test_AddGuardian_AddGuardian_Succeeds() public { - address newGuardian = address(1); - uint256 newGuardianWeight = 1; - - uint256 expectedGuardianCount = guardians.length + 1; - uint256 expectedTotalWeight = totalWeight + newGuardianWeight; - uint256 expectedAcceptedWeight = 0; // no guardians accepted - uint256 expectedThreshold = threshold; // same threshold - - vm.startPrank(accountAddress); - vm.expectEmit(); - emit IGuardianManager.AddedGuardian(accountAddress, newGuardian, newGuardianWeight); // - emailRecoveryModule.addGuardian(newGuardian, newGuardianWeight); - - GuardianStorage memory guardianStorage = - emailRecoveryModule.getGuardian(accountAddress, newGuardian); - assertEq(uint256(guardianStorage.status), uint256(GuardianStatus.REQUESTED)); - assertEq(guardianStorage.weight, newGuardianWeight); - - IGuardianManager.GuardianConfig memory guardianConfig = - emailRecoveryModule.getGuardianConfig(accountAddress); - assertEq(guardianConfig.guardianCount, expectedGuardianCount); - assertEq(guardianConfig.totalWeight, expectedTotalWeight); - assertEq(guardianConfig.acceptedWeight, expectedAcceptedWeight); - assertEq(guardianConfig.threshold, expectedThreshold); - } -} diff --git a/test/unit/EmailRecoveryManager/changeThreshold.t.sol b/test/unit/EmailRecoveryManager/changeThreshold.t.sol deleted file mode 100644 index 9caec9f0..00000000 --- a/test/unit/EmailRecoveryManager/changeThreshold.t.sol +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.25; - -import { console2 } from "forge-std/console2.sol"; -import { UnitBase } from "../UnitBase.t.sol"; -import { IGuardianManager } from "src/interfaces/IGuardianManager.sol"; - -contract EmailRecoveryManager_changeThreshold_Test is UnitBase { - function setUp() public override { - super.setUp(); - } - - function test_RevertWhen_AlreadyRecovering() public { - acceptGuardian(accountSalt1); - acceptGuardian(accountSalt2); - vm.warp(12 seconds); - handleRecovery(recoveryModuleAddress, calldataHash, accountSalt1); - - vm.startPrank(accountAddress); - vm.expectRevert(IGuardianManager.RecoveryInProcess.selector); - emailRecoveryModule.changeThreshold(threshold); - } - - function test_ChangeThreshold_IncreaseThreshold() public { - uint256 newThreshold = threshold + 1; - - vm.startPrank(accountAddress); - vm.expectEmit(); - emit IGuardianManager.ChangedThreshold(accountAddress, newThreshold); - emailRecoveryModule.changeThreshold(newThreshold); - - IGuardianManager.GuardianConfig memory guardianConfig = - emailRecoveryModule.getGuardianConfig(accountAddress); - assertEq(guardianConfig.guardianCount, guardians.length); - assertEq(guardianConfig.threshold, newThreshold); - } - - function test_ChangeThreshold_DecreaseThreshold() public { - uint256 newThreshold = threshold - 1; - - vm.startPrank(accountAddress); - vm.expectEmit(); - emit IGuardianManager.ChangedThreshold(accountAddress, newThreshold); - emailRecoveryModule.changeThreshold(newThreshold); - - IGuardianManager.GuardianConfig memory guardianConfig = - emailRecoveryModule.getGuardianConfig(accountAddress); - assertEq(guardianConfig.guardianCount, guardians.length); - assertEq(guardianConfig.threshold, newThreshold); - } -} diff --git a/test/unit/EmailRecoveryManager/removeGuardian.t.sol b/test/unit/EmailRecoveryManager/removeGuardian.t.sol deleted file mode 100644 index 0f80cf57..00000000 --- a/test/unit/EmailRecoveryManager/removeGuardian.t.sol +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.25; - -import { console2 } from "forge-std/console2.sol"; - -import { UnitBase } from "../UnitBase.t.sol"; -import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; -import { IGuardianManager } from "src/interfaces/IGuardianManager.sol"; - -contract EmailRecoveryManager_removeGuardian_Test is UnitBase { - function setUp() public override { - super.setUp(); - } - - function test_RemoveGuardian_RevertWhen_AlreadyRecovering() public { - address guardian = guardian1; - - acceptGuardian(accountSalt1); - acceptGuardian(accountSalt2); - vm.warp(12 seconds); - handleRecovery(recoveryModuleAddress, calldataHash, accountSalt1); - - vm.startPrank(accountAddress); - vm.expectRevert(IGuardianManager.RecoveryInProcess.selector); - emailRecoveryModule.removeGuardian(guardian); - } - - function test_RemoveGuardian_Succeeds() public { - address guardian = guardian1; // guardian 1 weight is 1 - // threshold = 3 - // totalWeight = 4 - // weight = 1 - - // Fails if totalWeight - weight < threshold - // (totalWeight - weight == 4 - 1) = 3 - // (weight < threshold == 3 < 3) = succeeds - - acceptGuardian(accountSalt1); - - vm.startPrank(accountAddress); - vm.expectEmit(); - emit IGuardianManager.RemovedGuardian(accountAddress, guardian, guardianWeights[0]); - emailRecoveryModule.removeGuardian(guardian); - - GuardianStorage memory guardianStorage = - emailRecoveryModule.getGuardian(accountAddress, guardian); - assertEq(uint256(guardianStorage.status), uint256(GuardianStatus.NONE)); - assertEq(guardianStorage.weight, 0); - - IGuardianManager.GuardianConfig memory guardianConfig = - emailRecoveryModule.getGuardianConfig(accountAddress); - assertEq(guardianConfig.guardianCount, guardians.length - 1); - assertEq(guardianConfig.totalWeight, totalWeight - guardianWeights[0]); - assertEq(guardianConfig.acceptedWeight, 0); // 1 - 1 = 0 - assertEq(guardianConfig.threshold, threshold); - } -} diff --git a/test/unit/EmailRecoveryManager/setupGuardians.t.sol b/test/unit/EmailRecoveryManager/setupGuardians.t.sol deleted file mode 100644 index cf8be14b..00000000 --- a/test/unit/EmailRecoveryManager/setupGuardians.t.sol +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.25; - -import { console2 } from "forge-std/console2.sol"; -import { ModuleKitHelpers } from "modulekit/ModuleKit.sol"; -import { MODULE_TYPE_EXECUTOR } from "modulekit/external/ERC7579.sol"; -import { UnitBase } from "../UnitBase.t.sol"; -import { IGuardianManager } from "src/interfaces/IGuardianManager.sol"; -import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; - -contract EmailRecoveryManager_setupGuardians_Test is UnitBase { - using ModuleKitHelpers for *; - - function setUp() public override { - super.setUp(); - } - - function test_SetupGuardians_Succeeds() public { - uint256 expectedGuardianCount = guardians.length; - uint256 expectedTotalWeight = totalWeight; - uint256 expectedThreshold = threshold; - - vm.prank(accountAddress); - instance.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); - vm.stopPrank(); - - (uint256 guardianCount, uint256 totalWeight) = emailRecoveryModule.exposed_setupGuardians( - accountAddress, guardians, guardianWeights, threshold - ); - - GuardianStorage memory guardianStorage1 = - emailRecoveryModule.getGuardian(accountAddress, guardians[0]); - GuardianStorage memory guardianStorage2 = - emailRecoveryModule.getGuardian(accountAddress, guardians[1]); - GuardianStorage memory guardianStorage3 = - emailRecoveryModule.getGuardian(accountAddress, guardians[2]); - assertEq(uint256(guardianStorage1.status), uint256(GuardianStatus.REQUESTED)); - assertEq(guardianStorage1.weight, guardianWeights[0]); - assertEq(uint256(guardianStorage2.status), uint256(GuardianStatus.REQUESTED)); - assertEq(guardianStorage2.weight, guardianWeights[1]); - assertEq(uint256(guardianStorage3.status), uint256(GuardianStatus.REQUESTED)); - assertEq(guardianStorage3.weight, guardianWeights[2]); - - assertEq(guardianCount, expectedGuardianCount); - assertEq(totalWeight, expectedTotalWeight); - - IGuardianManager.GuardianConfig memory guardianConfig = - emailRecoveryModule.getGuardianConfig(accountAddress); - assertEq(guardianConfig.guardianCount, expectedGuardianCount); - assertEq(guardianConfig.totalWeight, expectedTotalWeight); - assertEq(guardianConfig.acceptedWeight, 0); // no guardians accepted - assertEq(guardianConfig.threshold, expectedThreshold); - } -} diff --git a/test/unit/libraries/GuardianUtils/addGuardian.t.sol b/test/unit/GuardianManager/addGuardian.t.sol similarity index 78% rename from test/unit/libraries/GuardianUtils/addGuardian.t.sol rename to test/unit/GuardianManager/addGuardian.t.sol index 9ab1eb79..31e24a3d 100644 --- a/test/unit/libraries/GuardianUtils/addGuardian.t.sol +++ b/test/unit/GuardianManager/addGuardian.t.sol @@ -4,17 +4,38 @@ pragma solidity ^0.8.25; import { console2 } from "forge-std/console2.sol"; import { ModuleKitHelpers } from "modulekit/ModuleKit.sol"; import { MODULE_TYPE_EXECUTOR } from "modulekit/external/ERC7579.sol"; -import { UnitBase } from "../../UnitBase.t.sol"; +import { UnitBase } from "../UnitBase.t.sol"; import { IGuardianManager } from "src/interfaces/IGuardianManager.sol"; import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; -contract GuardianUtils_addGuardian_Test is UnitBase { +contract GuardianManager_addGuardian_Test is UnitBase { using ModuleKitHelpers for *; function setUp() public override { super.setUp(); } + function test_AddGuardian_RevertWhen_AlreadyRecovering() public { + acceptGuardian(accountSalt1); + acceptGuardian(accountSalt2); + vm.warp(12 seconds); + handleRecovery(recoveryModuleAddress, calldataHash, accountSalt1); + + vm.startPrank(accountAddress); + vm.expectRevert(IGuardianManager.RecoveryInProcess.selector); + emailRecoveryModule.addGuardian(guardians[0], guardianWeights[0]); + } + + function test_AddGuardian_RevertWhen_SetupNotCalled() public { + vm.prank(accountAddress); + instance.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); + vm.stopPrank(); + + vm.startPrank(accountAddress); + vm.expectRevert(IGuardianManager.SetupNotCalled.selector); + emailRecoveryModule.addGuardian(guardians[0], guardianWeights[0]); + } + function test_AddGuardian_RevertWhen_InvalidGuardianAddress() public { address invalidGuardianAddress = address(0); diff --git a/test/unit/libraries/GuardianUtils/changeThreshold.t.sol b/test/unit/GuardianManager/changeThreshold.t.sol similarity index 81% rename from test/unit/libraries/GuardianUtils/changeThreshold.t.sol rename to test/unit/GuardianManager/changeThreshold.t.sol index 2ccb8cde..ff9f8c88 100644 --- a/test/unit/libraries/GuardianUtils/changeThreshold.t.sol +++ b/test/unit/GuardianManager/changeThreshold.t.sol @@ -2,14 +2,25 @@ pragma solidity ^0.8.25; import { console2 } from "forge-std/console2.sol"; -import { UnitBase } from "../../UnitBase.t.sol"; +import { UnitBase } from "../UnitBase.t.sol"; import { IGuardianManager } from "src/interfaces/IGuardianManager.sol"; -contract GuardianUtils_changeThreshold_Test is UnitBase { +contract GuardianManager_changeThreshold_Test is UnitBase { function setUp() public override { super.setUp(); } + function test_RevertWhen_AlreadyRecovering() public { + acceptGuardian(accountSalt1); + acceptGuardian(accountSalt2); + vm.warp(12 seconds); + handleRecovery(recoveryModuleAddress, calldataHash, accountSalt1); + + vm.startPrank(accountAddress); + vm.expectRevert(IGuardianManager.RecoveryInProcess.selector); + emailRecoveryModule.changeThreshold(threshold); + } + function test_RevertWhen_SetupNotCalled() public { vm.expectRevert(IGuardianManager.SetupNotCalled.selector); emailRecoveryModule.changeThreshold(threshold); diff --git a/test/unit/EmailRecoveryManager/getGuardian.t.sol b/test/unit/GuardianManager/getGuardian.t.sol similarity index 93% rename from test/unit/EmailRecoveryManager/getGuardian.t.sol rename to test/unit/GuardianManager/getGuardian.t.sol index 031772e6..41d9d410 100644 --- a/test/unit/EmailRecoveryManager/getGuardian.t.sol +++ b/test/unit/GuardianManager/getGuardian.t.sol @@ -5,7 +5,7 @@ import { console2 } from "forge-std/console2.sol"; import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; import { UnitBase } from "../UnitBase.t.sol"; -contract EmailRecoveryManager_getGuardian_Test is UnitBase { +contract GuardianManager_getGuardian_Test is UnitBase { address newGuardian = address(1); uint256 newGuardianWeight = 1; diff --git a/test/unit/EmailRecoveryManager/getGuardianConfig.t.sol b/test/unit/GuardianManager/getGuardianConfig.t.sol similarity index 100% rename from test/unit/EmailRecoveryManager/getGuardianConfig.t.sol rename to test/unit/GuardianManager/getGuardianConfig.t.sol diff --git a/test/unit/libraries/GuardianUtils/removeAllGuardians.t.sol b/test/unit/GuardianManager/removeAllGuardians.t.sol similarity index 92% rename from test/unit/libraries/GuardianUtils/removeAllGuardians.t.sol rename to test/unit/GuardianManager/removeAllGuardians.t.sol index 4ff1d5ac..21f70159 100644 --- a/test/unit/libraries/GuardianUtils/removeAllGuardians.t.sol +++ b/test/unit/GuardianManager/removeAllGuardians.t.sol @@ -2,14 +2,14 @@ pragma solidity ^0.8.25; import { console2 } from "forge-std/console2.sol"; -import { UnitBase } from "../../UnitBase.t.sol"; +import { UnitBase } from "../UnitBase.t.sol"; import { EnumerableGuardianMap, GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; -contract GuardianUtils_removeAllGuardians_Test is UnitBase { +contract GuardianManager_removeAllGuardians_Test is UnitBase { function setUp() public override { super.setUp(); } diff --git a/test/unit/libraries/GuardianUtils/removeGuardian.t.sol b/test/unit/GuardianManager/removeGuardian.t.sol similarity index 83% rename from test/unit/libraries/GuardianUtils/removeGuardian.t.sol rename to test/unit/GuardianManager/removeGuardian.t.sol index 6e39db8a..279d6c16 100644 --- a/test/unit/libraries/GuardianUtils/removeGuardian.t.sol +++ b/test/unit/GuardianManager/removeGuardian.t.sol @@ -3,15 +3,28 @@ pragma solidity ^0.8.25; import { console2 } from "forge-std/console2.sol"; -import { UnitBase } from "../../UnitBase.t.sol"; +import { UnitBase } from "../UnitBase.t.sol"; import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; import { IGuardianManager } from "src/interfaces/IGuardianManager.sol"; -contract GuardianUtils_removeGuardian_Test is UnitBase { +contract GuardianManager_removeGuardian_Test is UnitBase { function setUp() public override { super.setUp(); } + function test_RemoveGuardian_RevertWhen_AlreadyRecovering() public { + address guardian = guardian1; + + acceptGuardian(accountSalt1); + acceptGuardian(accountSalt2); + vm.warp(12 seconds); + handleRecovery(recoveryModuleAddress, calldataHash, accountSalt1); + + vm.startPrank(accountAddress); + vm.expectRevert(IGuardianManager.RecoveryInProcess.selector); + emailRecoveryModule.removeGuardian(guardian); + } + function test_RemoveGuardian_RevertWhen_AddressNotGuardianForAccount() public { address unauthorizedAccount = guardian1; @@ -54,6 +67,8 @@ contract GuardianUtils_removeGuardian_Test is UnitBase { // (weight < threshold == 3 < 3) = succeeds vm.startPrank(accountAddress); + vm.expectEmit(); + emit IGuardianManager.RemovedGuardian(accountAddress, guardian, guardianWeights[0]); emailRecoveryModule.removeGuardian(guardian); GuardianStorage memory guardianStorage = @@ -65,7 +80,8 @@ contract GuardianUtils_removeGuardian_Test is UnitBase { emailRecoveryModule.getGuardianConfig(accountAddress); assertEq(guardianConfig.guardianCount, guardians.length - 1); assertEq(guardianConfig.totalWeight, totalWeight - guardianWeights[0]); - assertEq(guardianConfig.acceptedWeight, 0); + + assertEq(guardianConfig.acceptedWeight, 0); // 1 - 1 = 0 assertEq(guardianConfig.threshold, threshold); } diff --git a/test/unit/libraries/GuardianUtils/setupGuardians.t.sol b/test/unit/GuardianManager/setupGuardians.t.sol similarity index 98% rename from test/unit/libraries/GuardianUtils/setupGuardians.t.sol rename to test/unit/GuardianManager/setupGuardians.t.sol index c71e6d36..b9f22cc8 100644 --- a/test/unit/libraries/GuardianUtils/setupGuardians.t.sol +++ b/test/unit/GuardianManager/setupGuardians.t.sol @@ -4,11 +4,11 @@ pragma solidity ^0.8.25; import { console2 } from "forge-std/console2.sol"; import { ModuleKitHelpers } from "modulekit/ModuleKit.sol"; import { MODULE_TYPE_EXECUTOR } from "modulekit/external/ERC7579.sol"; -import { UnitBase } from "../../UnitBase.t.sol"; +import { UnitBase } from "../UnitBase.t.sol"; import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; import { IGuardianManager } from "src/interfaces/IGuardianManager.sol"; -contract GuardianUtils_setupGuardians_Test is UnitBase { +contract GuardianManager_setupGuardians_Test is UnitBase { using ModuleKitHelpers for *; function setUp() public override { diff --git a/test/unit/libraries/GuardianUtils/updateGuardianStatus.t.sol b/test/unit/GuardianManager/updateGuardianStatus.t.sol similarity index 97% rename from test/unit/libraries/GuardianUtils/updateGuardianStatus.t.sol rename to test/unit/GuardianManager/updateGuardianStatus.t.sol index 4bfe79db..8a75bc58 100644 --- a/test/unit/libraries/GuardianUtils/updateGuardianStatus.t.sol +++ b/test/unit/GuardianManager/updateGuardianStatus.t.sol @@ -5,10 +5,10 @@ import { console2 } from "forge-std/console2.sol"; import { ModuleKitHelpers } from "modulekit/ModuleKit.sol"; import { MODULE_TYPE_EXECUTOR } from "modulekit/external/ERC7579.sol"; import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; -import { UnitBase } from "../../UnitBase.t.sol"; +import { UnitBase } from "../UnitBase.t.sol"; import { IGuardianManager } from "src/interfaces/IGuardianManager.sol"; -contract GuardianUtils_updateGuardianStatus_Test is UnitBase { +contract GuardianManager_updateGuardianStatus_Test is UnitBase { using ModuleKitHelpers for *; function setUp() public override { diff --git a/test/unit/EmailRecoveryFactory/constructor.t.sol b/test/unit/factories/EmailRecoveryFactory/constructor.t.sol similarity index 96% rename from test/unit/EmailRecoveryFactory/constructor.t.sol rename to test/unit/factories/EmailRecoveryFactory/constructor.t.sol index 59dd094b..383750e2 100644 --- a/test/unit/EmailRecoveryFactory/constructor.t.sol +++ b/test/unit/factories/EmailRecoveryFactory/constructor.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.25; import { console2 } from "forge-std/console2.sol"; -import { UnitBase } from "../UnitBase.t.sol"; +import { UnitBase } from "../../UnitBase.t.sol"; import { EmailRecoveryFactory } from "src/factories/EmailRecoveryFactory.sol"; contract EmailRecoveryFactory_constructor_Test is UnitBase { diff --git a/test/unit/EmailRecoveryFactory/deployEmailRecoveryModule.t.sol b/test/unit/factories/EmailRecoveryFactory/deployEmailRecoveryModule.t.sol similarity index 97% rename from test/unit/EmailRecoveryFactory/deployEmailRecoveryModule.t.sol rename to test/unit/factories/EmailRecoveryFactory/deployEmailRecoveryModule.t.sol index bafa36a3..fb2052e9 100644 --- a/test/unit/EmailRecoveryFactory/deployEmailRecoveryModule.t.sol +++ b/test/unit/factories/EmailRecoveryFactory/deployEmailRecoveryModule.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.25; import { console2 } from "forge-std/console2.sol"; import { Create2 } from "@openzeppelin/contracts/utils/Create2.sol"; -import { UnitBase } from "../UnitBase.t.sol"; +import { UnitBase } from "../../UnitBase.t.sol"; import { EmailRecoveryFactory } from "src/factories/EmailRecoveryFactory.sol"; import { EmailRecoveryUniversalFactory } from "src/factories/EmailRecoveryUniversalFactory.sol"; import { EmailRecoverySubjectHandler } from "src/handlers/EmailRecoverySubjectHandler.sol"; diff --git a/test/unit/EmailRecoveryUniversalFactory/constructor.t.sol b/test/unit/factories/EmailRecoveryUniversalFactory/constructor.t.sol similarity index 96% rename from test/unit/EmailRecoveryUniversalFactory/constructor.t.sol rename to test/unit/factories/EmailRecoveryUniversalFactory/constructor.t.sol index 93396fec..d22b47b6 100644 --- a/test/unit/EmailRecoveryUniversalFactory/constructor.t.sol +++ b/test/unit/factories/EmailRecoveryUniversalFactory/constructor.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.25; import { console2 } from "forge-std/console2.sol"; -import { UnitBase } from "../UnitBase.t.sol"; +import { UnitBase } from "../../UnitBase.t.sol"; import { EmailRecoveryUniversalFactory } from "src/factories/EmailRecoveryUniversalFactory.sol"; contract EmailRecoveryUniversalFactory_constructor_Test is UnitBase { diff --git a/test/unit/EmailRecoveryUniversalFactory/deployUniversalEmailRecoveryModule.t.sol b/test/unit/factories/EmailRecoveryUniversalFactory/deployUniversalEmailRecoveryModule.t.sol similarity index 97% rename from test/unit/EmailRecoveryUniversalFactory/deployUniversalEmailRecoveryModule.t.sol rename to test/unit/factories/EmailRecoveryUniversalFactory/deployUniversalEmailRecoveryModule.t.sol index 38aa29b4..b899e508 100644 --- a/test/unit/EmailRecoveryUniversalFactory/deployUniversalEmailRecoveryModule.t.sol +++ b/test/unit/factories/EmailRecoveryUniversalFactory/deployUniversalEmailRecoveryModule.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.25; import { console2 } from "forge-std/console2.sol"; import { Create2 } from "@openzeppelin/contracts/utils/Create2.sol"; -import { UnitBase } from "../UnitBase.t.sol"; +import { UnitBase } from "../../UnitBase.t.sol"; import { EmailRecoveryFactory } from "src/factories/EmailRecoveryFactory.sol"; import { EmailRecoveryUniversalFactory } from "src/factories/EmailRecoveryUniversalFactory.sol"; import { EmailRecoverySubjectHandler } from "src/handlers/EmailRecoverySubjectHandler.sol"; diff --git a/test/unit/libraries/GuardianUtils/getGuardian.t.sol b/test/unit/libraries/GuardianUtils/getGuardian.t.sol deleted file mode 100644 index abb537a5..00000000 --- a/test/unit/libraries/GuardianUtils/getGuardian.t.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.25; - -import { console2 } from "forge-std/console2.sol"; -import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; -import { UnitBase } from "../../UnitBase.t.sol"; - -contract GuardianUtils_getGuardian_Test is UnitBase { - function setUp() public override { - super.setUp(); - } - - function test_GetGuardian_Succeeds() public { } -}