Skip to content

Commit

Permalink
add hardhat time instead of delay in scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
daveroga committed Nov 11, 2024
1 parent f6e32e9 commit 7a7b80c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/validators/mtp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand Down Expand Up @@ -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]);
Expand Down
3 changes: 2 additions & 1 deletion test/validators/sig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand Down Expand Up @@ -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]);
Expand Down
3 changes: 2 additions & 1 deletion test/validators/v3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit 7a7b80c

Please sign in to comment.