Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add more test cases for body parsing #70

Conversation

wshino
Copy link
Contributor

@wshino wshino commented Oct 12, 2024

Add test cases for:

  1. EmailAccountRecovery
  2. ECDSAOwnedDKIMRegistry
  3. ForwardDKIMRegistry
  4. Upgrade EmailAuth

Please let me know if there are any test cases which should be needed.

@wshino wshino changed the title Feat/add more test cases from body parsing Feat/add more test cases for body parsing Oct 12, 2024
@wshino wshino marked this pull request as ready for review October 17, 2024 02:52
@@ -73,6 +73,126 @@ contract EmailAccountRecoveryTest_handleRecovery is StructHelper {
);
}

function testExpectRevertHandleRecoveryInvalidRecoveredAccount() public {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between testExpectRevertHandleRecoveryInvalidRecoveredAccount and testExpectRevertHandleRecoveryInvalidAccountInEmail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnGuilding The first test is more focused on the initial invalid account scenario without any prior state changes.
The second test ensures that even after a guardian is accepted, the function still correctly handles an invalid account scenario.

);
}

// function testRequestGuardianNotOwner() public {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out code

// Upgrade to new implementation through proxy
emailAuthProxy.upgradeToAndCall(
address(newImplementation),
new bytes(0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we encode a call here and assert something about the new state as well as the old state?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnGuilding emailAuthProxy has already initialized once, should I create a new implementation for testing only?

@JohnGuilding
Copy link
Collaborator

Also @wshino we don't have tests for (correct me if I'm wrong):

  1. Upgrading ForwardDKIMRegistry
  2. Upgrading Verifier

Could we add these as well?

@wshino wshino merged commit 7f6ac43 into feat/body-parsing-with-audit-fix Oct 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants