Skip to content

Commit

Permalink
test: EncryptedERC20 onlyOwner
Browse files Browse the repository at this point in the history
  • Loading branch information
PacificYield committed Nov 7, 2024
1 parent 75e5aba commit 36a79eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/encryptedERC20/EncryptedERC20.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,11 @@ describe("EncryptedERC20", function () {
this.encryptedERC20.connect(this.signers.bob).approve(this.signers.carol.address, allowanceHandleAlice),
).to.be.revertedWithCustomError(this.encryptedERC20, "TFHESenderNotAllowed");
});

it("EncryptedERC20Mintable - only owner can mint", async function () {
await expect(this.encryptedERC20.connect(this.signers.bob).mint(1)).to.be.revertedWithCustomError(
this.encryptedERC20,
"OwnableUnauthorizedAccount",
);
});
});
7 changes: 7 additions & 0 deletions test/encryptedERC20/EncryptedERC20WithErrors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,4 +502,11 @@ describe("EncryptedERC20WithErrors", function () {
this.encryptedERC20.connect(this.signers.bob).approve(this.signers.carol.address, allowanceHandleAlice),
).to.be.revertedWithCustomError(this.encryptedERC20, "TFHESenderNotAllowed");
});

it("EncryptedERC20WithErrorsMintable - only owner can mint", async function () {
await expect(this.encryptedERC20.connect(this.signers.bob).mint(1)).to.be.revertedWithCustomError(
this.encryptedERC20,
"OwnableUnauthorizedAccount",
);
});
});

0 comments on commit 36a79eb

Please sign in to comment.