Refactor time helper and remove custom error helper. (#4803)
Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
@ -4,7 +4,7 @@ const { bigint: time } = require('../helpers/time');
|
||||
function shouldBehaveLikeVesting() {
|
||||
it('check vesting schedule', async function () {
|
||||
for (const timestamp of this.schedule) {
|
||||
await time.forward.timestamp(timestamp);
|
||||
await time.increaseTo.timestamp(timestamp);
|
||||
const vesting = this.vestingFn(timestamp);
|
||||
|
||||
expect(await this.mock.vestedAmount(...this.args, timestamp)).to.be.equal(vesting);
|
||||
@ -24,7 +24,7 @@ function shouldBehaveLikeVesting() {
|
||||
}
|
||||
|
||||
for (const timestamp of this.schedule) {
|
||||
await time.forward.timestamp(timestamp, false);
|
||||
await time.increaseTo.timestamp(timestamp, false);
|
||||
const vested = this.vestingFn(timestamp);
|
||||
|
||||
const tx = await this.mock.release(...this.args);
|
||||
@ -39,7 +39,7 @@ function shouldBehaveLikeVesting() {
|
||||
const { args, error } = await this.setupFailure();
|
||||
|
||||
for (const timestamp of this.schedule) {
|
||||
await time.forward.timestamp(timestamp);
|
||||
await time.increaseTo.timestamp(timestamp);
|
||||
|
||||
await expect(this.mock.release(...args)).to.be.revertedWithCustomError(...error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user