Skip to content

Commit

Permalink
Update test imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnGuilding committed Jun 17, 2024
1 parent bd3573a commit 8613324
Show file tree
Hide file tree
Showing 27 changed files with 26 additions and 55 deletions.
3 changes: 0 additions & 3 deletions test/unit/EmailRecoveryManager/acceptGuardian.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";

contract ZkEmailRecovery_acceptGuardian_Test is UnitBase {
function setUp() public override {
Expand Down
4 changes: 0 additions & 4 deletions test/unit/EmailRecoveryManager/addGuardian.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";

error SetupNotCalled();
error InvalidGuardianAddress();
Expand Down
3 changes: 0 additions & 3 deletions test/unit/EmailRecoveryManager/cancelRecovery.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";

contract ZkEmailRecovery_cancelRecovery_Test is UnitBase {
function setUp() public override {
Expand Down
3 changes: 0 additions & 3 deletions test/unit/EmailRecoveryManager/changeThreshold.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";

error SetupNotCalled();
error ThresholdCannotExceedTotalWeight();
Expand Down
3 changes: 0 additions & 3 deletions test/unit/EmailRecoveryManager/completeRecovery.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";

import { UnitBase } from "../UnitBase.t.sol";
import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";

// completeRecovery(accountAddress, recoveryCalldata)
contract ZkEmailRecovery_completeRecovery_Test is UnitBase {
Expand Down
4 changes: 0 additions & 4 deletions test/unit/EmailRecoveryManager/configureRecovery.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";

import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";
import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";

error SetupAlreadyCalled();

Expand Down
4 changes: 2 additions & 2 deletions test/unit/EmailRecoveryManager/constructor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ contract ZkEmailRecovery_constructor_Test is UnitBase {
function test_Constructor() public {
EmailRecoveryManager emailRecoveryManager = new EmailRecoveryManager(
address(verifier),
address(ecdsaOwnedDkimRegistry),
address(dkimRegistry),
address(emailAuthImpl),
address(emailRecoveryHandler)
);

assertEq(address(verifier), emailRecoveryManager.verifier());
assertEq(address(ecdsaOwnedDkimRegistry), emailRecoveryManager.dkim());
assertEq(address(dkimRegistry), emailRecoveryManager.dkim());
assertEq(address(emailAuthImpl), emailRecoveryManager.emailAuthImplementation());
}
}
3 changes: 0 additions & 3 deletions test/unit/EmailRecoveryManager/deInitRecoveryFromModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";

import { UnitBase } from "../UnitBase.t.sol";
import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";

contract ZkEmailRecovery_deInitRecoveryFromModule_Test is UnitBase {
function setUp() public override {
Expand Down
3 changes: 0 additions & 3 deletions test/unit/EmailRecoveryManager/processRecovery.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";

import { UnitBase } from "../UnitBase.t.sol";
import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";
import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol";

contract ZkEmailRecovery_processRecovery_Test is UnitBase {
Expand Down
3 changes: 0 additions & 3 deletions test/unit/EmailRecoveryManager/removeGuardian.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";

import { UnitBase } from "../UnitBase.t.sol";
import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";
import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol";

error ThresholdCannotExceedTotalWeight();
Expand Down
3 changes: 0 additions & 3 deletions test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";

import { UnitBase } from "../UnitBase.t.sol";
import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";

contract ZkEmailRecovery_updateRecoveryConfig_Test is UnitBase {
function setUp() public override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
pragma solidity ^0.8.25;

// import "forge-std/console2.sol";
// import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
// import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";

// import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
// import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
// import { OwnableValidator } from "src/test/OwnableValidator.sol";
// import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol";
// import { UnitBase } from "../UnitBase.t.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
pragma solidity ^0.8.25;

// import "forge-std/console2.sol";
// import { ModuleKitHelpers, ModuleKitUserOp } from "modulekit/ModuleKit.sol";
// import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";

// import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol";
// import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
// import { OwnableValidator } from "src/test/OwnableValidator.sol";
// import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol";
// import { UnitBase } from "../UnitBase.t.sol";

Expand Down
13 changes: 11 additions & 2 deletions test/unit/UnitBase.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { Test } from "forge-std/Test.sol";

import { RhinestoneModuleKit, AccountInstance } from "modulekit/ModuleKit.sol";
import {
RhinestoneModuleKit,
AccountInstance,
ModuleKitHelpers,
ModuleKitUserOp
} from "modulekit/ModuleKit.sol";
import { MODULE_TYPE_EXECUTOR, MODULE_TYPE_VALIDATOR } from "modulekit/external/ERC7579.sol";
import { ECDSAOwnedDKIMRegistry } from
"ether-email-auth/packages/contracts/src/utils/ECDSAOwnedDKIMRegistry.sol";
import {
Expand All @@ -17,9 +22,13 @@ import { ECDSA } from "solady/utils/ECDSA.sol";
import { EmailRecoveryManagerHarness } from "./EmailRecoveryManagerHarness.sol";
import { EmailRecoverySubjectHandler } from "src/handlers/EmailRecoverySubjectHandler.sol";
import { EmailRecoveryModule } from "src/modules/EmailRecoveryModule.sol";
import { OwnableValidator } from "src/test/OwnableValidator.sol";
import { MockGroth16Verifier } from "src/test/MockGroth16Verifier.sol";

abstract contract UnitBase is RhinestoneModuleKit, Test {
using ModuleKitHelpers for *;
using ModuleKitUserOp for *;

// ZK Email contracts and variables
address zkEmailDeployer = vm.addr(1);
ECDSAOwnedDKIMRegistry dkimRegistry;
Expand Down
2 changes: 1 addition & 1 deletion test/unit/libraries/EnumerableGuardianMap/get.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EnumerableGuardianMap_get_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/libraries/EnumerableGuardianMap/keys.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EnumerableGuardianMap_keys_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/libraries/EnumerableGuardianMap/remove.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EnumerableGuardianMap_remove_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/libraries/EnumerableGuardianMap/removeAll.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EnumerableGuardianMap_removeAll_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/libraries/EnumerableGuardianMap/set.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EnumerableGuardianMap_set_Test is UnitBase {
function setUp() public override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EmailRecoveryModule_getPreviousOwnerInLinkedList_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/modules/EmailRecoveryModule/isInitialized.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EmailRecoveryModule_isInitialized_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/modules/EmailRecoveryModule/isModuleType.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EmailRecoveryModule_isModuleType_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/modules/EmailRecoveryModule/name.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EmailRecoveryModule_name_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/modules/EmailRecoveryModule/onInstall.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EmailRecoveryModule_onInstall_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/modules/EmailRecoveryModule/onUninstall.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EmailRecoveryModule_onUninstall_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/modules/EmailRecoveryModule/recover.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EmailRecoveryModule_recover_Test is UnitBase {
function setUp() public override {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/modules/EmailRecoveryModule/version.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.25;

import "forge-std/console2.sol";
import { UnitBase } from "../UnitBase.t.sol";
import { UnitBase } from "../../UnitBase.t.sol";

contract EmailRecoveryModule_version_Test is UnitBase {
function setUp() public override {
Expand Down

0 comments on commit 8613324

Please sign in to comment.