Skip to content

Commit

Permalink
Try add test for recovering multiple accounts with same guardians
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnGuilding committed Jun 21, 2024
1 parent 8c8e1c6 commit ea97290
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,30 @@ contract OwnableValidatorRecovery_Integration_Test is OwnableValidatorRecoveryBa
);
emailRecoveryManager.handleRecovery(emailAuthMsg, templateIdx);
}

// Helper function
function executeRecoveryFlowForAccount(
address account,
bytes memory recoveryCalldata
)
internal
{
acceptGuardian(account, guardian1);
acceptGuardian(account, guardian2);
vm.warp(12 seconds);
handleRecovery(account, guardian1, calldataHash1);
handleRecovery(account, guardian2, calldataHash1);
vm.warp(block.timestamp + delay);
emailRecoveryManager.completeRecovery(account, recoveryCalldata);
}

function test_Recover_RotatesMultipleOwnersSuccessfully() public {
executeRecoveryFlowForAccount(accountAddress1, recoveryCalldata1);

EmailAuthMsg memory emailAuthMsg = getAcceptanceEmailAuthMessage(accountAddress2, guardian1);

// FIXME: Should not fail here
vm.expectRevert("template id already exists");
emailRecoveryManager.handleAcceptance(emailAuthMsg, templateIdx);
}
}

0 comments on commit ea97290

Please sign in to comment.