From 36a79eb4834ba682cf1922ba3096bd10c338e372 Mon Sep 17 00:00:00 2001 From: PacificYield <173040337+PacificYield@users.noreply.github.com> Date: Thu, 7 Nov 2024 15:50:33 +0100 Subject: [PATCH] test: EncryptedERC20 onlyOwner --- test/encryptedERC20/EncryptedERC20.test.ts | 7 +++++++ test/encryptedERC20/EncryptedERC20WithErrors.test.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/test/encryptedERC20/EncryptedERC20.test.ts b/test/encryptedERC20/EncryptedERC20.test.ts index 1665f9d..89fd400 100644 --- a/test/encryptedERC20/EncryptedERC20.test.ts +++ b/test/encryptedERC20/EncryptedERC20.test.ts @@ -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", + ); + }); }); diff --git a/test/encryptedERC20/EncryptedERC20WithErrors.test.ts b/test/encryptedERC20/EncryptedERC20WithErrors.test.ts index 9b10e09..f604129 100644 --- a/test/encryptedERC20/EncryptedERC20WithErrors.test.ts +++ b/test/encryptedERC20/EncryptedERC20WithErrors.test.ts @@ -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", + ); + }); });