Skip to content

No transactions when running tests on anvil #5421

Answered by aathan
Keinberger asked this question in Help
Discussion options

You must be logged in to vote

AFAIK foundry test does not execute its tests in the node, but rather, within its own local evm. I.e., foundry test is not "deploying" the test contracts themselves into the node. Instead it is using the node to get blockchain state from which to create an internal execution context to run the test. I'm still studying all the foundry source code so take what I just said with that in mind. Arguably, at some point in the future, foundry test could work by running the tests in the node, checkpointing & reverting the chain prior to each run of the test. I'm not clear on how much (if any) code duplication exists since both environments need to handle cheatcodes etc, but they probably share the…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@Keinberger
Comment options

@aathan
Comment options

@IbrahimSam96
Comment options

Answer selected by Keinberger
Comment options

You must be logged in to vote
3 replies
@aathan
Comment options

@Keinberger
Comment options

@UdeRox
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants