Cyfrin / foundry-defi-stablecoin-cu

249 stars 117 forks source link

Adding in-line config to invariant tests #70

Closed fabriziogianni7 closed 6 months ago

fabriziogianni7 commented 7 months ago

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'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 commented 7 months ago

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 commented 6 months ago

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

fabriziogianni7 commented 6 months ago

@PatrickAlphaC I addressed the conflicts and additionally:

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

PatrickAlphaC commented 6 months ago

Thank you!!

https://github.com/Cyfrin/foundry-defi-stablecoin-f23/pull/73

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