-
Notifications
You must be signed in to change notification settings - Fork 248
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
fix(sha3)_: support hex string (#6216) #6221
Conversation
Jenkins Builds
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6221 +/- ##
========================================
Coverage 61.43% 61.44%
========================================
Files 834 834
Lines 109931 109940 +9
========================================
+ Hits 67540 67554 +14
- Misses 34494 34497 +3
+ Partials 7897 7889 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
As discussed in DM, I still believe that this function could be simplified to smth like this:
str = hex.RemovePrefix(str)
str = hex.DecodeString(str)
bytes = crypto.Keccak256([]byte(str))
return common.Bytes2Hex(bytes)
And we wouldn't have to duplicate the regex.
But this is a minor thing and @qfrank prefers to keep the function exactly as in web3.js
, as it's what client was using before.
Anyway, this is not a big deal for me, so I'm approving.
c70e1ad
to
e01e489
Compare
cherry pick from PR