-
-
Save piorot/c0d00cc817d381ac09d438f003cb5658 to your computer and use it in GitHub Desktop.
It should be possible to withdraw multiple times provided there were incomes in between
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("It should be possible to withdraw multiple times provided there were incomes in between", async () => { | |
const Apartment = await ethers.getContractFactory("Apartment"); | |
const apartment = await Apartment.deploy(); | |
[owner, Alice, Bob] = await ethers.getSigners(); | |
await apartment.deployed(); | |
await apartment.transfer(Alice.address, 20); | |
await Bob.sendTransaction({ | |
to: apartment.address, | |
value: ethers.utils.parseEther("1") | |
}); | |
await apartment.connect(Alice).withdraw(); | |
await Bob.sendTransaction({ | |
to: apartment.address, | |
value: ethers.utils.parseEther("1") | |
}); | |
await expect(apartment.connect(Alice).withdraw()).not.to.be.revertedWith("0 funds to withdraw"); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment