-
Notifications
You must be signed in to change notification settings - Fork 3
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: grpc base structure #16
Conversation
@@ -119,8 +138,8 @@ func (g *GordianGRPC) GetValidators(ctx context.Context, req *GetValidatorsReque | |||
jsonValidators := make([]*Validator, len(vals)) | |||
for i, v := range vals { | |||
jsonValidators[i] = &Validator{ | |||
PubKey: reg.Marshal(v.PubKey), | |||
Power: v.Power, | |||
EncodedPubKey: reg.Marshal(v.PubKey), |
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.
ref comment: #8 (comment)
I like the idea of separating the Type from the core bytes of the PubKey. Will scoping for another PR. Just updating to EncodedPubKey
for now.
type PubKey interface {
PubKeyBytes() []byte
PubKeyType() string // or []byte?
Equal(other PubKey) bool
Verify(msg, sig []byte) bool
}
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 like the gordian.server.v1 rename. Let's bring the GRPCServerConfig
type back just for its use in the NewGordianGRPCServer
call. Then find | xargs
would be a nice to have too.
Summary
Refactors and adds context to some previous PR reviews made in #8