Skip to content

Commit

Permalink
test: disable interval mining test for forked blockchains
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodann committed Feb 12, 2024
1 parent 3000158 commit 4468e7d
Showing 1 changed file with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,40 +45,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();
Expand Down

0 comments on commit 4468e7d

Please sign in to comment.