optimism icon indicating copy to clipboard operation
optimism copied to clipboard

integration-test: nft-bridge fail

Open gavin-ygy opened this issue 3 years ago • 2 comments

Describe the bug $ npx hardhat --network testlocal test test/nft-bridge.spec.ts

  1. "before each" hook for "bridgeERC721"

0 passing (8s) 1 failing

  1. ERC721 Bridge "before each" hook for "bridgeERC721": NomicLabsHardhatPluginError: 0x5E67BdF9A839808bAe76E4fAa04889ED8FD0172e is not a contract account. at getContractAt (/home/etd/l2/optimism/integration-tests/node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:307:11) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Context. (/home/etd/l2/optimism/integration-tests/test/nft-bridge.spec.ts:130:30)

To Reproduce Steps to reproduce the behavior:

  1. using local layer1
  2. using local l2-geth
  3. deploy the contracts to layer1
  4. enter into integration-tests, run: npx hardhat --network testlocal test test/nft-bridge.spec.ts

Additional context when checking the error point in nft-bridge.spec.ts: const erc721CreatedEvent = receipt.events[0] expect(erc721CreatedEvent.event).to.be.eq('OptimismMintableERC721Created')

OptimismMintableERC721 = await ethers.getContractAt(
  Artifact__OptimismMintableERC721.abi,
  erc721CreatedEvent.args.localToken      //hardhat said this address  is not a contract account !
)
await OptimismMintableERC721.deployed()

gavin-ygy avatar Sep 22 '22 07:09 gavin-ygy

I suspect hardhat the getContractAt() does not support the address with new a contract. when changing the code: /* OptimismMintableERC721 = await ethers.getContractAt( Artifact__OptimismMintableERC721.abi, erc721CreatedEvent.args.localToken //hardhat said this address is not a contract account ! ) await OptimismMintableERC721.deployed() */ //the following works well . OptimismMintableERC721 = new ethers.Contract(erc721CreatedEvent.args.localToken, Artifact__OptimismMintableERC721.abi,bobWalletL2)

gavin-ygy avatar Sep 22 '22 07:09 gavin-ygy

I haven't observed this bug in CI, wondering why its happening

tynes avatar Sep 30 '22 21:09 tynes