-
Notifications
You must be signed in to change notification settings - Fork 116
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
dot/rpc: Implement RPC method author_hasKey #877
Conversation
dot/core/service.go
Outdated
return false, err | ||
} | ||
cKeyType := keystore.DetermineKeyType(keyType) | ||
var err2 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.
why do you need err2
?
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 thought I had an issue with shadowing, but I see now that I didn't... Updated.
@@ -496,6 +497,31 @@ func (s *Service) InsertKey(kp crypto.Keypair) { | |||
s.keys.Insert(kp) | |||
} | |||
|
|||
// HasKey returns true if given hex encoded public key string is found in keystore, false otherwise, error if there | |||
// are issues decoding string | |||
func (s *Service) HasKey(pubKeyStr string, keyType string) (bool, 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.
this would probably be better as a function in the keystore package that can be wrapped by core
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.
Good idea, 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.
Nothing to add, just the comments from @noot. The main request for me would be moving HasKey
to keystore
to make it reusable elsewhere. Otherwise, looking good. Nothing blocking.
Updated key handling for grandpa to use Ed25519 type keys.
I've moved HasKey to keystore, and addressed other comments. This is ready for another look. |
* add stub for rpc call author_hasKey * implement rpc author_hasKey * add tests * update service test * add tests * Move HasKey function to keystore package. Updated key handling for grandpa to use Ed25519 type keys.
Changes
Tests:
Checklist:
Issues: