Skip to content
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

Merged
merged 9 commits into from
Aug 23, 2024
Merged

refactor: grpc base structure #16

merged 9 commits into from
Aug 23, 2024

Conversation

Reecepbcups
Copy link
Contributor

Summary

Refactors and adds context to some previous PR reviews made in #8

gcosmos/gserver/internal/ggrpc/server.go Outdated Show resolved Hide resolved
@@ -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),
Copy link
Contributor Author

@Reecepbcups Reecepbcups Aug 21, 2024

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
}

gcosmos/gserver/internal/ggrpc/server.go Outdated Show resolved Hide resolved
@Reecepbcups Reecepbcups marked this pull request as ready for review August 21, 2024 23:22
Copy link
Member

@mark-rushakoff mark-rushakoff left a 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.

gcosmos/scripts/protocgen.sh Show resolved Hide resolved
gcosmos/gserver/internal/ggrpc/server.go Outdated Show resolved Hide resolved
gcosmos/gserver/internal/ggrpc/server.go Outdated Show resolved Hide resolved
gcosmos/gserver/internal/ggrpc/server.go Outdated Show resolved Hide resolved
gcosmos/gserver/internal/ggrpc/server.go Outdated Show resolved Hide resolved
@mark-rushakoff mark-rushakoff merged commit ca3a882 into main Aug 23, 2024
0 of 2 checks passed
@mark-rushakoff mark-rushakoff deleted the reece/grpc-cleanup branch August 23, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants