/
block_service.pb.go
202 lines (176 loc) · 7.85 KB
/
block_service.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cometbft/services/block/v1/block_service.proto
package v1
import (
context "context"
fmt "fmt"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func init() {
proto.RegisterFile("cometbft/services/block/v1/block_service.proto", fileDescriptor_5768ae424af71eff)
}
var fileDescriptor_5768ae424af71eff = []byte{
// 219 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4b, 0xce, 0xcf, 0x4d,
0x2d, 0x49, 0x4a, 0x2b, 0xd1, 0x2f, 0x4e, 0x2d, 0x2a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 0xff, 0xab, 0x27, 0xc3, 0x98, 0xd2, 0x01, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// BlockServiceClient is the client API for BlockService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BlockServiceClient interface {
// GetBlock retrieves the block information at a particular height.
GetByHeight(ctx context.Context, in *GetByHeightRequest, opts ...grpc.CallOption) (*GetByHeightResponse, error)
// GetLatestHeight returns a stream of the latest block heights committed by
// the network. This is a long-lived stream that is only terminated by the
// server if an error occurs. The caller is expected to handle such
// disconnections and automatically reconnect.
GetLatestHeight(ctx context.Context, in *GetLatestHeightRequest, opts ...grpc.CallOption) (BlockService_GetLatestHeightClient, error)
}
type blockServiceClient struct {
cc grpc1.ClientConn
}
func NewBlockServiceClient(cc grpc1.ClientConn) BlockServiceClient {
return &blockServiceClient{cc}
}
func (c *blockServiceClient) GetByHeight(ctx context.Context, in *GetByHeightRequest, opts ...grpc.CallOption) (*GetByHeightResponse, error) {
out := new(GetByHeightResponse)
err := c.cc.Invoke(ctx, "/cometbft.services.block.v1.BlockService/GetByHeight", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blockServiceClient) GetLatestHeight(ctx context.Context, in *GetLatestHeightRequest, opts ...grpc.CallOption) (BlockService_GetLatestHeightClient, error) {
stream, err := c.cc.NewStream(ctx, &_BlockService_serviceDesc.Streams[0], "/cometbft.services.block.v1.BlockService/GetLatestHeight", opts...)
if err != nil {
return nil, err
}
x := &blockServiceGetLatestHeightClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type BlockService_GetLatestHeightClient interface {
Recv() (*GetLatestHeightResponse, error)
grpc.ClientStream
}
type blockServiceGetLatestHeightClient struct {
grpc.ClientStream
}
func (x *blockServiceGetLatestHeightClient) Recv() (*GetLatestHeightResponse, error) {
m := new(GetLatestHeightResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// BlockServiceServer is the server API for BlockService service.
type BlockServiceServer interface {
// GetBlock retrieves the block information at a particular height.
GetByHeight(context.Context, *GetByHeightRequest) (*GetByHeightResponse, error)
// GetLatestHeight returns a stream of the latest block heights committed by
// the network. This is a long-lived stream that is only terminated by the
// server if an error occurs. The caller is expected to handle such
// disconnections and automatically reconnect.
GetLatestHeight(*GetLatestHeightRequest, BlockService_GetLatestHeightServer) error
}
// UnimplementedBlockServiceServer can be embedded to have forward compatible implementations.
type UnimplementedBlockServiceServer struct {
}
func (*UnimplementedBlockServiceServer) GetByHeight(ctx context.Context, req *GetByHeightRequest) (*GetByHeightResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetByHeight not implemented")
}
func (*UnimplementedBlockServiceServer) GetLatestHeight(req *GetLatestHeightRequest, srv BlockService_GetLatestHeightServer) error {
return status.Errorf(codes.Unimplemented, "method GetLatestHeight not implemented")
}
func RegisterBlockServiceServer(s grpc1.Server, srv BlockServiceServer) {
s.RegisterService(&_BlockService_serviceDesc, srv)
}
func _BlockService_GetByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetByHeightRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlockServiceServer).GetByHeight(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/cometbft.services.block.v1.BlockService/GetByHeight",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlockServiceServer).GetByHeight(ctx, req.(*GetByHeightRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlockService_GetLatestHeight_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(GetLatestHeightRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(BlockServiceServer).GetLatestHeight(m, &blockServiceGetLatestHeightServer{stream})
}
type BlockService_GetLatestHeightServer interface {
Send(*GetLatestHeightResponse) error
grpc.ServerStream
}
type blockServiceGetLatestHeightServer struct {
grpc.ServerStream
}
func (x *blockServiceGetLatestHeightServer) Send(m *GetLatestHeightResponse) error {
return x.ServerStream.SendMsg(m)
}
var _BlockService_serviceDesc = grpc.ServiceDesc{
ServiceName: "cometbft.services.block.v1.BlockService",
HandlerType: (*BlockServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetByHeight",
Handler: _BlockService_GetByHeight_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "GetLatestHeight",
Handler: _BlockService_GetLatestHeight_Handler,
ServerStreams: true,
},
},
Metadata: "cometbft/services/block/v1/block_service.proto",
}