From ab8fb1229c092f4499dca3a0ce87be8f54451b47 Mon Sep 17 00:00:00 2001 From: Wodann Date: Mon, 12 Feb 2024 16:07:22 +0000 Subject: [PATCH] test: disable interval mining test for forked blockchains --- .../provider/interval-mining-provider.ts | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/packages/hardhat-core/test/internal/hardhat-network/provider/interval-mining-provider.ts b/packages/hardhat-core/test/internal/hardhat-network/provider/interval-mining-provider.ts index bfe746673e..ed419859bb 100644 --- a/packages/hardhat-core/test/internal/hardhat-network/provider/interval-mining-provider.ts +++ b/packages/hardhat-core/test/internal/hardhat-network/provider/interval-mining-provider.ts @@ -1,7 +1,6 @@ import { assert } from "chai"; import { rpcQuantityToNumber } from "../../../../src/internal/core/jsonrpc/types/base-types"; -import { ALCHEMY_URL } from "../../../setup"; import { workaroundWindowsCiFailures } from "../../../utils/workaround-windows-ci-failures"; import { setCWD } from "../helpers/cwd"; import { INTERVAL_MINING_PROVIDERS } from "../helpers/providers"; @@ -12,7 +11,6 @@ describe("Interval mining provider", function () { workaroundWindowsCiFailures.call(this, { isFork }); describe(`${name} provider`, function () { - const safeBlockInThePast = 11_200_000; const blockTime = 100; const blockWaitTime = blockTime + 10; @@ -45,40 +43,10 @@ describe("Interval mining provider", function () { }); describe("hardhat_reset", function () { - if (isFork) { - testForkedProviderBehaviour(); - } else { + if (!isFork) { testNormalProviderBehaviour(); } - function testForkedProviderBehaviour() { - it("starts interval mining", async function () { - const firstBlock = await getBlockNumber(); - - await sleep(blockWaitTime); - const secondBlockBeforeReset = await getBlockNumber(); - - await this.provider.send("hardhat_reset", [ - { - forking: { - jsonRpcUrl: ALCHEMY_URL, - blockNumber: safeBlockInThePast, - }, - }, - ]); - - await sleep(blockWaitTime); - const secondBlockAfterReset = await getBlockNumber(); - - await sleep(blockWaitTime); - const thirdBlock = await getBlockNumber(); - - assert.equal(secondBlockBeforeReset, firstBlock + 1); - assert.equal(secondBlockAfterReset, safeBlockInThePast + 1); - assert.equal(thirdBlock, safeBlockInThePast + 2); - }); - } - function testNormalProviderBehaviour() { it("starts interval mining", async function () { const firstBlock = await getBlockNumber();