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

allow db implementations to have iterable views #2073

Open
charles-cooper opened this issue Jun 29, 2022 · 0 comments
Open

allow db implementations to have iterable views #2073

charles-cooper opened this issue Jun 29, 2022 · 0 comments

Comments

@charles-cooper
Copy link
Contributor

What is wrong?

currently, an AtomicDB cannot be iterated over. this makes it tricky to inspect, ex.

>>> t.env.vm.state._db.items()
ItemsView(<eth.db.atomic.AtomicDB object at 0x7fdf23f260e0>)
>>> list(t.env.vm.state._db.items())
NotImplementedError: By default, DB classes cannot return the total number of keys.

How can it be fixed

probably, add __iter__ and __len__ methods to all useful db classes

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

1 participant