From 75756deb93edb2acf88a765904abc5f400f8edd5 Mon Sep 17 00:00:00 2001 From: Auryn Macmillan Date: Wed, 5 Jul 2023 22:18:35 +1000 Subject: [PATCH] feat: test that getThresholdHash() reverts if threshold reports 0 --- packages/evm/test/02_ShoyuBashi.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/evm/test/02_ShoyuBashi.spec.ts b/packages/evm/test/02_ShoyuBashi.spec.ts index 066fb77b..d8b40db4 100644 --- a/packages/evm/test/02_ShoyuBashi.spec.ts +++ b/packages/evm/test/02_ShoyuBashi.spec.ts @@ -294,6 +294,14 @@ describe("ShoyuBashi", function () { "ThresholdNotMet", ) }) + it.only("Reverts if threshold returns bytes(0)", async function () { + const { shoyuBashi, mockOracleAdapter, anotherOracleAdapter } = await setup() + await shoyuBashi.enableOracleAdapters(DOMAIN_ID, [mockOracleAdapter.address, anotherOracleAdapter.address]) + await expect(shoyuBashi.getThresholdHash(DOMAIN_ID, 0)).to.be.revertedWithCustomError( + shoyuBashi, + "ThresholdNotMet", + ) + }) it("Returns unanimous agreed on hash", async function () { const { shoyuBashi, mockOracleAdapter, anotherOracleAdapter } = await setup() await shoyuBashi.enableOracleAdapters(DOMAIN_ID, [mockOracleAdapter.address, anotherOracleAdapter.address])