From 005364c11c327f6dcaad7872c5064eb81e52f35b Mon Sep 17 00:00:00 2001 From: David Date: Tue, 17 Jan 2023 04:02:45 +0800 Subject: [PATCH] fix(protocol): fix an occantional error in `test:tokenomics` (#12950) --- .../test/tokenomics/Tokenomics.test.ts | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/packages/protocol/test/tokenomics/Tokenomics.test.ts b/packages/protocol/test/tokenomics/Tokenomics.test.ts index 60d066b809..99927ca363 100644 --- a/packages/protocol/test/tokenomics/Tokenomics.test.ts +++ b/packages/protocol/test/tokenomics/Tokenomics.test.ts @@ -178,25 +178,22 @@ describe("tokenomics", function () { expect(hasFailedAssertions).to.be.eq(false); }); - describe("bootstrapHalvingPeriod", function () { - it("block fee should increase as the halving period passes, while no blocks are proposed", async function () { - const { bootstrapDiscountHalvingPeriod } = - await taikoL1.getConfig(); - - const iterations: number = 5; - const period: number = bootstrapDiscountHalvingPeriod - .mul(1000) - .toNumber(); - - let lastBlockFee: BigNumber = await taikoL1.getBlockFee(); - - for (let i = 0; i < iterations; i++) { - await sleep(period); - const blockFee = await taikoL1.getBlockFee(); - expect(blockFee.gt(lastBlockFee)).to.be.eq(true); - lastBlockFee = blockFee; - } - }); + it("block fee should increase as the halving period passes, while no blocks are proposed", async function () { + const { bootstrapDiscountHalvingPeriod } = await taikoL1.getConfig(); + + const iterations: number = 5; + const period: number = bootstrapDiscountHalvingPeriod + .mul(1000) + .toNumber(); + + let lastBlockFee: BigNumber = await taikoL1.getBlockFee(); + + for (let i = 0; i < iterations; i++) { + await sleep(period); + const blockFee = await taikoL1.getBlockFee(); + expect(blockFee.gt(lastBlockFee)).to.be.eq(true); + lastBlockFee = blockFee; + } }); it("expects the blockFee to go be 0 when no periods have passed", async function () {