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

Invariant tests function breakdown #5011

Closed
FredCoen opened this issue May 23, 2023 · 2 comments
Closed

Invariant tests function breakdown #5011

FredCoen opened this issue May 23, 2023 · 2 comments
Labels
T-feature Type: feature

Comments

@FredCoen
Copy link

Component

Forge

Describe the feature you would like

Invariant testing is very powerful. However I feel like it is hard to be very confident about it without knowing exactly what happened during a run. Right now the output prints runs, calls and reverts. If the distribution is similar across all function calls than that would give me more confidence then if one function only reverted and wasn't part of the simulation through a successful execution at all.

An output with calls + reverts per function would be very helpful

Additional context

No response

@FredCoen FredCoen added the T-feature Type: feature label May 23, 2023
@gakonst gakonst added this to Foundry May 23, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry May 23, 2023
@PaulRBerg
Copy link
Contributor

Potential duplicate of #3607 and/ or #2985.

Also see #4438.

In the meantime, you can roll your own instrumentation system in Solidity by following @lucas-manuel's example:

https://github.com/lucas-manuel/invariant-examples/blob/ecca083dbda5419c3a6c3d09555938350944ba82/test/WrappedTests.t.sol#L85-L99

And my example here:

foundry-rs/book#760 (comment)

@FredCoen
Copy link
Author

ah thanks @PaulRBerg this is great

@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-feature Type: feature
Projects
Archived in project
Development

No branches or pull requests

2 participants