diff --git a/cmd/horcrux/cmd/leader_election.go b/cmd/horcrux/cmd/leader_election.go index 363693b8..2d0f42bf 100644 --- a/cmd/horcrux/cmd/leader_election.go +++ b/cmd/horcrux/cmd/leader_election.go @@ -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}, @@ -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 { diff --git a/pkg/cosigner/remote_cosigner.go b/pkg/cosigner/remote_cosigner.go index d58f38b5..277d16e2 100644 --- a/pkg/cosigner/remote_cosigner.go +++ b/pkg/cosigner/remote_cosigner.go @@ -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 { @@ -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 diff --git a/pkg/proto/cosigner_grpc_server.pb.go b/pkg/proto/cosigner_grpc_server.pb.go index 599c9a3e..7a517121 100644 --- a/pkg/proto/cosigner_grpc_server.pb.go +++ b/pkg/proto/cosigner_grpc_server.pb.go @@ -859,43 +859,43 @@ var file_cosigner_grpc_server_proto_rawDesc = []byte{ 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x47, 0x65, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x32, 0x87, 0x04, 0x0a, 0x13, 0x49, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, - 0x47, 0x52, 0x50, 0x43, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x09, 0x53, 0x69, - 0x67, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x53, 0x69, 0x67, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, - 0x43, 0x53, 0x69, 0x67, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, - 0x73, 0x41, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x53, 0x65, 0x74, - 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x41, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, - 0x65, 0x73, 0x41, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, - 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x47, 0x52, 0x50, 0x43, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x73, 0x0a, - 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x68, 0x69, 0x70, 0x12, 0x2c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4c, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x58, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, - 0x47, 0x52, 0x50, 0x43, 0x47, 0x65, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x47, 0x65, 0x74, 0x4c, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, - 0x68, 0x6f, 0x72, 0x63, 0x72, 0x75, 0x78, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x32, 0x81, 0x04, 0x0a, 0x0d, 0x49, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x47, 0x52, 0x50, 0x43, 0x12, 0x58, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x53, 0x69, 0x67, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, + 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x53, 0x69, 0x67, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6d, + 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x41, 0x6e, 0x64, 0x53, 0x69, + 0x67, 0x6e, 0x12, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, + 0x41, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, + 0x52, 0x50, 0x43, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x41, 0x6e, 0x64, 0x53, + 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, + 0x09, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x47, + 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x47, 0x52, 0x50, 0x43, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x73, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x2c, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, + 0x50, 0x43, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x68, + 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x09, + 0x47, 0x65, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, 0x52, 0x50, 0x43, 0x47, 0x65, + 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x47, + 0x52, 0x50, 0x43, 0x47, 0x65, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, + 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x68, 0x6f, 0x72, 0x63, 0x72, 0x75, + 0x78, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -932,16 +932,16 @@ var file_cosigner_grpc_server_proto_depIdxs = []int32{ 4, // 2: proto.CosignerGRPCSetNoncesAndSignRequest.hrst:type_name -> proto.HRST 4, // 3: proto.CosignerGRPCGetNoncesRequest.hrst:type_name -> proto.HRST 3, // 4: proto.CosignerGRPCGetNoncesResponse.nonces:type_name -> proto.Nonce - 1, // 5: proto.ICosignerGRPCServer.SignBlock:input_type -> proto.CosignerGRPCSignBlockRequest - 5, // 6: proto.ICosignerGRPCServer.SetNoncesAndSign:input_type -> proto.CosignerGRPCSetNoncesAndSignRequest - 7, // 7: proto.ICosignerGRPCServer.GetNonces:input_type -> proto.CosignerGRPCGetNoncesRequest - 9, // 8: proto.ICosignerGRPCServer.TransferLeadership:input_type -> proto.CosignerGRPCTransferLeadershipRequest - 11, // 9: proto.ICosignerGRPCServer.GetLeader:input_type -> proto.CosignerGRPCGetLeaderRequest - 2, // 10: proto.ICosignerGRPCServer.SignBlock:output_type -> proto.CosignerGRPCSignBlockResponse - 6, // 11: proto.ICosignerGRPCServer.SetNoncesAndSign:output_type -> proto.CosignerGRPCSetNoncesAndSignResponse - 8, // 12: proto.ICosignerGRPCServer.GetNonces:output_type -> proto.CosignerGRPCGetNoncesResponse - 10, // 13: proto.ICosignerGRPCServer.TransferLeadership:output_type -> proto.CosignerGRPCTransferLeadershipResponse - 12, // 14: proto.ICosignerGRPCServer.GetLeader:output_type -> proto.CosignerGRPCGetLeaderResponse + 1, // 5: proto.ICosignerGRPC.SignBlock:input_type -> proto.CosignerGRPCSignBlockRequest + 5, // 6: proto.ICosignerGRPC.SetNoncesAndSign:input_type -> proto.CosignerGRPCSetNoncesAndSignRequest + 7, // 7: proto.ICosignerGRPC.GetNonces:input_type -> proto.CosignerGRPCGetNoncesRequest + 9, // 8: proto.ICosignerGRPC.TransferLeadership:input_type -> proto.CosignerGRPCTransferLeadershipRequest + 11, // 9: proto.ICosignerGRPC.GetLeader:input_type -> proto.CosignerGRPCGetLeaderRequest + 2, // 10: proto.ICosignerGRPC.SignBlock:output_type -> proto.CosignerGRPCSignBlockResponse + 6, // 11: proto.ICosignerGRPC.SetNoncesAndSign:output_type -> proto.CosignerGRPCSetNoncesAndSignResponse + 8, // 12: proto.ICosignerGRPC.GetNonces:output_type -> proto.CosignerGRPCGetNoncesResponse + 10, // 13: proto.ICosignerGRPC.TransferLeadership:output_type -> proto.CosignerGRPCTransferLeadershipResponse + 12, // 14: proto.ICosignerGRPC.GetLeader:output_type -> proto.CosignerGRPCGetLeaderResponse 10, // [10:15] is the sub-list for method output_type 5, // [5:10] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name diff --git a/pkg/proto/cosigner_grpc_server.proto b/pkg/proto/cosigner_grpc_server.proto index 1fcfc588..9987e3e9 100644 --- a/pkg/proto/cosigner_grpc_server.proto +++ b/pkg/proto/cosigner_grpc_server.proto @@ -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) {} diff --git a/pkg/proto/cosigner_grpc_server_grpc.pb.go b/pkg/proto/cosigner_grpc_server_grpc.pb.go index 3e1df9c9..c532ed00 100644 --- a/pkg/proto/cosigner_grpc_server_grpc.pb.go +++ b/pkg/proto/cosigner_grpc_server_grpc.pb.go @@ -18,10 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -// ICosignerGRPCServerClient is the client API for ICosignerGRPCServer service. +// ICosignerGRPCClient is the client API for ICosignerGRPC service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ICosignerGRPCServerClient interface { +type ICosignerGRPCClient interface { SignBlock(ctx context.Context, in *CosignerGRPCSignBlockRequest, opts ...grpc.CallOption) (*CosignerGRPCSignBlockResponse, error) SetNoncesAndSign(ctx context.Context, in *CosignerGRPCSetNoncesAndSignRequest, opts ...grpc.CallOption) (*CosignerGRPCSetNoncesAndSignResponse, error) GetNonces(ctx context.Context, in *CosignerGRPCGetNoncesRequest, opts ...grpc.CallOption) (*CosignerGRPCGetNoncesResponse, error) @@ -29,219 +29,219 @@ type ICosignerGRPCServerClient interface { GetLeader(ctx context.Context, in *CosignerGRPCGetLeaderRequest, opts ...grpc.CallOption) (*CosignerGRPCGetLeaderResponse, error) } -type iCosignerGRPCServerClient struct { +type iCosignerGRPCClient struct { cc grpc.ClientConnInterface } -func NewICosignerGRPCServerClient(cc grpc.ClientConnInterface) ICosignerGRPCServerClient { - return &iCosignerGRPCServerClient{cc} +func NewICosignerGRPCClient(cc grpc.ClientConnInterface) ICosignerGRPCClient { + return &iCosignerGRPCClient{cc} } -func (c *iCosignerGRPCServerClient) SignBlock(ctx context.Context, in *CosignerGRPCSignBlockRequest, opts ...grpc.CallOption) (*CosignerGRPCSignBlockResponse, error) { +func (c *iCosignerGRPCClient) SignBlock(ctx context.Context, in *CosignerGRPCSignBlockRequest, opts ...grpc.CallOption) (*CosignerGRPCSignBlockResponse, error) { out := new(CosignerGRPCSignBlockResponse) - err := c.cc.Invoke(ctx, "/proto.ICosignerGRPCServer/SignBlock", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ICosignerGRPC/SignBlock", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *iCosignerGRPCServerClient) SetNoncesAndSign(ctx context.Context, in *CosignerGRPCSetNoncesAndSignRequest, opts ...grpc.CallOption) (*CosignerGRPCSetNoncesAndSignResponse, error) { +func (c *iCosignerGRPCClient) SetNoncesAndSign(ctx context.Context, in *CosignerGRPCSetNoncesAndSignRequest, opts ...grpc.CallOption) (*CosignerGRPCSetNoncesAndSignResponse, error) { out := new(CosignerGRPCSetNoncesAndSignResponse) - err := c.cc.Invoke(ctx, "/proto.ICosignerGRPCServer/SetNoncesAndSign", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ICosignerGRPC/SetNoncesAndSign", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *iCosignerGRPCServerClient) GetNonces(ctx context.Context, in *CosignerGRPCGetNoncesRequest, opts ...grpc.CallOption) (*CosignerGRPCGetNoncesResponse, error) { +func (c *iCosignerGRPCClient) GetNonces(ctx context.Context, in *CosignerGRPCGetNoncesRequest, opts ...grpc.CallOption) (*CosignerGRPCGetNoncesResponse, error) { out := new(CosignerGRPCGetNoncesResponse) - err := c.cc.Invoke(ctx, "/proto.ICosignerGRPCServer/GetNonces", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ICosignerGRPC/GetNonces", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *iCosignerGRPCServerClient) TransferLeadership(ctx context.Context, in *CosignerGRPCTransferLeadershipRequest, opts ...grpc.CallOption) (*CosignerGRPCTransferLeadershipResponse, error) { +func (c *iCosignerGRPCClient) TransferLeadership(ctx context.Context, in *CosignerGRPCTransferLeadershipRequest, opts ...grpc.CallOption) (*CosignerGRPCTransferLeadershipResponse, error) { out := new(CosignerGRPCTransferLeadershipResponse) - err := c.cc.Invoke(ctx, "/proto.ICosignerGRPCServer/TransferLeadership", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ICosignerGRPC/TransferLeadership", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *iCosignerGRPCServerClient) GetLeader(ctx context.Context, in *CosignerGRPCGetLeaderRequest, opts ...grpc.CallOption) (*CosignerGRPCGetLeaderResponse, error) { +func (c *iCosignerGRPCClient) GetLeader(ctx context.Context, in *CosignerGRPCGetLeaderRequest, opts ...grpc.CallOption) (*CosignerGRPCGetLeaderResponse, error) { out := new(CosignerGRPCGetLeaderResponse) - err := c.cc.Invoke(ctx, "/proto.ICosignerGRPCServer/GetLeader", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ICosignerGRPC/GetLeader", in, out, opts...) if err != nil { return nil, err } return out, nil } -// ICosignerGRPCServerServer is the server API for ICosignerGRPCServer service. -// All implementations must embed UnimplementedICosignerGRPCServerServer +// ICosignerGRPCServer is the server API for ICosignerGRPC service. +// All implementations must embed UnimplementedICosignerGRPCServer // for forward compatibility -type ICosignerGRPCServerServer interface { +type ICosignerGRPCServer interface { SignBlock(context.Context, *CosignerGRPCSignBlockRequest) (*CosignerGRPCSignBlockResponse, error) SetNoncesAndSign(context.Context, *CosignerGRPCSetNoncesAndSignRequest) (*CosignerGRPCSetNoncesAndSignResponse, error) GetNonces(context.Context, *CosignerGRPCGetNoncesRequest) (*CosignerGRPCGetNoncesResponse, error) TransferLeadership(context.Context, *CosignerGRPCTransferLeadershipRequest) (*CosignerGRPCTransferLeadershipResponse, error) GetLeader(context.Context, *CosignerGRPCGetLeaderRequest) (*CosignerGRPCGetLeaderResponse, error) - mustEmbedUnimplementedICosignerGRPCServerServer() + mustEmbedUnimplementedICosignerGRPCServer() } -// UnimplementedICosignerGRPCServerServer must be embedded to have forward compatible implementations. -type UnimplementedICosignerGRPCServerServer struct { +// UnimplementedICosignerGRPCServer must be embedded to have forward compatible implementations. +type UnimplementedICosignerGRPCServer struct { } -func (UnimplementedICosignerGRPCServerServer) SignBlock(context.Context, *CosignerGRPCSignBlockRequest) (*CosignerGRPCSignBlockResponse, error) { +func (UnimplementedICosignerGRPCServer) SignBlock(context.Context, *CosignerGRPCSignBlockRequest) (*CosignerGRPCSignBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SignBlock not implemented") } -func (UnimplementedICosignerGRPCServerServer) SetNoncesAndSign(context.Context, *CosignerGRPCSetNoncesAndSignRequest) (*CosignerGRPCSetNoncesAndSignResponse, error) { +func (UnimplementedICosignerGRPCServer) SetNoncesAndSign(context.Context, *CosignerGRPCSetNoncesAndSignRequest) (*CosignerGRPCSetNoncesAndSignResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetNoncesAndSign not implemented") } -func (UnimplementedICosignerGRPCServerServer) GetNonces(context.Context, *CosignerGRPCGetNoncesRequest) (*CosignerGRPCGetNoncesResponse, error) { +func (UnimplementedICosignerGRPCServer) GetNonces(context.Context, *CosignerGRPCGetNoncesRequest) (*CosignerGRPCGetNoncesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNonces not implemented") } -func (UnimplementedICosignerGRPCServerServer) TransferLeadership(context.Context, *CosignerGRPCTransferLeadershipRequest) (*CosignerGRPCTransferLeadershipResponse, error) { +func (UnimplementedICosignerGRPCServer) TransferLeadership(context.Context, *CosignerGRPCTransferLeadershipRequest) (*CosignerGRPCTransferLeadershipResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TransferLeadership not implemented") } -func (UnimplementedICosignerGRPCServerServer) GetLeader(context.Context, *CosignerGRPCGetLeaderRequest) (*CosignerGRPCGetLeaderResponse, error) { +func (UnimplementedICosignerGRPCServer) GetLeader(context.Context, *CosignerGRPCGetLeaderRequest) (*CosignerGRPCGetLeaderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLeader not implemented") } -func (UnimplementedICosignerGRPCServerServer) mustEmbedUnimplementedICosignerGRPCServerServer() {} +func (UnimplementedICosignerGRPCServer) mustEmbedUnimplementedICosignerGRPCServer() {} -// UnsafeICosignerGRPCServerServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ICosignerGRPCServerServer will +// UnsafeICosignerGRPCServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ICosignerGRPCServer will // result in compilation errors. -type UnsafeICosignerGRPCServerServer interface { - mustEmbedUnimplementedICosignerGRPCServerServer() +type UnsafeICosignerGRPCServer interface { + mustEmbedUnimplementedICosignerGRPCServer() } -func RegisterICosignerGRPCServerServer(s grpc.ServiceRegistrar, srv ICosignerGRPCServerServer) { - s.RegisterService(&ICosignerGRPCServer_ServiceDesc, srv) +func RegisterICosignerGRPCServer(s grpc.ServiceRegistrar, srv ICosignerGRPCServer) { + s.RegisterService(&ICosignerGRPC_ServiceDesc, srv) } -func _ICosignerGRPCServer_SignBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ICosignerGRPC_SignBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CosignerGRPCSignBlockRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ICosignerGRPCServerServer).SignBlock(ctx, in) + return srv.(ICosignerGRPCServer).SignBlock(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.ICosignerGRPCServer/SignBlock", + FullMethod: "/proto.ICosignerGRPC/SignBlock", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ICosignerGRPCServerServer).SignBlock(ctx, req.(*CosignerGRPCSignBlockRequest)) + return srv.(ICosignerGRPCServer).SignBlock(ctx, req.(*CosignerGRPCSignBlockRequest)) } return interceptor(ctx, in, info, handler) } -func _ICosignerGRPCServer_SetNoncesAndSign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ICosignerGRPC_SetNoncesAndSign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CosignerGRPCSetNoncesAndSignRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ICosignerGRPCServerServer).SetNoncesAndSign(ctx, in) + return srv.(ICosignerGRPCServer).SetNoncesAndSign(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.ICosignerGRPCServer/SetNoncesAndSign", + FullMethod: "/proto.ICosignerGRPC/SetNoncesAndSign", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ICosignerGRPCServerServer).SetNoncesAndSign(ctx, req.(*CosignerGRPCSetNoncesAndSignRequest)) + return srv.(ICosignerGRPCServer).SetNoncesAndSign(ctx, req.(*CosignerGRPCSetNoncesAndSignRequest)) } return interceptor(ctx, in, info, handler) } -func _ICosignerGRPCServer_GetNonces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ICosignerGRPC_GetNonces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CosignerGRPCGetNoncesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ICosignerGRPCServerServer).GetNonces(ctx, in) + return srv.(ICosignerGRPCServer).GetNonces(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.ICosignerGRPCServer/GetNonces", + FullMethod: "/proto.ICosignerGRPC/GetNonces", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ICosignerGRPCServerServer).GetNonces(ctx, req.(*CosignerGRPCGetNoncesRequest)) + return srv.(ICosignerGRPCServer).GetNonces(ctx, req.(*CosignerGRPCGetNoncesRequest)) } return interceptor(ctx, in, info, handler) } -func _ICosignerGRPCServer_TransferLeadership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ICosignerGRPC_TransferLeadership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CosignerGRPCTransferLeadershipRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ICosignerGRPCServerServer).TransferLeadership(ctx, in) + return srv.(ICosignerGRPCServer).TransferLeadership(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.ICosignerGRPCServer/TransferLeadership", + FullMethod: "/proto.ICosignerGRPC/TransferLeadership", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ICosignerGRPCServerServer).TransferLeadership(ctx, req.(*CosignerGRPCTransferLeadershipRequest)) + return srv.(ICosignerGRPCServer).TransferLeadership(ctx, req.(*CosignerGRPCTransferLeadershipRequest)) } return interceptor(ctx, in, info, handler) } -func _ICosignerGRPCServer_GetLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ICosignerGRPC_GetLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CosignerGRPCGetLeaderRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ICosignerGRPCServerServer).GetLeader(ctx, in) + return srv.(ICosignerGRPCServer).GetLeader(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.ICosignerGRPCServer/GetLeader", + FullMethod: "/proto.ICosignerGRPC/GetLeader", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ICosignerGRPCServerServer).GetLeader(ctx, req.(*CosignerGRPCGetLeaderRequest)) + return srv.(ICosignerGRPCServer).GetLeader(ctx, req.(*CosignerGRPCGetLeaderRequest)) } return interceptor(ctx, in, info, handler) } -// ICosignerGRPCServer_ServiceDesc is the grpc.ServiceDesc for ICosignerGRPCServer service. +// ICosignerGRPC_ServiceDesc is the grpc.ServiceDesc for ICosignerGRPC service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var ICosignerGRPCServer_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "proto.ICosignerGRPCServer", - HandlerType: (*ICosignerGRPCServerServer)(nil), +var ICosignerGRPC_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.ICosignerGRPC", + HandlerType: (*ICosignerGRPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SignBlock", - Handler: _ICosignerGRPCServer_SignBlock_Handler, + Handler: _ICosignerGRPC_SignBlock_Handler, }, { MethodName: "SetNoncesAndSign", - Handler: _ICosignerGRPCServer_SetNoncesAndSign_Handler, + Handler: _ICosignerGRPC_SetNoncesAndSign_Handler, }, { MethodName: "GetNonces", - Handler: _ICosignerGRPCServer_GetNonces_Handler, + Handler: _ICosignerGRPC_GetNonces_Handler, }, { MethodName: "TransferLeadership", - Handler: _ICosignerGRPCServer_TransferLeadership_Handler, + Handler: _ICosignerGRPC_TransferLeadership_Handler, }, { MethodName: "GetLeader", - Handler: _ICosignerGRPCServer_GetLeader_Handler, + Handler: _ICosignerGRPC_GetLeader_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/test/validator.go b/test/validator.go index 3d293e7c..28cf4d6f 100644 --- a/test/validator.go +++ b/test/validator.go @@ -268,7 +268,7 @@ func getLeader(ctx context.Context, cosigner *cosmos.SidecarProcess) (string, er ctx, cancelFunc := context.WithTimeout(ctx, 10*time.Second) defer cancelFunc() - grpcClient := proto.NewICosignerGRPCServerClient(conn) + grpcClient := proto.NewICosignerGRPCClient(conn) res, err := grpcClient.GetLeader(ctx, &proto.CosignerGRPCGetLeaderRequest{}) if err != nil {