Skip to content

Error with Staging test #1916

Answered by othaime-en
TimeKeyRoll asked this question in Q&A
Aug 19, 2022 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

Hey @MasterofBlockchain try and rewrite line 19 of FundMe.staging.test.js (await FundMe.withdrawal()) as follows

const tx = await FundMe.withdrawal()
await tx.wait(2) // Add this line

The entire test should look like this

it("allow people to fund and withdraw", async function () {
              await FundMe.fund({ value: sendValue })
              const tx = await FundMe.withdrawal()
              await tx.wait(1)
              const endingBalance = await FundMe.provider.getBalance(
                  FundMe.address
              )
              assert.equal(endingBalance.toString(), "0")
          })

If tx.wait(1) doesn't work try tx.wait(2) and see if it works.

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@TimeKeyRoll
Comment options

@krakxn
Comment options

Comment options

You must be logged in to vote
2 replies
@krakxn
Comment options

@TimeKeyRoll
Comment options

Comment options

You must be logged in to vote
1 reply
@TimeKeyRoll
Comment options

Answer selected by TimeKeyRoll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants