-
Notifications
You must be signed in to change notification settings - Fork 24
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
refactor signatureValidator #295
Conversation
5c5db12
to
f591e29
Compare
// may lead the caller to incorrectly believe that the | ||
// signature was invalid.) | ||
revert("SignatureValidator#isValidSignature: unsupported signature"); | ||
revert("SignatureValidator#isValidSignature: illegal signature"); |
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.
Maybe we can skip or replace SignatureValidator#isValidSignature
?
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.
@charlesjhongc Should the prefix be updated?
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.
Updated in 472d85b
// that we currently support. In this case returning false | ||
// may lead the caller to incorrectly believe that the | ||
// signature was invalid.) | ||
revert("SignatureValidator: unsupported signature"); |
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 will never be reached because we check signatureTypeRaw <= uint8(SignatureType.ZX1271)
?
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.
The SignatureType .Invalid
will reach here.
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.
Maybe can remove SignatureType.Illegal
case?
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.
Since Illegal
also serves the purpose of representing the default value of enum type, maybe we can remove Invalid
instead? (This final revert is implicitly the case for Invalid
anyway.)
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.
The goal is not changing the enum order. But if you're talking about if (signatureType == SignatureType.Illegal)
case, yeah I was thinking about removing this.
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.
yeah I was thinking about removing this.
Yeah that would make sense. Though I'm still not fully understand the difference between Illegal
and Invalid
.🧐
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.
After discussion, fixed in 472d85b
No description provided.