From 7a7b80cec6d6a4adfd48cc5b908891c786c2c7d8 Mon Sep 17 00:00:00 2001 From: daveroga Date: Mon, 11 Nov 2024 14:51:00 +0100 Subject: [PATCH] add hardhat time instead of delay in scripts --- test/validators/mtp/index.ts | 3 ++- test/validators/sig/index.ts | 3 ++- test/validators/v3/index.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/validators/mtp/index.ts b/test/validators/mtp/index.ts index 53edb5da..97e77429 100644 --- a/test/validators/mtp/index.ts +++ b/test/validators/mtp/index.ts @@ -4,6 +4,7 @@ import { DeployHelper } from "../../../helpers/DeployHelper"; import { packValidatorParams } from "../../utils/validator-pack-utils"; import { CircuitId } from "@0xpolygonid/js-sdk"; import { loadFixture } from "@nomicfoundation/hardhat-toolbox/network-helpers"; +import { time } from "@nomicfoundation/hardhat-network-helpers"; const tenYears = 315360000; const testCases: any[] = [ @@ -128,7 +129,7 @@ describe("Atomic MTP Validator", function () { if (test.stateTransitionDelayMs) { await Promise.all([ publishState(state, test.stateTransitions[i]), - delay(test.stateTransitionDelayMs), + time.increase(test.stateTransitionDelayMs), ]); } else { await publishState(state, test.stateTransitions[i]); diff --git a/test/validators/sig/index.ts b/test/validators/sig/index.ts index a3e3541e..ff88fddb 100644 --- a/test/validators/sig/index.ts +++ b/test/validators/sig/index.ts @@ -4,6 +4,7 @@ import { DeployHelper } from "../../../helpers/DeployHelper"; import { packValidatorParams } from "../../utils/validator-pack-utils"; import { CircuitId } from "@0xpolygonid/js-sdk"; import { loadFixture } from "@nomicfoundation/hardhat-toolbox/network-helpers"; +import { time } from "@nomicfoundation/hardhat-network-helpers"; const tenYears = 315360000; const testCases: any[] = [ @@ -128,7 +129,7 @@ describe("Atomic Sig Validator", function () { if (test.stateTransitionDelayMs) { await Promise.all([ publishState(state, test.stateTransitions[i]), - delay(test.stateTransitionDelayMs), + time.increase(test.stateTransitionDelayMs), ]); } else { await publishState(state, test.stateTransitions[i]); diff --git a/test/validators/v3/index.ts b/test/validators/v3/index.ts index db5f97d7..5277d176 100644 --- a/test/validators/v3/index.ts +++ b/test/validators/v3/index.ts @@ -5,6 +5,7 @@ import { packV3ValidatorParams } from "../../utils/validator-pack-utils"; import { calculateQueryHashV3 } from "../../utils/query-hash-utils"; import { CircuitId } from "@0xpolygonid/js-sdk"; import { loadFixture } from "@nomicfoundation/hardhat-toolbox/network-helpers"; +import { time } from "@nomicfoundation/hardhat-network-helpers"; const tenYears = 315360000; const testCases: any[] = [ @@ -358,7 +359,7 @@ describe("Atomic V3 Validator", function () { if (test.stateTransitionDelayMs) { await Promise.all([ publishState(state, test.stateTransitions[i]), - delay(test.stateTransitionDelayMs), + time.increase(test.stateTransitionDelayMs), ]); } else { await publishState(state, test.stateTransitions[i]);