Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTransactionCount fails with a block identifier using web3[tester] #1801

Closed
Pet3ris opened this issue Nov 26, 2020 · 2 comments · Fixed by #2560
Closed

getTransactionCount fails with a block identifier using web3[tester] #1801

Pet3ris opened this issue Nov 26, 2020 · 2 comments · Fixed by #2560

Comments

@Pet3ris
Copy link

Pet3ris commented Nov 26, 2020

  • Version: 5.13.0
  • Python: 3.7
  • OS: osx

What was wrong?

import web3
import eth_tester

backend = eth_tester.PyEVMBackend()
w3 = web3.Web3(web3.Web3.EthereumTesterProvider(backend))

w3.eth.getTransactionCount(w3.eth.accounts[0], 0)

This code fails when it should succeed. It seems that web3.py automatically formats block references to hex numbers but eth-tester get_nonce expects it to be a number.

How can it be fixed?

This could possibly be an eth-tester issue but I've added it here for coverage.

@Pet3ris
Copy link
Author

Pet3ris commented Nov 27, 2020

Two possible fixes:

One would be to accept hexadecimal block numbers on the eth-tester side https://github.com/ethereum/eth-tester/blob/171dce6074d6ee1b7dd6d97dbd0df397259d421d/eth_tester/main.py#L242.

Another would be to fix the formatting for get_nonce rpc calls on the web3.py side.

@kclowes
Copy link
Collaborator

kclowes commented Nov 30, 2020

Thanks for the report @Pet3ris! I want to double check, but I think we'll want to fix this on the eth-tester side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants