From b83547d1840fbc62618e50b414bdcdd997713bcc Mon Sep 17 00:00:00 2001 From: kimmy lin <30611210+countvonzero@users.noreply.github.com> Date: Wed, 5 Jul 2023 20:19:32 -0700 Subject: [PATCH 1/2] add Highest to get highest tick atx --- release/go/spacemesh/v1/activation.pb.go | 75 +++++++++++++++++++----- spacemesh/v1/activation.proto | 4 ++ 2 files changed, 65 insertions(+), 14 deletions(-) diff --git a/release/go/spacemesh/v1/activation.pb.go b/release/go/spacemesh/v1/activation.pb.go index fef00113..9d81263b 100644 --- a/release/go/spacemesh/v1/activation.pb.go +++ b/release/go/spacemesh/v1/activation.pb.go @@ -8,6 +8,7 @@ package v1 import ( context "context" + empty "github.com/golang/protobuf/ptypes/empty" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -31,27 +32,35 @@ var file_spacemesh_v1_activation_proto_rawDesc = []byte{ 0x0c, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x1a, 0x23, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x32, 0x4f, 0x0a, 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x18, - 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, + 0x8d, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x18, 0x2e, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_spacemesh_v1_activation_proto_goTypes = []interface{}{ (*GetRequest)(nil), // 0: spacemesh.v1.GetRequest - (*GetResponse)(nil), // 1: spacemesh.v1.GetResponse + (*empty.Empty)(nil), // 1: google.protobuf.Empty + (*GetResponse)(nil), // 2: spacemesh.v1.GetResponse } var file_spacemesh_v1_activation_proto_depIdxs = []int32{ 0, // 0: spacemesh.v1.ActivationService.Get:input_type -> spacemesh.v1.GetRequest - 1, // 1: spacemesh.v1.ActivationService.Get:output_type -> spacemesh.v1.GetResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type + 1, // 1: spacemesh.v1.ActivationService.Highest:input_type -> google.protobuf.Empty + 2, // 2: spacemesh.v1.ActivationService.Get:output_type -> spacemesh.v1.GetResponse + 2, // 3: spacemesh.v1.ActivationService.Highest:output_type -> spacemesh.v1.GetResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -96,6 +105,8 @@ const _ = grpc.SupportPackageIsVersion6 type ActivationServiceClient interface { // Get a single activation transaction Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) + // Highest returns the atx id with the highest tick count. + Highest(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetResponse, error) } type activationServiceClient struct { @@ -115,10 +126,21 @@ func (c *activationServiceClient) Get(ctx context.Context, in *GetRequest, opts return out, nil } +func (c *activationServiceClient) Highest(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetResponse, error) { + out := new(GetResponse) + err := c.cc.Invoke(ctx, "/spacemesh.v1.ActivationService/Highest", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ActivationServiceServer is the server API for ActivationService service. type ActivationServiceServer interface { // Get a single activation transaction Get(context.Context, *GetRequest) (*GetResponse, error) + // Highest returns the atx id with the highest tick count. + Highest(context.Context, *empty.Empty) (*GetResponse, error) } // UnimplementedActivationServiceServer can be embedded to have forward compatible implementations. @@ -128,6 +150,9 @@ type UnimplementedActivationServiceServer struct { func (*UnimplementedActivationServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") } +func (*UnimplementedActivationServiceServer) Highest(context.Context, *empty.Empty) (*GetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Highest not implemented") +} func RegisterActivationServiceServer(s *grpc.Server, srv ActivationServiceServer) { s.RegisterService(&_ActivationService_serviceDesc, srv) @@ -151,6 +176,24 @@ func _ActivationService_Get_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _ActivationService_Highest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ActivationServiceServer).Highest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spacemesh.v1.ActivationService/Highest", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ActivationServiceServer).Highest(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + var _ActivationService_serviceDesc = grpc.ServiceDesc{ ServiceName: "spacemesh.v1.ActivationService", HandlerType: (*ActivationServiceServer)(nil), @@ -159,6 +202,10 @@ var _ActivationService_serviceDesc = grpc.ServiceDesc{ MethodName: "Get", Handler: _ActivationService_Get_Handler, }, + { + MethodName: "Highest", + Handler: _ActivationService_Highest_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "spacemesh/v1/activation.proto", diff --git a/spacemesh/v1/activation.proto b/spacemesh/v1/activation.proto index 74b96b35..1f4ae122 100644 --- a/spacemesh/v1/activation.proto +++ b/spacemesh/v1/activation.proto @@ -3,9 +3,13 @@ package spacemesh.v1; option go_package = "github.com/spacemeshos/api/release/go/spacemesh/v1"; import "spacemesh/v1/activation_types.proto"; +import "google/protobuf/empty.proto"; // Exposes services to query activation transactions service ActivationService { // Get a single activation transaction rpc Get(GetRequest) returns (GetResponse); + + // Highest returns the atx id with the highest tick count. + rpc Highest(google.protobuf.Empty) returns (GetResponse); } From b554d3da77b2352fac437a3278952c5b1583cb3d Mon Sep 17 00:00:00 2001 From: kimmy lin <30611210+countvonzero@users.noreply.github.com> Date: Wed, 5 Jul 2023 20:27:45 -0700 Subject: [PATCH 2/2] dont share response type --- release/go/spacemesh/v1/activation.pb.go | 36 +++---- .../go/spacemesh/v1/activation_types.pb.go | 97 ++++++++++++++++--- spacemesh/v1/activation.proto | 2 +- spacemesh/v1/activation_types.proto | 4 + 4 files changed, 105 insertions(+), 34 deletions(-) diff --git a/release/go/spacemesh/v1/activation.pb.go b/release/go/spacemesh/v1/activation.pb.go index 9d81263b..9385eda1 100644 --- a/release/go/spacemesh/v1/activation.pb.go +++ b/release/go/spacemesh/v1/activation.pb.go @@ -34,31 +34,33 @@ var file_spacemesh_v1_activation_proto_rawDesc = []byte{ 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, - 0x8d, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x91, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x18, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, + 0x65, 0x12, 0x40, 0x0a, 0x07, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, - 0x73, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, + 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var file_spacemesh_v1_activation_proto_goTypes = []interface{}{ - (*GetRequest)(nil), // 0: spacemesh.v1.GetRequest - (*empty.Empty)(nil), // 1: google.protobuf.Empty - (*GetResponse)(nil), // 2: spacemesh.v1.GetResponse + (*GetRequest)(nil), // 0: spacemesh.v1.GetRequest + (*empty.Empty)(nil), // 1: google.protobuf.Empty + (*GetResponse)(nil), // 2: spacemesh.v1.GetResponse + (*HighestResponse)(nil), // 3: spacemesh.v1.HighestResponse } var file_spacemesh_v1_activation_proto_depIdxs = []int32{ 0, // 0: spacemesh.v1.ActivationService.Get:input_type -> spacemesh.v1.GetRequest 1, // 1: spacemesh.v1.ActivationService.Highest:input_type -> google.protobuf.Empty 2, // 2: spacemesh.v1.ActivationService.Get:output_type -> spacemesh.v1.GetResponse - 2, // 3: spacemesh.v1.ActivationService.Highest:output_type -> spacemesh.v1.GetResponse + 3, // 3: spacemesh.v1.ActivationService.Highest:output_type -> spacemesh.v1.HighestResponse 2, // [2:4] is the sub-list for method output_type 0, // [0:2] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -106,7 +108,7 @@ type ActivationServiceClient interface { // Get a single activation transaction Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) // Highest returns the atx id with the highest tick count. - Highest(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetResponse, error) + Highest(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*HighestResponse, error) } type activationServiceClient struct { @@ -126,8 +128,8 @@ func (c *activationServiceClient) Get(ctx context.Context, in *GetRequest, opts return out, nil } -func (c *activationServiceClient) Highest(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetResponse, error) { - out := new(GetResponse) +func (c *activationServiceClient) Highest(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*HighestResponse, error) { + out := new(HighestResponse) err := c.cc.Invoke(ctx, "/spacemesh.v1.ActivationService/Highest", in, out, opts...) if err != nil { return nil, err @@ -140,7 +142,7 @@ type ActivationServiceServer interface { // Get a single activation transaction Get(context.Context, *GetRequest) (*GetResponse, error) // Highest returns the atx id with the highest tick count. - Highest(context.Context, *empty.Empty) (*GetResponse, error) + Highest(context.Context, *empty.Empty) (*HighestResponse, error) } // UnimplementedActivationServiceServer can be embedded to have forward compatible implementations. @@ -150,7 +152,7 @@ type UnimplementedActivationServiceServer struct { func (*UnimplementedActivationServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") } -func (*UnimplementedActivationServiceServer) Highest(context.Context, *empty.Empty) (*GetResponse, error) { +func (*UnimplementedActivationServiceServer) Highest(context.Context, *empty.Empty) (*HighestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Highest not implemented") } diff --git a/release/go/spacemesh/v1/activation_types.pb.go b/release/go/spacemesh/v1/activation_types.pb.go index 7bbda730..6c3ef108 100644 --- a/release/go/spacemesh/v1/activation_types.pb.go +++ b/release/go/spacemesh/v1/activation_types.pb.go @@ -114,6 +114,53 @@ func (x *GetResponse) GetAtx() *Activation { return nil } +type HighestResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Atx *Activation `protobuf:"bytes,1,opt,name=atx,proto3" json:"atx,omitempty"` +} + +func (x *HighestResponse) Reset() { + *x = HighestResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v1_activation_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HighestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HighestResponse) ProtoMessage() {} + +func (x *HighestResponse) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v1_activation_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HighestResponse.ProtoReflect.Descriptor instead. +func (*HighestResponse) Descriptor() ([]byte, []int) { + return file_spacemesh_v1_activation_types_proto_rawDescGZIP(), []int{2} +} + +func (x *HighestResponse) GetAtx() *Activation { + if x != nil { + return x.Atx + } + return nil +} + var File_spacemesh_v1_activation_types_proto protoreflect.FileDescriptor var file_spacemesh_v1_activation_types_proto_rawDesc = []byte{ @@ -127,11 +174,15 @@ var file_spacemesh_v1_activation_types_proto_rawDesc = []byte{ 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x03, 0x61, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x03, 0x61, 0x74, 0x78, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x52, 0x03, 0x61, 0x74, 0x78, 0x22, 0x3d, 0x0a, 0x0f, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x03, 0x61, 0x74, 0x78, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x03, 0x61, 0x74, 0x78, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -146,19 +197,21 @@ func file_spacemesh_v1_activation_types_proto_rawDescGZIP() []byte { return file_spacemesh_v1_activation_types_proto_rawDescData } -var file_spacemesh_v1_activation_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_spacemesh_v1_activation_types_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_spacemesh_v1_activation_types_proto_goTypes = []interface{}{ - (*GetRequest)(nil), // 0: spacemesh.v1.GetRequest - (*GetResponse)(nil), // 1: spacemesh.v1.GetResponse - (*Activation)(nil), // 2: spacemesh.v1.Activation + (*GetRequest)(nil), // 0: spacemesh.v1.GetRequest + (*GetResponse)(nil), // 1: spacemesh.v1.GetResponse + (*HighestResponse)(nil), // 2: spacemesh.v1.HighestResponse + (*Activation)(nil), // 3: spacemesh.v1.Activation } var file_spacemesh_v1_activation_types_proto_depIdxs = []int32{ - 2, // 0: spacemesh.v1.GetResponse.atx:type_name -> spacemesh.v1.Activation - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 3, // 0: spacemesh.v1.GetResponse.atx:type_name -> spacemesh.v1.Activation + 3, // 1: spacemesh.v1.HighestResponse.atx:type_name -> spacemesh.v1.Activation + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_spacemesh_v1_activation_types_proto_init() } @@ -192,6 +245,18 @@ func file_spacemesh_v1_activation_types_proto_init() { return nil } } + file_spacemesh_v1_activation_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HighestResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -199,7 +264,7 @@ func file_spacemesh_v1_activation_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_spacemesh_v1_activation_types_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/spacemesh/v1/activation.proto b/spacemesh/v1/activation.proto index 1f4ae122..429e3c8c 100644 --- a/spacemesh/v1/activation.proto +++ b/spacemesh/v1/activation.proto @@ -11,5 +11,5 @@ service ActivationService { rpc Get(GetRequest) returns (GetResponse); // Highest returns the atx id with the highest tick count. - rpc Highest(google.protobuf.Empty) returns (GetResponse); + rpc Highest(google.protobuf.Empty) returns (HighestResponse); } diff --git a/spacemesh/v1/activation_types.proto b/spacemesh/v1/activation_types.proto index e5e09204..35303c84 100644 --- a/spacemesh/v1/activation_types.proto +++ b/spacemesh/v1/activation_types.proto @@ -11,3 +11,7 @@ message GetRequest { message GetResponse { Activation atx = 1; } + +message HighestResponse { + Activation atx = 1; +} \ No newline at end of file