-
Notifications
You must be signed in to change notification settings - Fork 138
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
Key assignment related panic cleanup #642
Conversation
Nice job @smarshall-spitzbart! |
func TMCryptoPublicKeyToConsAddr(k tmprotocrypto.PublicKey) sdk.ConsAddress { | ||
// TMCryptoPublicKeyToConsAddr converts a TM public key to an SDK public key | ||
// and returns the associated consensus address | ||
func TMCryptoPublicKeyToConsAddr(k tmprotocrypto.PublicKey) (sdk.ConsAddress, error) { |
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.
@smarshall-spitzbart I changed this function to return error instead of panicking.
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.
Thanks @mpoke, looks great!
Re-reviewed myself and LGTM |
Description
WIP, optionally we can audit the key related panics in
x/ccv/utils/utils.go
in this PR as well.EDIT:
utils.TMCryptoPublicKeyToConsAddr
should return an error instead.Linked issues
Works toward #621
Type of change
If you've checked more than one of the first three boxes, consider splitting this PR into multiple PRs!
Feature
: Changes and/or adds code behavior, irrelevant to bug fixesFix
: Changes and/or adds code behavior, specifically to fix a bugRefactor
: Changes existing code style, naming, structure, etc.Testing
: Adds testingDocs
: Adds documentationRegression tests
If
Refactor
, describe the new or existing tests that verify no behavior was changed or added where refactors were introduced.New behavior tests
If
Feature
orFix
, describe the new or existing tests that verify the new behavior is correct and expected.