ApeWorX / ape

The smart contract development tool for Pythonistas, Data Scientists, and Security Professionals
https://apeworx.io
Apache License 2.0
889 stars 131 forks source link

value is not a valid integer (type=type_error.integer) #1549

Closed 0x0077 closed 1 year ago

0x0077 commented 1 year ago

Environment information

$ ape --version
0.6.13

$ ape plugins list
  foundry      0.6.11
  vyper        0.6.9
  etherscan    0.6.7
  alchemy      0.6.2
  hardhat      0.6.10
  solidity     0.6.7
  zksync       0.1.dev1+g5223f56
$ cat ape-config.yaml
plugins:
  - name: vyper
  - name: solidity
  - name: alchemy
  - name: etherscan
  - name: hardhat
  - name: foundry

default_ecosystem: ethereum

ethereum:
  default_network: mainnet-fork
  mainnet_fork:
    default_provider: hardhat
    gas_limit: max
    transaction_acceptance_timeout: 99999999
  mainnet:
    transaction_acceptance_timeout: 99999999

foundry:
  fork:
    ethereum:
      mainnet:
        upstream_provider: alchemy

hardhat:
  port: auto
  fork:
    ethereum:
      mainnet:
        upstream_provider: alchemy
        enable_hardhat_deployments: true

test:
  mnemonic: test test test test test test test test test test test junk
  number_of_accounts: 5

What went wrong?

Please include information like:

@pytest.fixture def owner(accounts): return accounts[0]

@pytest.fixture def token(project, owner): return owner.deploy(project.ERC20)

def test_token(token, onwer): assert token.balanceOf(owner) == 0


- full output of the error you received
return owner.deploy(project.ERC20)

E pydantic.error_wrappers.ValidationError: 1 validation error for Receipt E gas_price E value is not a valid integer (type=type_error.integer) owner = <TestAccount 0x1e59ce931B4CFea3fe4B875411e280e173cB7A9C> project = <ape.managers.project.manager.ProjectManager object at 0x130e78610> ======================================================================================= short test summary info ======================================================================================= ERROR tests/base/test_token.py::test_token - pydantic.error_wrappers.ValidationError: 1 validation error for Receipt



There are always new challenges. When I was testing my contract on the mainnet-fork, I encountered a new issue. After checking multiple times, I found that the error only reproduces when using hardhat as the node. However, I don't know how to fix it and really need help again.
sajal commented 1 year ago

We are facing the exact same issue.

We upgraded

ape from 0.6.7 to 0.6.13 ape-hardhat from 0.6.1 to 0.6.10

Higher up in the stack trace it shows

exception  = ValidationError(model='Receipt', errors=[{'loc': ('gas_price',), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}])

My guess is theres a change in the data format somewhere and the hardhat plugin hasnt been updated yet.

PS: we were using hardhat version 2.12.2, upgrading to 2.17.0 did not make any difference.

0x0077 commented 1 year ago

And I also encounter problems when I use the foundry. I'm confident that my configuration is correct.

$ ape console --network ethereum:mainnet-fork:foundry

INFO: Starting 'anvil' process.
ERROR: (FoundryNotInstalledError) Missing local Foundry node client. See ape-foundry README for install steps.
0x0077 commented 1 year ago

After I downgraded the APE version to 0.6.11, it started working.

fubuloubu commented 1 year ago

Still an issue, regression somewhere in recent history

scherrey commented 1 year ago

Any news on this? Blocking us from moving forward with Ape. Hoping to start a new Vyper project next week and would prefer to base it on Ape.

fubuloubu commented 1 year ago

Any news on this? Blocking us from moving forward with Ape. Hoping to start a new Vyper project next week and would prefer to base it on Ape.

@scherrey I believe #1542 resolves this (released in 0.6.14), can you try it and get back to us if it is still an issue?

antazoey commented 1 year ago

fixed by #1542