Skip to content

Commit

Permalink
test implementations for setStakingTransitionTimeframeLength()
Browse files Browse the repository at this point in the history
  • Loading branch information
SurfingNerd committed Nov 17, 2023
1 parent f9d6bd9 commit cbf33e6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/StakingHbbft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2854,6 +2854,34 @@ describe('StakingHbbft', () => {
});
});

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

// this should succeed.
await stakingHbbft.setStakingTransitionTimeframeLength('300');
(await stakingHbbft.stakingTransitionTimeframeLength()).should.be.equal('300');
});

it('should not set staking transition time frame length to low value', async () => {
const {
stakingHbbft,
} = await helpers.loadFixture(deployContractsFixture);
await expect(stakingHbbft.setStakingTransitionTimeframeLength('9')).be.revertedWith("The transition timeframe must be longer than 10");
});

it('should not set staking transition time frame length to high value', async () => {
const {
stakingHbbft,
} = await helpers.loadFixture(deployContractsFixture);
await expect(stakingHbbft.setStakingTransitionTimeframeLength('100000')).be.revertedWith("The transition timeframe must be smaller than the epoch duration");
});

});


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

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

0 comments on commit cbf33e6

Please sign in to comment.