EYBlockchain / nightfall_3

a mono-repo containing an optimistic version of nightfall
Creative Commons Zero v1.0 Universal
260 stars 57 forks source link

Wait one block confirmation in tests #1438

Open fullkomnun opened 1 year ago

fullkomnun commented 1 year ago

What does this implement/fix? Explain your changes.

test/utils.mjs

  async evmMine(n = 1) {
    await this.web3.currentProvider.send({
      jsonrpc: '2.0',
      method: 'evm_mine',
      params: [{ blocks: n }],
      id: 0,
    });
  }

some test file

await nf3Proposer.makeBlockNow();
await web3Client.waitForEvent(eventLogs, ['blockProposed']);
await web3Client.evmMine(CONFIRMATIONS + CONFIRMATIONS_BUFFER);

Does this close any currently open issues?

Not that I'm aware of

What commands can I run to test the change?

Run all tests as usuall both locally and in CI (focus on these e2e tests that have CONFIRMATIONS: 1 which is all e2e tests except for 'client-authentication-test', 'test-apps')

Any other comments?