Question about running tests on chain forks in foundry fundamentals course #2985
-
Hi! When we're running a command like
Why there is no account that we ned to provide and there is no need to spend any gas? Is it because foundry is smart enough to know that for example |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hey @accurec, as you can see you have used |
Beta Was this translation helpful? Give feedback.
Hey @accurec, as you can see you have used
--fork-url
, which means you are forking the chain locally on your computer. So you are not interacting with the real blockchain, you are creating a fork locally and. running the tests there. So you dont need to provide any private keys. If you want to test it on real chain instead of using--fork-url
just use--rpc-url
. Then you have to provide a private key and broadcast it to the chain. Hope this clears your doubt