Lesson 7: Error while testing staging script to Rinkeby #758
-
Hello community👋, I am facing an issue while trying to test the staging script on Rinkeby. However, testing on development chains was successful. The error is: My FundMe.staging.test file: const { ethers, getNamedAccounts, network } = require('hardhat');
const { developmentChains } = require('../../helper-hardhat-config');
const { assert } = require('chai');
// only run on testnets
developmentChains.includes(network.name)
? describe.skip
: describe('FundMe', async () => {
let fundMe;
let deployer;
const sendValue = ethers.utils.parseEther('1');
// const sendValue = '100000000000000000';
beforeEach(async function () {
deployer = (await getNamedAccounts()).deployer;
fundMe = await ethers.getContract('FundMe', deployer);
});
it('Allows people to fund & withdraw', async function () {
await fundMe.fund({ value: sendValue });
await fundMe.withdraw();
const endingBalance = await ethers.provider.getBalance(fundMe.address);
assert.equal(endingBalance.toString(), '0');
});
}); Funds on my metamask wallet: |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Jul 6, 2022
Replies: 1 comment 9 replies
-
@LucidJoy You do not have 1 ETH in your wallet and you mentioned a 1 ETH sendValue amount. |
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
PatrickAlphaC
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@LucidJoy You do not have 1 ETH in your wallet and you mentioned a 1 ETH sendValue amount.