Closed PCWCFA closed 11 months ago
1) In FundMe.test.js's withdraw test, use
const startingFundMeBalance = await ethers.provider.getBalance( fundMe.target, );
instead of
const startingFundMeBalance = await fundMe.provider.getBalance( fundMe.address, );
The same needs to be applied to all the other balances.
2) Instead of using BigNumber.add, just use BigInt. See https://docs.ethers.org/v6/migrating/#migrate-bigint. You can just add the numbers.
3) Ethers 6.x's receipt now has a fee = gas_price * gas_used, so you no longer need to calculate the fee.
const response = await fundMe.withdraw(); const receipt = await response.wait(1); ... ... assert.equal((startingDeployerBalance + startingFundMeBalance).toString(), (endingDeployerBalance + receipt.fee).toString());
ah... thanks. I think we might need to leave it as-is and hope people install the lock.
1) In FundMe.test.js's withdraw test, use
instead of
The same needs to be applied to all the other balances.
2) Instead of using BigNumber.add, just use BigInt. See https://docs.ethers.org/v6/migrating/#migrate-bigint. You can just add the numbers.
3) Ethers 6.x's receipt now has a fee = gas_price * gas_used, so you no longer need to calculate the fee.