Lession 7: Rinkeby Staging test, Error: cannot estimate gas; transaction may fail or may require manual gas limit #2367
-
: describe("FundMe Staging Tests", async function() {
let fundMe
let deployer
const sendValue = ethers.utils.parseEther("0.1")
beforeEach(async function() {
deployer = (await getNamedAccounts()).deployer
fundMe = await ethers.getContract("FundMe", deployer)
})
it("allows people to fund and withdraw", async function() {
const fundTxResponse = await fundMe.fund({ value: sendValue })
await fundTxResponse.wait(1) This piece of code is from the FundMe.staging,js.test file. I ran the code through the Javascript debug terminal and found out that the error I had occured during this part:
This is the error I got when running yarn hardhat test ---network rinkeby. The strange thing is that I don't get any errors when I ran this locally on the Hardhat runtime environment.
I've looked at other discussions where people had similar issues, and saw that they put their gas limits manually in the hardhat.config.js file to resolve this issue. I tried that and got this error.
Here is a link to my github repo of the FundMe.staging,js.test file. Please let me know what I might have done wrong because I've followed the tutorial pretty closely while checking through the github repo of the tutorial. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
@cxiong22 : I have a made a PR in your repo, You can merge it, and check it out! Let me know if it works! |
Beta Was this translation helpful? Give feedback.
-
Before I look into your repo, please try Goerli/Kovan. |
Beta Was this translation helpful? Give feedback.
-
Try to run on goerli
…On Thu, Sep 8, 2022, 1:17 AM cxiong22 ***@***.***> wrote:
[image: Screenshot from 2022-09-07 15-04-52]
<https://user-images.githubusercontent.com/102254112/188967683-4ab643d8-35a5-432b-8fa2-f2d8907fb84e.png>
It didn't work. I'm not sure if the problem would be with the code I have
or if there are new updates in Rinkeby that might be causing these kinds of
errors because the test runs perfectly fine on the local Hardhat network.
—
Reply to this email directly, view it on GitHub
<#2367 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZ7TJAYTDXOWGGQPYG46W7DV5DZ4JANCNFSM6AAAAAAQGGOZCQ>
.
You are receiving this because you commented.Message ID:
<smartcontractkit/full-blockchain-solidity-course-js/repo-discussions/2367/comments/3588724
@github.com>
|
Beta Was this translation helpful? Give feedback.
@cxiong22 : I have a made a PR in your repo, You can merge it, and check it out!
Let me know if it works!