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
Add is_hexstr function #183
Add is_hexstr function #183
Conversation
As per ethereum#137, it was decided that a new function should be added with the signature above that returns 'False' on any non-string input. The function has been added with appropiate test cases.
Due to the implementation of `is_hexstr()`, calls to `is_text` are unneeded that occur before any call to `is_hexstr()`.
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 taking this on @swixx ! Just a couple thoughts and then we're good to merge!
- It can be helpful in the pr descriptions to put
fixes #183
instead ofper #183
since withfixes
it will automatically close the issue once this is merged. - If you could update the
docs/utilities.rst
file to match what's been done in this pr, that'd be great! (eg. note thatis_hex
is deprecated, and update theis_hex
docs tois_hexstr
)
eth_utils/hexadecimal.py
Outdated
warnings.warn( | ||
DeprecationWarning( | ||
"is_hex(value: Any) has been deprecated and will be removed in a subsequent major version " | ||
"release of the eth-utils library. Update your calls to use is_hexstr(Any) instead." |
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.
Nitpick: for consistency with the beginning of the warning msg consider updating to is_hexstr(value: Any)
Let's separate that part out into another issue. I think we might want to keep both versions, where |
@njgheorghita Made the requested changes. Per @carver's, I did not add anything to |
("0xabcdef1234567890", True), | ||
("0xABCDEF1234567890", True), | ||
("0xAbCdEf1234567890", True), | ||
("0XAbCdEf1234567890", True), |
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 like this line got duplicated
There's maybe some confusion around this from @carver's comment, at least there is on my end. I understood If correct, there's a couple last changes - thanks again @swixx , sorry about the endless nitpicks.
Finally, if you're up for it @swixx ...
Where you should deprecate |
Yup, thanks for clarifying @njgheorghita -- that's exactly what I meant. |
@carver will submit tonight. Just so we don't have to do another back and forth, how's the following?
|
Yup, looks good! |
Co-Authored-By: Jason Carver <ut96caarrs@snkmail.com>
@njgheorghita after you do your last lookover, no need to wait for me to merge 👍 |
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.
Excellent, thanks @swixx !!
What was wrong?
Fixes #137, it was decided that a second function
is_hexstr
should be added that returns False on anynon-string input call to the function.
How was it fixed?
The specified function was implemented.
To-Do
Cute Animal Picture