Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Multiple concurrent calls to evm_mine without awaiting will only mine 1 block #3248

Open
MicaiahReid opened this issue Jun 16, 2022 · 0 comments · May be fixed by #3246
Open

Multiple concurrent calls to evm_mine without awaiting will only mine 1 block #3248

MicaiahReid opened this issue Jun 16, 2022 · 0 comments · May be fixed by #3246

Comments

@MicaiahReid
Copy link
Contributor

it("should mine `n` blocks if called `n` times without awaiting", async () => {
    const provider = await getProvider(option);
    const initialBlock = parseInt(
      await provider.send("eth_blockNumber")
    );
    let proms = [];
    for (let i = 0; i < 5; i++) {
      proms.push(
        provider.request({
          method: "evm_mine",
          params: []
        })
      );
    }

    await Promise.all(proms);
    const currentBlock = parseInt(
      await provider.send("eth_blockNumber")
    );
    assert.strictEqual(currentBlock, initialBlock + 5);
});

This test fails with expected: 5, actual: 1

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

1 participant