Skip to content

Commit

Permalink
test coverage for new staking hbbft tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SurfingNerd committed Dec 27, 2023

Verified

This commit was signed with the committer’s verified signature.
luehm Alex Luehm
1 parent 906eac0 commit e08eb87
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/StakingHbbft.ts
Original file line number Diff line number Diff line change
@@ -2886,8 +2886,30 @@ describe('StakingHbbft', () => {
});

});



describe('setStakingFixedEpochDuration()', async () => {
it('should set staking fixed epoch transition', async () => {
const {
stakingHbbft,
} = await helpers.loadFixture(deployContractsFixture);

// this should succeed.
await stakingHbbft.setStakingFixedEpochDuration('600000');
(await stakingHbbft.stakingFixedEpochDuration()).should.be.equal('600000');
});

it('should not set staking transition time frame length to low value', async () => {
const {
stakingHbbft,
} = await helpers.loadFixture(deployContractsFixture);

let tranitionTimeFrame = await stakingHbbft.stakingTransitionTimeframeLength();
await expect(stakingHbbft.setStakingFixedEpochDuration(tranitionTimeFrame)).be.revertedWith("The fixed epoch duration timeframe must be greater than the transition timeframe length");
});
});

// TODO: ...add other tests...

async function callReward(blockRewardContract: BlockRewardHbbftMock, isEpochEndBlock: boolean) {

0 comments on commit e08eb87

Please sign in to comment.