ref-fvm icon indicating copy to clipboard operation
ref-fvm copied to clipboard

Eth contract testing: Openzeppelin: Send multiple transactions simultaneously

Open ychiaoli18 opened this issue 2 years ago • 3 comments

CI fails while testing Openzeppelin contracts

Link to CircleCI result

Reproduce Steps

Follow the README to set up the environment

cd ./extern/openzeppelin-contracts
npx hardhat --network test test

ychiaoli18 avatar Jan 31 '23 01:01 ychiaoli18

Looks like a dup of #1615?

Stebalien avatar Jan 31 '23 02:01 Stebalien

They are different. The root cause of this issue is that the code sends out multiple transactions simultaneously, so they all share the same nonce.

test/governance/extensions/GovernorERC721.test.js:

await Promise.all([NFT0, NFT1, NFT2, NFT3, NFT4].map(tokenId => this.token.$_mint(owner, tokenId)))

ychiaoli18 avatar Jan 31 '23 02:01 ychiaoli18

Oh, I see. I think:

  1. The first message fails with out of gas, but lands in the mpool.
  2. Subsequent messages fail because the first message is in the mpool.

Stebalien avatar Feb 17 '23 17:02 Stebalien