FundMe.test stage -> Error code: Need to specify address #92
-
|
When testing to see it only allows owner to withdraw receive this error code. it("only allows owner to withdraw", async function() {
const accounts = await ethers.getSigner();
const attacker = accounts[1]
console.log(`This is attacker ${attacker}`)
const attackerContractContract = await fundMe.connect(attacker); //account object
await expect(attackerContractContract.withdraw()).to.be.reverted
})
})Not sure where I'm going to wrong |
Beta Was this translation helpful? Give feedback.
Answered by
conqryash007
Jun 2, 2022
Replies: 1 comment 2 replies
-
|
Replace the following const accounts = await ethers.getSigner();with const accounts = await ethers.getSigners();The |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
PatrickAlphaC
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Replace the following
with
The
ethers.getSigner(address);takes argument, i.e. address of signer, to return the signer object.