I writing hardhat/ethers/waffle unit tests for my contract and need to know Ether balance of my contract.
Chai matcher changeEtherBalance
needs Signer object to check balance, but I have address of my contract only.
I know, what ethers.js has provider object with getBalance(address)
method, so I have installed nomiclabs-hardhat-ethers plugin and can call
ethers.provider.getBalance(address)
It works well for addresses from signers ethers.getSigners()
but returns 0 for mycontract.address.
How I can know my contract Ethereum balance? Please advice.
getBalance
on it?