-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Deprecate eth.get_uncle* methods #3685
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
Conversation
e1fe0d6 to
6b6b769
Compare
|
wdyt @kclowes? |
kclowes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! There were just a few nits that I left that should be addressed. We'll also need to add the warning to the AsyncEth module as well. Let me know if you want me to pick it up.
| self, w3: "Web3", empty_block: BlockData | ||
| ) -> None: | ||
| uncle_count = w3.eth.get_uncle_count(empty_block["hash"]) | ||
| with pytest.warns(DeprecationWarning): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We like to match on the message for deprecation warnings, so this would just need a match=r"All get_uncle\* methods have been deprecated"
| self, w3: "Web3", empty_block: BlockData | ||
| ) -> None: | ||
| uncle_count = w3.eth.get_uncle_count(empty_block["number"]) | ||
| with pytest.warns(DeprecationWarning): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, add match keyword
33c1be1 to
46fb659
Compare
Thanks for the feedback. Idk how I missed the async method, my bad. Is the double underscore version ok, or shall I just add the warning into the async function please? Afais the failing tests are not connected to the change, but let me know if otherwise. |
kclowes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates! I left a comment on the async methods to give you some direction there. Let me know if that doesn't work, or if this is turning into more work than you signed up for and you want to hand it off!
46fb659 to
6b0d8a7
Compare
|
Actually, I'm looking at this, and I think we can just use the |
20c62ea to
3d66182
Compare
3d66182 to
852ec90
Compare
No problem, I have replaced now with |
kclowes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks @tibor-reiss!
M66rr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
What was wrong?
Closes #3683
How was it fixed?
Warn users that eth.get_uncle* will be dropped in v8.
Todo:
Cute Animal Picture