From c8ed2d5a204a4e8ef95674a8be785f5c6d98f84f Mon Sep 17 00:00:00 2001 From: 0xmad <0xmad@users.noreply.github.com> Date: Tue, 19 Mar 2024 12:28:57 -0500 Subject: [PATCH] fix: tests for hats gatekeeper and ownable --- contracts/tests/HatsGatekeeper.test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/contracts/tests/HatsGatekeeper.test.ts b/contracts/tests/HatsGatekeeper.test.ts index 082b19b829..9552c51b82 100644 --- a/contracts/tests/HatsGatekeeper.test.ts +++ b/contracts/tests/HatsGatekeeper.test.ts @@ -151,8 +151,9 @@ describe("HatsProtocol Gatekeeper", () => { }); it("should fail to set MACI instance when the caller is not the owner", async () => { - await expect(hatsGatekeeperSingle.connect(voter).setMaciInstance(signerAddress)).to.be.revertedWith( - "Ownable: caller is not the owner", + await expect(hatsGatekeeperSingle.connect(voter).setMaciInstance(signerAddress)).to.be.revertedWithCustomError( + hatsGatekeeperSingle, + "OwnableUnauthorizedAccount", ); }); }); @@ -254,9 +255,9 @@ describe("HatsProtocol Gatekeeper", () => { }); it("should fail to set MACI instance when the caller is not the owner", async () => { - await expect(hatsGatekeeperMultiple.connect(voter).setMaciInstance(signerAddress)).to.be.revertedWith( - "Ownable: caller is not the owner", - ); + await expect( + hatsGatekeeperMultiple.connect(voter).setMaciInstance(signerAddress), + ).to.be.revertedWithCustomError(hatsGatekeeperMultiple, "OwnableUnauthorizedAccount"); }); });