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

Snake case the remaining camels #3353

Merged
merged 2 commits into from Apr 18, 2024

Conversation

fselmo
Copy link
Collaborator

@fselmo fselmo commented Apr 17, 2024

What was wrong?

Closes #3085

How was it fixed?

  • snake-case remaining camel-cased arguments: fromBlock, toBlock, and blockHash

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

Screenshot 2024-04-17 at 17 02 17

fselmo added a commit to fselmo/web3.py that referenced this pull request Apr 17, 2024
- some remaining cases of ``blockHash``
- ``fromBlock``
- ``toBlock``

... add newsfragment for ethereum#3353
@fselmo fselmo force-pushed the snake-case-the-remaining-camels branch from cdf5d67 to b6dec86 Compare April 17, 2024 22:53
@fselmo fselmo marked this pull request as ready for review April 17, 2024 22:53
fselmo added a commit to fselmo/web3.py that referenced this pull request Apr 17, 2024
- some remaining cases of ``blockHash``
- ``fromBlock``
- ``toBlock``

... add newsfragment for ethereum#3353
@fselmo fselmo force-pushed the snake-case-the-remaining-camels branch from b6dec86 to 7e6f384 Compare April 17, 2024 22:58
fselmo added a commit to fselmo/web3.py that referenced this pull request Apr 17, 2024
- some remaining cases of ``blockHash``
- ``fromBlock``
- ``toBlock``

... add newsfragment for ethereum#3353
@fselmo fselmo force-pushed the snake-case-the-remaining-camels branch from 7e6f384 to 653b8cd Compare April 17, 2024 23:10
- some remaining cases of ``blockHash``
- ``fromBlock``
- ``toBlock``

... add newsfragment for ethereum#3353
@fselmo fselmo force-pushed the snake-case-the-remaining-camels branch from 653b8cd to 9f86289 Compare April 17, 2024 23:17
Copy link
Contributor

@pacrob pacrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐑

Copy link
Contributor

@reedsa reedsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@fselmo fselmo merged commit 332ff99 into ethereum:main Apr 18, 2024
57 checks passed
fselmo added a commit that referenced this pull request Apr 18, 2024
- some remaining cases of ``blockHash``
- ``fromBlock``
- ``toBlock``

... add newsfragment for #3353
@fselmo fselmo deleted the snake-case-the-remaining-camels branch April 18, 2024 16:56

Note that if a dictionary is used instead, say to a call such as `eth_getLogs`, the
keys in the dictionary should be camelCase. This is because the dictionary is passed
directly to the JSON-RPC request, where the keys are expected to be in camelCase.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding a formatter for the case of getLogs and friends? Basically it would look at the TxDict and flip any snake_case to camelCase to be passed on to the node. Then on the way back out it would do the same.

Copy link
Collaborator Author

@fselmo fselmo Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be good with that if the user experience would benefit from it. The way it is now, users are aware the transactions need to have camelCase arguments as well i.e. {"maxFeePerGas": 10**9, ...}. I think this is a similar case to that but I do think it's a touch more confusing because of the way it can be used by passing in kwargs which are snake-cased. I could go either way.

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 this pull request may close these issues.

Variables in code should follow standard conventions
4 participants