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

eth.get_storage_at() missing block_identifier kwarg in typing #3114

Closed
antazoey opened this issue Oct 2, 2023 · 0 comments · Fixed by #3123
Closed

eth.get_storage_at() missing block_identifier kwarg in typing #3114

antazoey opened this issue Oct 2, 2023 · 0 comments · Fixed by #3123

Comments

@antazoey
Copy link
Contributor

antazoey commented Oct 2, 2023

  • Version: main branch
  • Python: 3.10.12
  • OS: macOS
  • pip freeze output
ill paste if required.

What was wrong?

type checkers do not like the block_identifier optional kwarg to web3.eth.get_storage_at().
I am wondering if we can add the block ID kwarg the same as the rest of them that support it?
It is listed here: https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat

How can it be fixed?

I think add Optional[BlockIdentifier] to the method type input, like this:

    # eth_getStorageAt

    get_storage_at: Method[
        Callable[[Union[Address, ChecksumAddress, ENS], int], HexBytes, Optional[BlockIdentifier]]
    ] = Method(
        RPC.eth_getStorageAt,
        mungers=[BaseEth.get_storage_at_munger],
    )

right now it is just Callable[[Union[Address, ChecksumAddress, ENS], int], HexBytes]


Note: We prefer to use issues to track our work. If you think you've encountered a bug in web3py or
have a feature request, you're in the right place. If you have implementation or usage questions,
please refer to our documentation and/or join the conversation
on discord.

@antazoey antazoey changed the title get_storage_at missing block_identifier kwarg in typing eth.get_storage_at() missing block_identifier kwarg in typing Oct 2, 2023
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.

1 participant