-
-
Save piorot/67a2939e4232c2d9cf2b74b38ced10ba to your computer and use it in GitHub Desktop.
Attempt to withdraw by non shareholder should be reverted
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("Attempt to withdraw by non shareholder should be reverted", 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 expect(apartment.connect(Bob).withdraw()).to.be.revertedWith("unauthorized"); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment