How can i use anvil accounts into the foundry tests? Like in hardhat node i can getNamedAccounts()
but how can I use the anvil accounts into my forge Tests?
1 Answer
I'm a little unsure on this one, although I just made a quick search in the Foundry documentation and on the World Wide Web in general, which I believe you've also tried yourself before asking. So:
To my knowledge there's no such functionality in Foundry. There are, however, a lot of ways to make use of accounts in tests using Anvil. The most obvious is to copy-paste the private keys used in Anvil and make use of them in your tests in any way you want.
Hope this will give some clarification on your issue. :)