New staking mechanics: delay on entry opposed to exit
This commit is contained in:
@@ -53,39 +53,22 @@ describe('Epochs', () => {
|
||||
});
|
||||
describe('Epochs & TimeLocks', () => {
|
||||
it('basic epochs & timeLock periods', async () => {
|
||||
///// 0/3 Validate Assumptions /////
|
||||
///// 1/3 Validate Assumptions /////
|
||||
expect(await stakingWrapper.getEpochDurationInSecondsAsync()).to.be.bignumber.equal(
|
||||
stakingConstants.EPOCH_DURATION_IN_SECONDS,
|
||||
);
|
||||
expect(await stakingWrapper.getTimeLockDurationInEpochsAsync()).to.be.bignumber.equal(
|
||||
stakingConstants.TIMELOCK_DURATION_IN_EPOCHS,
|
||||
);
|
||||
|
||||
///// 1/3 Validate Initial Epoch & TimeLock Period /////
|
||||
///// 2/3 Validate Initial Epoch & TimeLock Period /////
|
||||
{
|
||||
// epoch
|
||||
const currentEpoch = await stakingWrapper.getCurrentEpochAsync();
|
||||
expect(currentEpoch).to.be.bignumber.equal(stakingConstants.INITIAL_EPOCH);
|
||||
// timeLock period
|
||||
const currentTimeLockPeriod = await stakingWrapper.getCurrentTimeLockPeriodAsync();
|
||||
expect(currentTimeLockPeriod).to.be.bignumber.equal(stakingConstants.INITIAL_TIMELOCK_PERIOD);
|
||||
}
|
||||
///// 2/3 Increment Epoch (TimeLock Should Not Increment) /////
|
||||
///// 3/3 Increment Epoch (TimeLock Should Not Increment) /////
|
||||
await stakingWrapper.skipToNextEpochAsync();
|
||||
{
|
||||
// epoch
|
||||
const currentEpoch = await stakingWrapper.getCurrentEpochAsync();
|
||||
expect(currentEpoch).to.be.bignumber.equal(stakingConstants.INITIAL_EPOCH.plus(1));
|
||||
// timeLock period
|
||||
const currentTimeLockPeriod = await stakingWrapper.getCurrentTimeLockPeriodAsync();
|
||||
expect(currentTimeLockPeriod).to.be.bignumber.equal(stakingConstants.INITIAL_TIMELOCK_PERIOD);
|
||||
}
|
||||
///// 3/3 Increment Epoch (TimeLock Should Increment) /////
|
||||
await stakingWrapper.skipToNextTimeLockPeriodAsync();
|
||||
{
|
||||
// timeLock period
|
||||
const currentTimeLockPeriod = await stakingWrapper.getCurrentTimeLockPeriodAsync();
|
||||
expect(currentTimeLockPeriod).to.be.bignumber.equal(stakingConstants.INITIAL_TIMELOCK_PERIOD.plus(1));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user