Skip to content

Commit

Permalink
proto fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nitronit committed Sep 7, 2023
1 parent 5cf7b40 commit 41d514d
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 116 deletions.
4 changes: 2 additions & 2 deletions cmd/horcrux/cmd/leader_election.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ horcrux elect 2 # elect specific leader`,
ctx, cancelFunc := context.WithTimeout(context.Background(), 30*time.Second)
defer cancelFunc()

grpcClient := proto.NewICosignerGRPCServerClient(conn)
grpcClient := proto.NewICosignerGRPCClient(conn)
_, err = grpcClient.TransferLeadership(
ctx,
&proto.CosignerGRPCTransferLeadershipRequest{LeaderID: leaderID},
Expand Down Expand Up @@ -167,7 +167,7 @@ func getLeaderCmd() *cobra.Command {
ctx, cancelFunc := context.WithTimeout(context.Background(), 30*time.Second)
defer cancelFunc()

grpcClient := proto.NewICosignerGRPCServerClient(conn)
grpcClient := proto.NewICosignerGRPCClient(conn)

res, err := grpcClient.GetLeader(ctx, &proto.CosignerGRPCGetLeaderRequest{})
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cosigner/remote_cosigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (cosigner *RemoteCosigner) VerifySignature(_ string, _, _ []byte) bool {
return false
}

func (cosigner *RemoteCosigner) getGRPCClient() (proto.ICosignerGRPCServerClient, *grpc.ClientConn, error) {
func (cosigner *RemoteCosigner) getGRPCClient() (proto.ICosignerGRPCClient, *grpc.ClientConn, error) {
var grpcAddress string
url, err := url.Parse(cosigner.address)
if err != nil {
Expand All @@ -80,7 +80,7 @@ func (cosigner *RemoteCosigner) getGRPCClient() (proto.ICosignerGRPCServerClient
if err != nil {
return nil, nil, err
}
return proto.NewICosignerGRPCServerClient(conn), conn, nil
return proto.NewICosignerGRPCClient(conn), conn, nil
}

// GetNonces implements the Cosigner interface
Expand Down
94 changes: 47 additions & 47 deletions pkg/proto/cosigner_grpc_server.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/proto/cosigner_grpc_server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ syntax = "proto3";
option go_package = "github.com/strangelove-ventures/horcrux/pkg/proto";

package proto;
// TODO: Rename it as GPRCserver. It makes more sense since we are using it for all connections.
// CosignerGRPC handles all the services (the server)
service ICosignerGRPCServer {
service ICosignerGRPC {
rpc SignBlock (CosignerGRPCSignBlockRequest) returns (CosignerGRPCSignBlockResponse) {}
rpc SetNoncesAndSign (CosignerGRPCSetNoncesAndSignRequest) returns (CosignerGRPCSetNoncesAndSignResponse) {}
rpc GetNonces (CosignerGRPCGetNoncesRequest) returns (CosignerGRPCGetNoncesResponse) {}
Expand Down
Loading

0 comments on commit 41d514d

Please sign in to comment.