Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the problem in Lesson 9, "Error: Timeout of 20000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. " #6473

Open
RMTKroos opened this issue Feb 29, 2024 · 1 comment

Comments

@RMTKroos
Copy link

If using ethers v6,some changes are needed.
Firstly, in ethers v6, getBalance function need use provider,
Change:

const winnerStartingBalance = await accounts[0].getBalance()

To:

const winnerStartingBalance = await ethers.provider.getBalance(accounts[1].address)

furthermore, in v6, the BigNumber class has been replaced with the built-in ES2020
Change:

winnerStartingBalance.add(raffleEntryFee)

To:

winnerStartingBalance + raffleEntryFee

Originally posted by @RMTKroos in #5050 (comment)

@RMTKroos RMTKroos changed the title If using **ethers v6**,some changes are needed. About the problem in Lesson 9, "Error: Timeout of 20000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. " Feb 29, 2024
@NIAZELOPER
Copy link

Remove this from your hardhat.config.js:

mocha: {
timeout: 20000,
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants