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

Resolving reverts in invariant tests #82

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Conversation

nican0r
Copy link
Contributor

@nican0r nican0r commented Apr 30, 2024

The issue with invariant tests reverting when fail_on_revert was set to true was due to calls to vm.warp not preserving state between calls.

A workaround was added in this PR to Foundry which added the preserve_state to the invariant section of the foundry config.

I've added this to the config and it resolves the issue when running forge test --mc "IonPool_InvariantTest" -v.

In the image below you can see that the invariant tests now run without reverting when fail_on_revert=true

image

@HrikB HrikB self-requested a review April 30, 2024 17:07
@HrikB HrikB merged commit 545f283 into Ion-Protocol:master Apr 30, 2024
6 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