-
Notifications
You must be signed in to change notification settings - Fork 0
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
Frankie/milestone#signature validation #445
Conversation
…what it is. it should be a hex encode string of the message you wish to sign
…o the signing manager
return signatureVerify(message, signature, address).isValid | ||
} | ||
|
||
throw new Error(`unsupported hashType: ${hashType}`) |
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.
minor nitpick, what if we move this error handling to the above block of if-statements that throw errors if data is missing?
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.
not a blocker for merging
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.
this is a fair point. i worry about having functions that potentially do nothing so when in doubt throw errors. but can see if their is a nice way to move that check up some how that still results in a sensible return. ie: return: Promise<true/false>/Error
* @returns {string} The string without the '0x' prefix. | ||
*/ | ||
|
||
export function addHexPrefix (str: string): string { |
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.
this fn isnt just adding a hex prefix, it also checks to see if the string already is a hex string with prefix, what do you think about changing the fn name to be more descriptive like checkOrAddHexPrefix
?
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.
checkOrAddHexPrefix
seems like unnecessary verbosity
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.
how ever the docs are wrong 😅 so ill fix that
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.
i dont want to ad a 0x
if one is already their that would make it invalid so i'm doing what is required of a function that would add a hex prefix with out invalidating the string
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.
couple minor questions/suggestions, other than that looks good
closes #438
closes #434
closes #442