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

AttributeError: 'ConstantinopleState' object has no attribute 'account_db' ` #163

Open
ldct opened this issue Jun 11, 2019 · 4 comments
Open

Comments

@ldct
Copy link
Contributor

ldct commented Jun 11, 2019

  • Version: 0.1.0b39
  • Python: 3.7.3
  • OS: macos

What was wrong?

python3 -m venv venv
source venv/bin/activate
pip3 install py-evm
pip3 install eth-tester
pip3 install eth-hash[pysha3]
python3
>>> from eth_tester import EthereumTester
>>> t = EthereumTester()
>>> t.get_balance(t.get_accounts()[0])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xuanji/gits/cf/py-evm-tester/venv/lib/python3.7/site-packages/eth_tester/main.py", line 225, in get_balance
    raw_balance = self.backend.get_balance(raw_account, raw_block_number)
  File "/Users/xuanji/gits/cf/py-evm-tester/venv/lib/python3.7/site-packages/eth_tester/backends/pyevm/main.py", line 394, in get_balance
    return vm.state.account_db.get_balance(account)
AttributeError: 'ConstantinopleState' object has no attribute 'account_db'

How can it be fixed?

¯\_(ツ)_/¯

@carver
Copy link
Contributor

carver commented Jun 11, 2019

eth-tester beta 3? You're a good long ways behind... Can you upgrade to beta 39?

@ldct
Copy link
Contributor Author

ldct commented Jun 11, 2019

I copied and pasted wrongly... the version should be 0.1.0b39. updated.

@pipermerriam
Copy link
Member

This already fixed on master.

return vm.state.get_balance(account)

You probably need to do something like pip install eth-tester[py-evm] to get the right versions.

@ldct
Copy link
Contributor Author

ldct commented Jun 14, 2019

@pipermerriam OK, after reading the setup.py more carefully I see why I triggered this bug. setup.py says it pins py-evm version, but actually this only means that installing eth-tester[py-evm] installs the specified version of py-evm. You can install incompatible versions of eth-tester and py-evm separately.

  1. Can the readme be updated to reflect this?
  2. Can a version check be added at runtime so that installing incompatible versions is not possible?

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

No branches or pull requests

3 participants