Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(protocol): fix an occasional error in test:tokenomics #12950

Merged
merged 3 commits into from
Jan 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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