Refactor time helper and remove custom error helper. (#4803)

Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
Hadrien Croubois
2023-12-22 20:50:25 +01:00
committed by GitHub
parent be0572a8dc
commit 015ef69287
32 changed files with 158 additions and 209 deletions

View File

@ -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);
}