I'm trying to test out some functionality using the AAVE sandbox network, which is a hardhat forked network that has their protocol built in for testing purposes. I am able to deploy my contract to the network and interact with it, however, the state resets every time I run a new test. Also, I am printing the address of the contract each time I run the test and the address changes every time and is different that the address in the contract's JSON object in deployments
. For clarity, here is how I am accessing the contract in my test code.
accounts = await ethers.getSigners()
deployer = accounts[0]
user = accounts[1]
await deployments.fixture(["all"])
yieldFundContract = await ethers.getContract("YieldFund")
yieldFund = yieldFundContract.connect(deployer)
I'm wondering if this issue is happening due to some property of a hardhat network, but I figured it would be able to keep track of state? Furthermore, this code works as expected when deployed to a testnet and tested in the exact same way.