Closed Renzo1 closed 10 months ago
Can you please share more details? Forge version, Solc version, any minimal example...
$ forge --version
forge 0.2.0 (bf56869 2023-07-05T00:07:51.006216400Z)
solc version: 0.8.17
Minimal example:
As mentioned in my initial post, I attempted to create an empty function and encountered the same error.
function testMint() public { assert(true); }
This is what my Foundry.toml looks like:
```toml
[profile.default]
src = 'contracts'
out = 'out'
libs = ['node_modules', 'lib']
test = 'test/foundry'
cache_path = 'cache_forge'
optimizer = true
viaIR = true
[fuzz]
runs = 10
[invariant]
runs = 10
depth = 10
Apart from the above, I honestly can't pinpoint where things went wrong. One moment, all functions were working, then it stopped. It briefly worked again (when I commented out some lines in the testFunction I was testing), but then stopped again. I thought it might be something in the testFunction(), so I decided to create an empty function, but the problem persisted. I even test other functions that worked before, but they also stopped working. I have tried restarting my system, but the issue remains. I created a new Foundry project to check if it's a global issue, and everything worked fine. I then attempted to copy my project into this new project, but the error persisted.
Thanks for the support. I have managed to resolve the issue.
The problem originated from a struct I added to my test.
Anyone facing the same error should inspect their error message for matching variables or datatypes, and then consider removing them from the test and trying again.
In my case it was VaultForTest
struct.
My foundry tests suddenly stopped working. Could anyone please help me understand why a previously functional foundry test might fail due to the following error?
I tried writing an empty test function (testMint) in efforts to debug the issue, and got thesame error.