-
Notifications
You must be signed in to change notification settings - Fork 247
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
Conversation
Jenkins BuildsClick to see older builds (8)
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/7.1.x #6216 +/- ##
=================================================
- Coverage 60.93% 60.92% -0.02%
=================================================
Files 832 832
Lines 109856 109865 +9
=================================================
- Hits 66943 66930 -13
- Misses 35066 35078 +12
- Partials 7847 7857 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@saledjenic pls take a look |
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.
@qfrank I'm ok to merge this for the release.
But for develop
branch please fix the code duplication. We already have similar functions used in this file:
Lines 149 to 150 in 3cf8b9b
address = removeHexPrefix(address) | |
addressHash := Sha3(strings.ToLower(address)) |
Perhaps Sha3
should do these 2 conversions.
There was a comment "implementation referenced from https://github.com/ChainSafe/web3.js/blob/edcd215bf657a4bba62fabaafd08e6e70040976e/packages/web3-utils/src/utils.js#L107" @igor-sirotin , its purpose was to align with |
Sure, and I even found that code and checked it. But the fact that code int that library is polluted, doesn't mean we should do the same to our codebase 🙂 Less duplication -> Less chance to face a bug later |
This reverts commit b84be51.
This reverts commit b84be51.
This PR adds a check to determine if a
str
starts with0x
.Relate mobile issue.
This is what
web3
implemented: