Skip to content

Commit

Permalink
Remove isActivated check in completeRecovery
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnGuilding committed Aug 6, 2024
1 parent 26685b4 commit ca8fb13
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/EmailRecoveryManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ abstract contract EmailRecoveryManager is
* @notice Checks if the recovery is activated for a given account
* @param account The address of the account for which the activation status is being checked
* @return bool True if the recovery request is activated, false otherwise
*/
*/
function isActivated(address account) public view override returns (bool) {
return guardianConfigs[account].threshold > 0;
}
Expand Down Expand Up @@ -385,10 +385,6 @@ abstract contract EmailRecoveryManager is
}
RecoveryRequest memory recoveryRequest = recoveryRequests[account];

if (!isActivated(account)) {
revert RecoveryIsNotActivated();
}

uint256 threshold = guardianConfigs[account].threshold;
if (threshold == 0) {
revert NoRecoveryConfigured();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ contract EmailRecoveryManager_Integration_Test is
instance1.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, "");
vm.stopPrank();

vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector);
vm.expectRevert(IEmailRecoveryManager.NoRecoveryConfigured.selector);
emailRecoveryModule.completeRecovery(accountAddress1, recoveryCalldata1);
}

Expand Down Expand Up @@ -219,7 +219,7 @@ contract EmailRecoveryManager_Integration_Test is
instance1.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, "");
vm.stopPrank();

vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector);
vm.expectRevert(IEmailRecoveryManager.NoRecoveryConfigured.selector);
emailRecoveryModule.completeRecovery(accountAddress1, recoveryCalldata1);
}

Expand Down
1 change: 1 addition & 0 deletions test/unit/assertErrorSelectors.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ contract LogErrorSelectors_Test is Test {
assertEq(IEmailRecoveryManager.RecoveryRequestExpired.selector, bytes4(0x566ad75e));
assertEq(IEmailRecoveryManager.InvalidCalldataHash.selector, bytes4(0x54d53855));
assertEq(IEmailRecoveryManager.NoRecoveryInProcess.selector, bytes4(0x87434f51));
assertEq(IEmailRecoveryManager.RecoveryIsNotActivated.selector, bytes4(0xc737140f));
}

function test_EmailRecoveryUniversalFactory_AssertSelectors() public {
Expand Down

0 comments on commit ca8fb13

Please sign in to comment.