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: refactor dutch reactor tests #215

Merged
merged 1 commit into from
Dec 21, 2023
Merged

feat: refactor dutch reactor tests #215

merged 1 commit into from
Dec 21, 2023

Conversation

marktoda
Copy link
Collaborator

@marktoda marktoda commented Dec 19, 2023

  • Move common tests into a base test contract
  • inherit it from Dutch and ExclusiveDutch (dutchv2 coming later)
  • clean up test logic, use helpers and solarray

Solve the basic problem of reactors often having similar logic, and missing coverage due to assumptions that logic is the same so it should work the same. ExclusiveDutchReactor was missing a lot of coverage over the dutch validation for this reason

- Move common tests into a base test contract
- inherit it from Dutch and ExclusiveDutch (dutchv2 coming later)
- clean up test logic, use helpers and solarray
@marktoda marktoda force-pushed the dutch-test-refactor branch from 99090c6 to 612396e Compare December 19, 2023 06:15
@marktoda marktoda requested a review from hensha256 December 19, 2023 06:15
(order,) = createAndSignDutchOrder(request);
}

function test_dutch_resolveOutputNotStarted() public {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fyi all these tests come from the validation section of DutchOrderReactorTest, but they've been cleaned up and refactored into this abstract test file which can be imported by any reactor test to add coverage to any dutch decaying order types

@marktoda marktoda merged commit ce16362 into main Dec 21, 2023
2 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