Skip to content

Commit

Permalink
fix(protocol): fix an occantional error in test:tokenomics (#12950)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Jan 16, 2023
1 parent 59276fe commit 005364c
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions packages/protocol/test/tokenomics/Tokenomics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 005364c

Please sign in to comment.