bee344 / evm-tests

0 stars 0 forks source link

Script throws when testing Polygon with smart contracts flag #15

Open IkerAlus opened 1 week ago

IkerAlus commented 1 week ago

Script throws when testing Polygon with smart contracts flag, the output is as follows:

  70) UniswapV3Pool swap tests
       high fee, 1:1 price, 2e18 max range liquidity
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2424}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  71) UniswapV3Pool swap tests
       high fee, 1:1 price, 2e18 max range liquidity
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  72) UniswapV3Pool swap tests
       medium fee, 10:1 price, 2e18 max range liquidity
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getBalance","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2426}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  73) UniswapV3Pool swap tests
       medium fee, 10:1 price, 2e18 max range liquidity
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  74) UniswapV3Pool swap tests
       medium fee, 1:10 price, 2e18 max range liquidity
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getBalance","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2429}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  75) UniswapV3Pool swap tests
       medium fee, 1:10 price, 2e18 max range liquidity
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  76) UniswapV3Pool swap tests
       medium fee, 1:1 price, 0 liquidity, all liquidity around current price
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getCode","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2434}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  77) UniswapV3Pool swap tests
       medium fee, 1:1 price, 0 liquidity, all liquidity around current price
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  78) UniswapV3Pool swap tests
       medium fee, 1:1 price, additional liquidity around current price
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getCode","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2437}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  79) UniswapV3Pool swap tests
       medium fee, 1:1 price, additional liquidity around current price
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  80) UniswapV3Pool swap tests
       low fee, large liquidity around current price (stable swap)
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getBalance","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2438}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  81) UniswapV3Pool swap tests
       low fee, large liquidity around current price (stable swap)
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  82) UniswapV3Pool swap tests
       medium fee, token0 liquidity only
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getCode","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2443}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  83) UniswapV3Pool swap tests
       medium fee, token0 liquidity only
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  84) UniswapV3Pool swap tests
       medium fee, token1 liquidity only
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getCode","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2446}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  85) UniswapV3Pool swap tests
       medium fee, token1 liquidity only
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  86) UniswapV3Pool swap tests
       close to max price
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getBalance","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2447}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  87) UniswapV3Pool swap tests
       close to max price
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  88) UniswapV3Pool swap tests
       close to min price
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2451}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  89) UniswapV3Pool swap tests
       close to min price
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  90) UniswapV3Pool swap tests
       max full range liquidity at 1:1 price with default fee
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getCode","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2455}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  91) UniswapV3Pool swap tests
       max full range liquidity at 1:1 price with default fee
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  92) UniswapV3Pool swap tests
       initialized at the max ratio
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getBalance","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2456}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  93) UniswapV3Pool swap tests
       initialized at the max ratio
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  94) UniswapV3Pool swap tests
       initialized at the min ratio
         "before each" hook: load fixture for "swap exactly 1.0000 token0 for token1":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getCode","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2461}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

  95) UniswapV3Pool swap tests
       initialized at the min ratio
         "after each" hook: check can burn positions for "swap exactly 1.0000 token0 for token1":
     TypeError: Cannot read properties of undefined (reading 'burn')
      at Context.<anonymous> (test/UniswapV3Pool.swaps.spec.ts:502:22)
      at processImmediate (node:internal/timers:478:21)

  96) UniswapV3Pool
       "before each" hook: deploy first fixture for "constructor initializes immutables":
     ProviderError: The response reported error `-32000`: `missing trie node 719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 (path ) state 0x719742f8645e4346de9d659ecae44fcffb357765a88b0d58e9560860d0322433 is not available`. (optional data: None). Request: {"jsonrpc":"2.0","method":"eth_getCode","params":["0x8f5d7348b71208d1025f84250722f9d6c35f27e1","0xd72139"],"id":2464}
      at EdrProviderWrapper.request (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:453:19)
      at EthersProviderWrapper.send (/Users/ikeralustiza/Documents/evm_test_suite/evm-tests/v3-core/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

Failed to generate 9 stack traces. Run Hardhat with --verbose to learn more.
error Command failed with exit code 96.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It seems that the test is expecting a concrete state when calling eth_getCode for these tests.

bee344 commented 6 days ago

Could you try again now? Remember to set the env var PRIVATE_KEY to your Infura API key, since it connects to an Infura provider.

IkerAlus commented 5 days ago

Could you try again now? Remember to set the env var PRIVATE_KEY to your Infura API key, since it connects to an Infura provider.

So this test will only work when setting the API keys, yes?

bee344 commented 5 days ago

So this test will only work when setting the API keys, yes?

Yes. The issue here was that the public endpoints for Polygon are few and unreliable, so we need to use Infura due to the lack of a dedicated provider, and for that you need an API key.

IkerAlus commented 5 days ago

then it would be nice to make it clear in the readme and/or disallow the "normal" option through the script