Began work on issue #22 - isValidSignatureForSolidity#24
Open
lennrt wants to merge 6 commits intoNickChapman:masterfrom
lennrt:isValidSignatureForSolidity
Open
Began work on issue #22 - isValidSignatureForSolidity#24lennrt wants to merge 6 commits intoNickChapman:masterfrom lennrt:isValidSignatureForSolidity
lennrt wants to merge 6 commits intoNickChapman:masterfrom
lennrt:isValidSignatureForSolidity
Conversation
NickChapman
requested changes
Feb 18, 2018
Owner
NickChapman
left a comment
There was a problem hiding this comment.
Some minor things but overall looks pretty good
servicesExternal/web3_single.py
Outdated
| Returns the keccak-256 hash of message, prefixed with the header used by the eth_sign RPC call | ||
| ethereumjs-util equivalent: https://github.com/ethereumjs/ethereumjs-util/blob/master/docs/index.md#hashpersonalmessage | ||
| ''' | ||
| if type(message) != bytes: |
Owner
There was a problem hiding this comment.
You should use isinstance instead of type
servicesExternal/web3_single.py
Outdated
| def keccak(bytes) -> str: | ||
| return sha3.keccak_256(bytes).digest() | ||
|
|
||
| def message_hash(message) -> str: |
Owner
There was a problem hiding this comment.
All method names should be camel case instead of snake case.
servicesExternal/web3_single.py
Outdated
| ECDSA public key recovery from signature | ||
| ethereumjs-util equivalent: https://github.com/ethereumjs/ethereumjs-util/blob/master/docs/index.md#ecrecover | ||
| ''' | ||
| assert len(hash) == 32 |
Owner
There was a problem hiding this comment.
For all of these asserts it would be nice if you could provide a description of why they are wrong so that people have an easier time debugging.
servicesExternal/web3_single.py
Outdated
| xc = r * r * r + 7 | ||
| return pow(xc, (SECP256K1P - 1) // 2, SECP256K1P) == 1 | ||
|
|
||
| def ecrecover_to_pub(hash, signature, chaincode = 27) -> str: |
Owner
There was a problem hiding this comment.
Can you add types to all of your function params (for all functions not just this one)
… snake_case to camelCase; added types to all function parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #22