diff --git a/src/interfaces/IEmailAuth.sol b/src/interfaces/IEmailAuth.sol deleted file mode 100644 index 2d521acb..00000000 --- a/src/interfaces/IEmailAuth.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.25; - -interface IEmailAuth { - function updateDKIMRegistry(address dkimRegistryAddr) external; - function updateVerifier(address verifierAddr) external; - function updateSubjectTemplate(uint256 templateId, string[] memory subjectTemplate) external; - function deleteSubjectTemplate(uint256 templateId) external; - function setTimestampCheckEnabled(bool enabled) external; -} diff --git a/src/interfaces/IUUPSUpgradable.sol b/src/interfaces/IUUPSUpgradable.sol deleted file mode 100644 index e0e722b8..00000000 --- a/src/interfaces/IUUPSUpgradable.sol +++ /dev/null @@ -1,6 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.25; - -interface IUUPSUpgradable { - function upgradeToAndCall(address newImplementation, bytes memory data) external payable; -} diff --git a/test/unit/EmailRecoveryFactory/deployModuleAndManager.t.sol b/test/unit/EmailRecoveryFactory/deployModuleAndManager.t.sol new file mode 100644 index 00000000..7cb82cf3 --- /dev/null +++ b/test/unit/EmailRecoveryFactory/deployModuleAndManager.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import "forge-std/console2.sol"; +import { UnitBase } from "../UnitBase.t.sol"; + +contract EmailRecoveryManager_deployModuleAndManager_Test is UnitBase { + function setUp() public override { + super.setUp(); + } + + function test_DeployModuleAndManager_Succeeds() public { } +} diff --git a/test/unit/EmailRecoveryManager/configureRecovery.t.sol b/test/unit/EmailRecoveryManager/configureRecovery.t.sol index 5c556a1d..aff126de 100644 --- a/test/unit/EmailRecoveryManager/configureRecovery.t.sol +++ b/test/unit/EmailRecoveryManager/configureRecovery.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.25; import "forge-std/console2.sol"; -import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol"; +import { ModuleKitHelpers } from "modulekit/ModuleKit.sol"; import { MODULE_TYPE_EXECUTOR } from "modulekit/external/ERC7579.sol"; import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol"; import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol"; @@ -10,9 +10,8 @@ import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardia import { UnitBase } from "../UnitBase.t.sol"; import { IModule } from "erc7579/interfaces/IERC7579Module.sol"; -contract ZkEmailRecovery_configureRecovery_Test is UnitBase { +contract EmailRecoveryManager_configureRecovery_Test is UnitBase { using ModuleKitHelpers for *; - using ModuleKitUserOp for *; function setUp() public override { super.setUp(); diff --git a/test/unit/EmailRecoveryManager/extractRecoveredAccountFromAcceptanceSubject.t.sol b/test/unit/EmailRecoveryManager/extractRecoveredAccountFromAcceptanceSubject.t.sol new file mode 100644 index 00000000..f839f40e --- /dev/null +++ b/test/unit/EmailRecoveryManager/extractRecoveredAccountFromAcceptanceSubject.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import "forge-std/console2.sol"; +import { UnitBase } from "../UnitBase.t.sol"; + +contract EmailRecoveryManager_extractRecoveredAccountFromAcceptanceSubject_Test is UnitBase { + function setUp() public override { + super.setUp(); + } + + function test_ExtractRecoveredAccountFromAcceptanceSubject_Succeeds() public view { } +} diff --git a/test/unit/EmailRecoveryManager/extractRecoveredAccountFromRecoverySubject.t.sol b/test/unit/EmailRecoveryManager/extractRecoveredAccountFromRecoverySubject.t.sol new file mode 100644 index 00000000..9515857d --- /dev/null +++ b/test/unit/EmailRecoveryManager/extractRecoveredAccountFromRecoverySubject.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import "forge-std/console2.sol"; +import { UnitBase } from "../UnitBase.t.sol"; + +contract EmailRecoveryManager_extractRecoveredAccountFromRecoverySubject_Test is UnitBase { + function setUp() public override { + super.setUp(); + } + + function test_ExtractRecoveredAccountFromRecoverySubject_Succeeds() public view { } +} diff --git a/test/unit/EmailRecoveryManager/getRecoveryConfig.t.sol b/test/unit/EmailRecoveryManager/getRecoveryConfig.t.sol index cc56a971..7fa1ecd7 100644 --- a/test/unit/EmailRecoveryManager/getRecoveryConfig.t.sol +++ b/test/unit/EmailRecoveryManager/getRecoveryConfig.t.sol @@ -7,7 +7,7 @@ import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol"; import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; import { UnitBase } from "../UnitBase.t.sol"; -contract ZkEmailRecovery_getRecoveryConfig_Test is UnitBase { +contract EmailRecoveryManager_getRecoveryConfig_Test is UnitBase { function setUp() public override { super.setUp(); } diff --git a/test/unit/EmailRecoveryManager/getRecoveryRequest.t.sol b/test/unit/EmailRecoveryManager/getRecoveryRequest.t.sol index 00de91af..8b7e44b5 100644 --- a/test/unit/EmailRecoveryManager/getRecoveryRequest.t.sol +++ b/test/unit/EmailRecoveryManager/getRecoveryRequest.t.sol @@ -7,7 +7,7 @@ import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol"; import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; import { UnitBase } from "../UnitBase.t.sol"; -contract ZkEmailRecovery_getRecoveryRequest_Test is UnitBase { +contract EmailRecoveryManager_getRecoveryRequest_Test is UnitBase { function setUp() public override { super.setUp(); } diff --git a/test/unit/handlers/SafeRecoverySubjectHandler/acceptanceSubjectTemplates.t.sol b/test/unit/handlers/SafeRecoverySubjectHandler/acceptanceSubjectTemplates.t.sol index c5be99cb..be7e4f81 100644 --- a/test/unit/handlers/SafeRecoverySubjectHandler/acceptanceSubjectTemplates.t.sol +++ b/test/unit/handlers/SafeRecoverySubjectHandler/acceptanceSubjectTemplates.t.sol @@ -6,11 +6,8 @@ import { SafeRecoverySubjectHandler } from "src/handlers/SafeRecoverySubjectHand import { SafeUnitBase } from "../../SafeUnitBase.t.sol"; contract SafeRecoverySubjectHandler_acceptanceSubjectTemplates_Test is SafeUnitBase { - SafeRecoverySubjectHandler safeRecoverySubjectHandler; - function setUp() public override { super.setUp(); - safeRecoverySubjectHandler = new SafeRecoverySubjectHandler(); } function test_AcceptanceSubjectTemplates_Succeeds() public view { diff --git a/test/unit/handlers/SafeRecoverySubjectHandler/extractRecoveredAccountFromAcceptanceSubject.t.sol b/test/unit/handlers/SafeRecoverySubjectHandler/extractRecoveredAccountFromAcceptanceSubject.t.sol index 4db91845..0d67fad8 100644 --- a/test/unit/handlers/SafeRecoverySubjectHandler/extractRecoveredAccountFromAcceptanceSubject.t.sol +++ b/test/unit/handlers/SafeRecoverySubjectHandler/extractRecoveredAccountFromAcceptanceSubject.t.sol @@ -8,20 +8,16 @@ import { SafeUnitBase } from "../../SafeUnitBase.t.sol"; contract SafeRecoverySubjectHandler_extractRecoveredAccountFromAcceptanceSubject_Test is SafeUnitBase { - SafeRecoverySubjectHandler safeRecoverySubjectHandler; - function setUp() public override { super.setUp(); - safeRecoverySubjectHandler = new SafeRecoverySubjectHandler(); } function test_ExtractRecoveredAccountFromAcceptanceSubject_Succeeds() public view { bytes[] memory subjectParams = new bytes[](1); subjectParams[0] = abi.encode(accountAddress); - address extractedAccount = emailRecoveryHandler.extractRecoveredAccountFromAcceptanceSubject( - subjectParams, templateIdx - ); + address extractedAccount = safeRecoverySubjectHandler + .extractRecoveredAccountFromAcceptanceSubject(subjectParams, templateIdx); assertEq(extractedAccount, accountAddress); } } diff --git a/test/unit/handlers/SafeRecoverySubjectHandler/extractRecoveredAccountFromRecoverySubject.t.sol b/test/unit/handlers/SafeRecoverySubjectHandler/extractRecoveredAccountFromRecoverySubject.t.sol index fae23b85..e847b937 100644 --- a/test/unit/handlers/SafeRecoverySubjectHandler/extractRecoveredAccountFromRecoverySubject.t.sol +++ b/test/unit/handlers/SafeRecoverySubjectHandler/extractRecoveredAccountFromRecoverySubject.t.sol @@ -2,20 +2,13 @@ pragma solidity ^0.8.25; import "forge-std/console2.sol"; -import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; -import { SafeRecoverySubjectHandler } from "src/handlers/SafeRecoverySubjectHandler.sol"; import { SafeUnitBase } from "../../SafeUnitBase.t.sol"; contract SafeRecoverySubjectHandler_extractRecoveredAccountFromRecoverySubject_Test is SafeUnitBase { - using Strings for uint256; - - SafeRecoverySubjectHandler safeRecoverySubjectHandler; - function setUp() public override { super.setUp(); - safeRecoverySubjectHandler = new SafeRecoverySubjectHandler(); } function test_ExtractRecoveredAccountFromRecoverySubject_Succeeds() public view { diff --git a/test/unit/modules/EmailRecoveryModule/getPreviousOwnerInLinkedList.t.sol b/test/unit/handlers/SafeRecoverySubjectHandler/getPreviousOwnerInLinkedList.t.sol similarity index 78% rename from test/unit/modules/EmailRecoveryModule/getPreviousOwnerInLinkedList.t.sol rename to test/unit/handlers/SafeRecoverySubjectHandler/getPreviousOwnerInLinkedList.t.sol index b5fa0be2..458b2d0c 100644 --- a/test/unit/modules/EmailRecoveryModule/getPreviousOwnerInLinkedList.t.sol +++ b/test/unit/handlers/SafeRecoverySubjectHandler/getPreviousOwnerInLinkedList.t.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.25; import "forge-std/console2.sol"; -import { UnitBase } from "../../UnitBase.t.sol"; +import { SafeUnitBase } from "../../SafeUnitBase.t.sol"; -contract EmailRecoveryModule_getPreviousOwnerInLinkedList_Test is UnitBase { +contract SafeRecoverySubjectHandler_getPreviousOwnerInLinkedList_Test is SafeUnitBase { function setUp() public override { super.setUp(); } diff --git a/test/unit/handlers/SafeRecoverySubjectHandler/recoverySubjectTemplates.t.sol b/test/unit/handlers/SafeRecoverySubjectHandler/recoverySubjectTemplates.t.sol index d1611516..8f017b80 100644 --- a/test/unit/handlers/SafeRecoverySubjectHandler/recoverySubjectTemplates.t.sol +++ b/test/unit/handlers/SafeRecoverySubjectHandler/recoverySubjectTemplates.t.sol @@ -2,15 +2,11 @@ pragma solidity ^0.8.25; import "forge-std/console2.sol"; -import { SafeRecoverySubjectHandler } from "src/handlers/SafeRecoverySubjectHandler.sol"; import { SafeUnitBase } from "../../SafeUnitBase.t.sol"; contract SafeRecoverySubjectHandler_recoverySubjectTemplates_Test is SafeUnitBase { - SafeRecoverySubjectHandler safeRecoverySubjectHandler; - function setUp() public override { super.setUp(); - safeRecoverySubjectHandler = new SafeRecoverySubjectHandler(); } function test_RecoverySubjectTemplates_Succeeds() public view { diff --git a/test/unit/handlers/SafeRecoverySubjectHandler/validateAcceptanceSubject.t.sol b/test/unit/handlers/SafeRecoverySubjectHandler/validateAcceptanceSubject.t.sol index 07910521..37e09ff3 100644 --- a/test/unit/handlers/SafeRecoverySubjectHandler/validateAcceptanceSubject.t.sol +++ b/test/unit/handlers/SafeRecoverySubjectHandler/validateAcceptanceSubject.t.sol @@ -6,11 +6,8 @@ import { SafeRecoverySubjectHandler } from "src/handlers/SafeRecoverySubjectHand import { SafeUnitBase } from "../../SafeUnitBase.t.sol"; contract SafeRecoverySubjectHandler_validateAcceptanceSubject_Test is SafeUnitBase { - SafeRecoverySubjectHandler safeRecoverySubjectHandler; - function setUp() public override { super.setUp(); - safeRecoverySubjectHandler = new SafeRecoverySubjectHandler(); } function test_ValidateAcceptanceSubject_RevertWhen_NoSubjectParams() public { diff --git a/test/unit/modules/EmailRecoveryModule/allowValidatorRecovery.t.sol b/test/unit/modules/EmailRecoveryModule/allowValidatorRecovery.t.sol new file mode 100644 index 00000000..7b40dd32 --- /dev/null +++ b/test/unit/modules/EmailRecoveryModule/allowValidatorRecovery.t.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import "forge-std/console2.sol"; +import { UnitBase } from "../../UnitBase.t.sol"; + +contract EmailRecoveryModule_allowValidatorRecovery_Test is UnitBase { + function setUp() public override { + super.setUp(); + } + + function test_AllowValidatorRecovery_RevertWhen_InvalidValidator() public view { } + function test_AllowValidatorRecovery_SucceedsWhenAlreadyInitialized() public view { } + function test_AllowValidatorRecovery_SucceedsWhenInitializing() public view { } +} diff --git a/test/unit/modules/EmailRecoveryModule/disallowValidatorRecovery.t.sol b/test/unit/modules/EmailRecoveryModule/disallowValidatorRecovery.t.sol new file mode 100644 index 00000000..e1194a82 --- /dev/null +++ b/test/unit/modules/EmailRecoveryModule/disallowValidatorRecovery.t.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import "forge-std/console2.sol"; +import { UnitBase } from "../../UnitBase.t.sol"; + +contract EmailRecoveryModule_disallowValidatorRecovery_Test is UnitBase { + function setUp() public override { + super.setUp(); + } + + function test_DisallowValidatorRecovery_RevertWhen_InvalidValidator() public view { } + function test_DisallowValidatorRecovery_Succeeds() public view { } +} diff --git a/test/unit/modules/EmailRecoveryModule/getAllowedSelectors.t.sol b/test/unit/modules/EmailRecoveryModule/getAllowedSelectors.t.sol new file mode 100644 index 00000000..05daa07c --- /dev/null +++ b/test/unit/modules/EmailRecoveryModule/getAllowedSelectors.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import "forge-std/console2.sol"; +import { UnitBase } from "../../UnitBase.t.sol"; + +contract EmailRecoveryModule_getAllowedSelectors_Test is UnitBase { + function setUp() public override { + super.setUp(); + } + + function test_GetAllowedSelectors_Succeeds() public view { } +} diff --git a/test/unit/modules/EmailRecoveryModule/getAllowedValidators.t.sol b/test/unit/modules/EmailRecoveryModule/getAllowedValidators.t.sol new file mode 100644 index 00000000..e61d7ee5 --- /dev/null +++ b/test/unit/modules/EmailRecoveryModule/getAllowedValidators.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import "forge-std/console2.sol"; +import { UnitBase } from "../../UnitBase.t.sol"; + +contract EmailRecoveryModule_getAllowedValidators_Test is UnitBase { + function setUp() public override { + super.setUp(); + } + + function test_GetAllowedValidators_Succeeds() public view { } +} diff --git a/test/unit/modules/EmailRecoveryModule/getTrustedRecoveryManager.t.sol b/test/unit/modules/EmailRecoveryModule/getTrustedRecoveryManager.t.sol new file mode 100644 index 00000000..2db8f944 --- /dev/null +++ b/test/unit/modules/EmailRecoveryModule/getTrustedRecoveryManager.t.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import "forge-std/console2.sol"; +import { UnitBase } from "../../UnitBase.t.sol"; + +contract EmailRecoveryModule_getTrustedRecoveryManager_Test is UnitBase { + function setUp() public override { + super.setUp(); + } + + function test_GetTrustedRecoveryManager_Succeeds() public view { } +} diff --git a/test/unit/modules/EmailRecoveryModule/onInstall.t.sol b/test/unit/modules/EmailRecoveryModule/onInstall.t.sol index 3038807e..99e225da 100644 --- a/test/unit/modules/EmailRecoveryModule/onInstall.t.sol +++ b/test/unit/modules/EmailRecoveryModule/onInstall.t.sol @@ -9,5 +9,6 @@ contract EmailRecoveryModule_onInstall_Test is UnitBase { super.setUp(); } + function test_OnInstall_RevertWhen_InvalidOnInstallData() public view { } function test_OnInstall_Succeeds() public view { } } diff --git a/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol b/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol index d722877d..ed3b0757 100644 --- a/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol +++ b/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol @@ -9,5 +9,7 @@ contract EmailRecoveryModule_onUninstall_Test is UnitBase { super.setUp(); } + function test_OnUninstall_RevertWhen_InvalidValidatorsLength() public view { } + function test_OnUninstall_RevertWhen_InvalidNextValidator() public view { } function test_OnUninstall_Succeeds() public view { } }