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

Adding in-line config to invariant tests #70

Closed
wants to merge 6 commits into from

Conversation

fabriziogianni7
Copy link

@fabriziogianni7 fabriziogianni7 commented Apr 9, 2024

Description

In this lesson Patrick mentions the possibility of integrate inline config to make tests fail or don't fail on revert.

I discovered that foundry now allow this possibility

With this PR I'm just using foundry inline test config to make the ContinueOnRevert tests work.

Demo

See how we have all invariant tests working: some of them have 0 revert and others have some.
Schermata 2024-04-09 alle 09 19 34

Other things

Additionally,

  • I updated Solidity version to 0.8.25
  • I updated version of cyfrin/foundry-devops to 0.1.0

I'm not sure that this updates will be ok in order to merge the PR - I did this because the project couldn't run on my mac otherwise

@fabriziogianni7
Copy link
Author

fabriziogianni7 commented Apr 9, 2024

About the error I got with 0.8.18 version of solidity:

solc exited with signal: 6 (SIGABRT)
dyld: Symbol not found: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEEC1Ev
  Referenced from: /Users/fabri/Library/Application Support/svm/0.8.18/solc-0.8.18 (which was built for Mac OS X 13.0)
  Expected in: /usr/lib/libc++.1.dylib

I think foundry get a wrong 0.8.18 for my mac! not sure how to address this

@PatrickAlphaC
Copy link
Member

Thanks for this! Sorry on my delay here. Wondering, can you address the conflicts? I'd love to merge this.

@fabriziogianni7
Copy link
Author

@PatrickAlphaC
I addressed the conflicts and additionally:

  • updated solidity version on ERC20Mock to 0.8.25;
  • StopOnRevertHandler had a small error: sometimes it was failing with this error: cannot overwrite a prank until it is applied at least once --> fixed small error in stopOnRevertHandler I commented vm.prank(msg.sender);. dunno if that was intended tho.

Please let me know if you have other things to point out!
Thanks!

@PatrickAlphaC
Copy link
Member

Thank you!!

#73

I opened a new pr from your PR to change the solc version back to 0.8.19 - this is great!

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