diff --git a/buf.yaml b/buf.yaml index cc4aced576..71cf9ca185 100644 --- a/buf.yaml +++ b/buf.yaml @@ -9,6 +9,8 @@ lint: - BASIC - FILE_LOWER_SNAKE_CASE - UNARY_RPC + except: + - RPC_NO_SERVER_STREAMING ignore: - gogoproto breaking: diff --git a/proto/buf.yaml b/proto/buf.yaml index 90988439bb..197d20181e 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -10,3 +10,5 @@ lint: - BASIC - FILE_LOWER_SNAKE_CASE - UNARY_RPC + except: + - RPC_NO_SERVER_STREAMING diff --git a/proto/tendermint/rpc/grpc/types.pb.go b/proto/tendermint/rpc/grpc/types.pb.go index b9cbee03fc..e49e9dc121 100644 --- a/proto/tendermint/rpc/grpc/types.pb.go +++ b/proto/tendermint/rpc/grpc/types.pb.go @@ -6,20 +6,28 @@ package coregrpc import ( context "context" fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types "github.com/tendermint/tendermint/abci/types" + crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + p2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + types1 "github.com/tendermint/tendermint/proto/tendermint/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -107,6 +115,358 @@ func (m *RequestBroadcastTx) GetTx() []byte { return nil } +type BlockByHashRequest struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Prove bool `protobuf:"varint,2,opt,name=prove,proto3" json:"prove,omitempty"` +} + +func (m *BlockByHashRequest) Reset() { *m = BlockByHashRequest{} } +func (m *BlockByHashRequest) String() string { return proto.CompactTextString(m) } +func (*BlockByHashRequest) ProtoMessage() {} +func (*BlockByHashRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{2} +} +func (m *BlockByHashRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockByHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockByHashRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockByHashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockByHashRequest.Merge(m, src) +} +func (m *BlockByHashRequest) XXX_Size() int { + return m.Size() +} +func (m *BlockByHashRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BlockByHashRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockByHashRequest proto.InternalMessageInfo + +func (m *BlockByHashRequest) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *BlockByHashRequest) GetProve() bool { + if m != nil { + return m.Prove + } + return false +} + +type BlockByHeightRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Prove bool `protobuf:"varint,2,opt,name=prove,proto3" json:"prove,omitempty"` +} + +func (m *BlockByHeightRequest) Reset() { *m = BlockByHeightRequest{} } +func (m *BlockByHeightRequest) String() string { return proto.CompactTextString(m) } +func (*BlockByHeightRequest) ProtoMessage() {} +func (*BlockByHeightRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{3} +} +func (m *BlockByHeightRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockByHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockByHeightRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockByHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockByHeightRequest.Merge(m, src) +} +func (m *BlockByHeightRequest) XXX_Size() int { + return m.Size() +} +func (m *BlockByHeightRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BlockByHeightRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockByHeightRequest proto.InternalMessageInfo + +func (m *BlockByHeightRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *BlockByHeightRequest) GetProve() bool { + if m != nil { + return m.Prove + } + return false +} + +type BlockMetaByHashRequest struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *BlockMetaByHashRequest) Reset() { *m = BlockMetaByHashRequest{} } +func (m *BlockMetaByHashRequest) String() string { return proto.CompactTextString(m) } +func (*BlockMetaByHashRequest) ProtoMessage() {} +func (*BlockMetaByHashRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{4} +} +func (m *BlockMetaByHashRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockMetaByHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetaByHashRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockMetaByHashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetaByHashRequest.Merge(m, src) +} +func (m *BlockMetaByHashRequest) XXX_Size() int { + return m.Size() +} +func (m *BlockMetaByHashRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetaByHashRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockMetaByHashRequest proto.InternalMessageInfo + +func (m *BlockMetaByHashRequest) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +type BlockMetaByHeightRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *BlockMetaByHeightRequest) Reset() { *m = BlockMetaByHeightRequest{} } +func (m *BlockMetaByHeightRequest) String() string { return proto.CompactTextString(m) } +func (*BlockMetaByHeightRequest) ProtoMessage() {} +func (*BlockMetaByHeightRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{5} +} +func (m *BlockMetaByHeightRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockMetaByHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetaByHeightRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockMetaByHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetaByHeightRequest.Merge(m, src) +} +func (m *BlockMetaByHeightRequest) XXX_Size() int { + return m.Size() +} +func (m *BlockMetaByHeightRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetaByHeightRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockMetaByHeightRequest proto.InternalMessageInfo + +func (m *BlockMetaByHeightRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +type CommitRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *CommitRequest) Reset() { *m = CommitRequest{} } +func (m *CommitRequest) String() string { return proto.CompactTextString(m) } +func (*CommitRequest) ProtoMessage() {} +func (*CommitRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{6} +} +func (m *CommitRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommitRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CommitRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitRequest.Merge(m, src) +} +func (m *CommitRequest) XXX_Size() int { + return m.Size() +} +func (m *CommitRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CommitRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CommitRequest proto.InternalMessageInfo + +func (m *CommitRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +type ValidatorSetRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *ValidatorSetRequest) Reset() { *m = ValidatorSetRequest{} } +func (m *ValidatorSetRequest) String() string { return proto.CompactTextString(m) } +func (*ValidatorSetRequest) ProtoMessage() {} +func (*ValidatorSetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{7} +} +func (m *ValidatorSetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorSetRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorSetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorSetRequest.Merge(m, src) +} +func (m *ValidatorSetRequest) XXX_Size() int { + return m.Size() +} +func (m *ValidatorSetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorSetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorSetRequest proto.InternalMessageInfo + +func (m *ValidatorSetRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +type SubscribeNewHeightsRequest struct { +} + +func (m *SubscribeNewHeightsRequest) Reset() { *m = SubscribeNewHeightsRequest{} } +func (m *SubscribeNewHeightsRequest) String() string { return proto.CompactTextString(m) } +func (*SubscribeNewHeightsRequest) ProtoMessage() {} +func (*SubscribeNewHeightsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{8} +} +func (m *SubscribeNewHeightsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SubscribeNewHeightsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SubscribeNewHeightsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SubscribeNewHeightsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubscribeNewHeightsRequest.Merge(m, src) +} +func (m *SubscribeNewHeightsRequest) XXX_Size() int { + return m.Size() +} +func (m *SubscribeNewHeightsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SubscribeNewHeightsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SubscribeNewHeightsRequest proto.InternalMessageInfo + +type StatusRequest struct { +} + +func (m *StatusRequest) Reset() { *m = StatusRequest{} } +func (m *StatusRequest) String() string { return proto.CompactTextString(m) } +func (*StatusRequest) ProtoMessage() {} +func (*StatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{9} +} +func (m *StatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusRequest.Merge(m, src) +} +func (m *StatusRequest) XXX_Size() int { + return m.Size() +} +func (m *StatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusRequest proto.InternalMessageInfo + type ResponsePing struct { } @@ -114,7 +474,7 @@ func (m *ResponsePing) Reset() { *m = ResponsePing{} } func (m *ResponsePing) String() string { return proto.CompactTextString(m) } func (*ResponsePing) ProtoMessage() {} func (*ResponsePing) Descriptor() ([]byte, []int) { - return fileDescriptor_0ffff5682c662b95, []int{2} + return fileDescriptor_0ffff5682c662b95, []int{10} } func (m *ResponsePing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -152,7 +512,7 @@ func (m *ResponseBroadcastTx) Reset() { *m = ResponseBroadcastTx{} } func (m *ResponseBroadcastTx) String() string { return proto.CompactTextString(m) } func (*ResponseBroadcastTx) ProtoMessage() {} func (*ResponseBroadcastTx) Descriptor() ([]byte, []int) { - return fileDescriptor_0ffff5682c662b95, []int{3} + return fileDescriptor_0ffff5682c662b95, []int{11} } func (m *ResponseBroadcastTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -195,425 +555,4608 @@ func (m *ResponseBroadcastTx) GetDeliverTx() *types.ResponseDeliverTx { return nil } -func init() { - proto.RegisterType((*RequestPing)(nil), "tendermint.rpc.grpc.RequestPing") - proto.RegisterType((*RequestBroadcastTx)(nil), "tendermint.rpc.grpc.RequestBroadcastTx") - proto.RegisterType((*ResponsePing)(nil), "tendermint.rpc.grpc.ResponsePing") - proto.RegisterType((*ResponseBroadcastTx)(nil), "tendermint.rpc.grpc.ResponseBroadcastTx") +type BlockByHashResponse struct { + BlockPart *types1.Part `protobuf:"bytes,1,opt,name=block_part,json=blockPart,proto3" json:"block_part,omitempty"` + Commit *types1.Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,3,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + BlockMeta *types1.BlockMeta `protobuf:"bytes,4,opt,name=block_meta,json=blockMeta,proto3" json:"block_meta,omitempty"` + IsLast bool `protobuf:"varint,5,opt,name=is_last,json=isLast,proto3" json:"is_last,omitempty"` } -func init() { proto.RegisterFile("tendermint/rpc/grpc/types.proto", fileDescriptor_0ffff5682c662b95) } - -var fileDescriptor_0ffff5682c662b95 = []byte{ - // 316 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0x49, 0xcd, 0x4b, - 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0x2a, 0x48, 0xd6, 0x4f, 0x07, 0x11, 0x25, 0x95, - 0x05, 0xa9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xc2, 0x08, 0x05, 0x7a, 0x45, 0x05, - 0xc9, 0x7a, 0x20, 0x05, 0x52, 0xd2, 0x48, 0xba, 0x12, 0x93, 0x92, 0x33, 0x91, 0x75, 0x28, 0xf1, - 0x72, 0x71, 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x04, 0x64, 0xe6, 0xa5, 0x2b, 0xa9, 0x70, - 0x09, 0x41, 0xb9, 0x4e, 0x45, 0xf9, 0x89, 0x29, 0xc9, 0x89, 0xc5, 0x25, 0x21, 0x15, 0x42, 0x7c, - 0x5c, 0x4c, 0x25, 0x15, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x4c, 0x25, 0x15, 0x4a, 0x7c, - 0x5c, 0x3c, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x60, 0x5d, 0x53, 0x19, 0xb9, 0x84, - 0x61, 0x02, 0xc8, 0xfa, 0xac, 0xb9, 0x38, 0x92, 0x33, 0x52, 0x93, 0xb3, 0xe3, 0xa1, 0xba, 0xb9, - 0x8d, 0x14, 0xf4, 0x90, 0x5c, 0x08, 0x72, 0x8c, 0x1e, 0x4c, 0x9f, 0x33, 0x48, 0x61, 0x48, 0x45, - 0x10, 0x7b, 0x32, 0x84, 0x21, 0xe4, 0xc8, 0xc5, 0x95, 0x92, 0x9a, 0x93, 0x59, 0x96, 0x5a, 0x04, - 0xd2, 0xce, 0x04, 0xd6, 0xae, 0x84, 0x53, 0xbb, 0x0b, 0x44, 0x69, 0x48, 0x45, 0x10, 0x67, 0x0a, - 0x8c, 0x69, 0xb4, 0x97, 0x91, 0x8b, 0x07, 0xee, 0x1e, 0xc7, 0x00, 0x4f, 0x21, 0x6f, 0x2e, 0x16, - 0x90, 0x83, 0x85, 0x50, 0x9c, 0x01, 0x0b, 0x28, 0x3d, 0xa4, 0x80, 0x90, 0x52, 0xc4, 0xa1, 0x02, - 0xe1, 0x6b, 0xa1, 0x04, 0x2e, 0x6e, 0x64, 0xcf, 0xaa, 0xe3, 0x33, 0x13, 0x49, 0xa1, 0x94, 0x06, - 0x5e, 0xa3, 0x91, 0x54, 0x3a, 0xf9, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, - 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, - 0x94, 0x51, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x52, 0xf4, 0x62, - 0x49, 0x1f, 0xd6, 0xc9, 0xf9, 0x45, 0xa9, 0x20, 0x46, 0x12, 0x1b, 0x38, 0xc6, 0x8d, 0x01, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xf6, 0x4b, 0x02, 0xd8, 0x46, 0x02, 0x00, 0x00, +func (m *BlockByHashResponse) Reset() { *m = BlockByHashResponse{} } +func (m *BlockByHashResponse) String() string { return proto.CompactTextString(m) } +func (*BlockByHashResponse) ProtoMessage() {} +func (*BlockByHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{12} +} +func (m *BlockByHashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockByHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockByHashResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockByHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockByHashResponse.Merge(m, src) +} +func (m *BlockByHashResponse) XXX_Size() int { + return m.Size() +} +func (m *BlockByHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BlockByHashResponse.DiscardUnknown(m) } -// 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 +var xxx_messageInfo_BlockByHashResponse proto.InternalMessageInfo -// BroadcastAPIClient is the client API for BroadcastAPI service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type BroadcastAPIClient interface { - Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) - BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) +func (m *BlockByHashResponse) GetBlockPart() *types1.Part { + if m != nil { + return m.BlockPart + } + return nil } -type broadcastAPIClient struct { - cc *grpc.ClientConn +func (m *BlockByHashResponse) GetCommit() *types1.Commit { + if m != nil { + return m.Commit + } + return nil } -func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient { - return &broadcastAPIClient{cc} +func (m *BlockByHashResponse) GetValidatorSet() *types1.ValidatorSet { + if m != nil { + return m.ValidatorSet + } + return nil } -func (c *broadcastAPIClient) Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) { - out := new(ResponsePing) - err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BroadcastAPI/Ping", in, out, opts...) - if err != nil { - return nil, err +func (m *BlockByHashResponse) GetBlockMeta() *types1.BlockMeta { + if m != nil { + return m.BlockMeta } - return out, nil + return nil } -func (c *broadcastAPIClient) BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) { - out := new(ResponseBroadcastTx) - err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BroadcastAPI/BroadcastTx", in, out, opts...) - if err != nil { - return nil, err +func (m *BlockByHashResponse) GetIsLast() bool { + if m != nil { + return m.IsLast } - return out, nil + return false } -// BroadcastAPIServer is the server API for BroadcastAPI service. -type BroadcastAPIServer interface { - Ping(context.Context, *RequestPing) (*ResponsePing, error) - BroadcastTx(context.Context, *RequestBroadcastTx) (*ResponseBroadcastTx, error) +type BlockByHeightResponse struct { + BlockPart *types1.Part `protobuf:"bytes,1,opt,name=block_part,json=blockPart,proto3" json:"block_part,omitempty"` + Commit *types1.Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,3,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + BlockMeta *types1.BlockMeta `protobuf:"bytes,4,opt,name=block_meta,json=blockMeta,proto3" json:"block_meta,omitempty"` + IsLast bool `protobuf:"varint,5,opt,name=is_last,json=isLast,proto3" json:"is_last,omitempty"` } -// UnimplementedBroadcastAPIServer can be embedded to have forward compatible implementations. -type UnimplementedBroadcastAPIServer struct { +func (m *BlockByHeightResponse) Reset() { *m = BlockByHeightResponse{} } +func (m *BlockByHeightResponse) String() string { return proto.CompactTextString(m) } +func (*BlockByHeightResponse) ProtoMessage() {} +func (*BlockByHeightResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{13} } - -func (*UnimplementedBroadcastAPIServer) Ping(ctx context.Context, req *RequestPing) (*ResponsePing, error) { - return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +func (m *BlockByHeightResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedBroadcastAPIServer) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) { - return nil, status.Errorf(codes.Unimplemented, "method BroadcastTx not implemented") +func (m *BlockByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockByHeightResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } - -func RegisterBroadcastAPIServer(s *grpc.Server, srv BroadcastAPIServer) { - s.RegisterService(&_BroadcastAPI_serviceDesc, srv) +func (m *BlockByHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockByHeightResponse.Merge(m, src) +} +func (m *BlockByHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *BlockByHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BlockByHeightResponse.DiscardUnknown(m) } -func _BroadcastAPI_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestPing) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BroadcastAPIServer).Ping(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/tendermint.rpc.grpc.BroadcastAPI/Ping", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BroadcastAPIServer).Ping(ctx, req.(*RequestPing)) +var xxx_messageInfo_BlockByHeightResponse proto.InternalMessageInfo + +func (m *BlockByHeightResponse) GetBlockPart() *types1.Part { + if m != nil { + return m.BlockPart } - return interceptor(ctx, in, info, handler) + return nil } -func _BroadcastAPI_BroadcastTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestBroadcastTx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BroadcastAPIServer).BroadcastTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/tendermint.rpc.grpc.BroadcastAPI/BroadcastTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BroadcastAPIServer).BroadcastTx(ctx, req.(*RequestBroadcastTx)) +func (m *BlockByHeightResponse) GetCommit() *types1.Commit { + if m != nil { + return m.Commit } - return interceptor(ctx, in, info, handler) + return nil } -var _BroadcastAPI_serviceDesc = grpc.ServiceDesc{ - ServiceName: "tendermint.rpc.grpc.BroadcastAPI", - HandlerType: (*BroadcastAPIServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Ping", - Handler: _BroadcastAPI_Ping_Handler, - }, - { - MethodName: "BroadcastTx", - Handler: _BroadcastAPI_BroadcastTx_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "tendermint/rpc/grpc/types.proto", +func (m *BlockByHeightResponse) GetValidatorSet() *types1.ValidatorSet { + if m != nil { + return m.ValidatorSet + } + return nil } -func (m *RequestPing) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *BlockByHeightResponse) GetBlockMeta() *types1.BlockMeta { + if m != nil { + return m.BlockMeta } - return dAtA[:n], nil + return nil } -func (m *RequestPing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *BlockByHeightResponse) GetIsLast() bool { + if m != nil { + return m.IsLast + } + return false } -func (m *RequestPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +type BlockMetaByHashResponse struct { + BlockMeta *types1.BlockMeta `protobuf:"bytes,1,opt,name=block_meta,json=blockMeta,proto3" json:"block_meta,omitempty"` } -func (m *RequestBroadcastTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (m *BlockMetaByHashResponse) Reset() { *m = BlockMetaByHashResponse{} } +func (m *BlockMetaByHashResponse) String() string { return proto.CompactTextString(m) } +func (*BlockMetaByHashResponse) ProtoMessage() {} +func (*BlockMetaByHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{14} } - -func (m *RequestBroadcastTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *BlockMetaByHashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -func (m *RequestBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tx) > 0 { - i -= len(m.Tx) - copy(dAtA[i:], m.Tx) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) - i-- - dAtA[i] = 0xa +func (m *BlockMetaByHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetaByHashResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *BlockMetaByHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetaByHashResponse.Merge(m, src) +} +func (m *BlockMetaByHashResponse) XXX_Size() int { + return m.Size() +} +func (m *BlockMetaByHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetaByHashResponse.DiscardUnknown(m) } -func (m *ResponsePing) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_BlockMetaByHashResponse proto.InternalMessageInfo + +func (m *BlockMetaByHashResponse) GetBlockMeta() *types1.BlockMeta { + if m != nil { + return m.BlockMeta } - return dAtA[:n], nil + return nil } -func (m *ResponsePing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type BlockMetaByHeightResponse struct { + BlockMeta *types1.BlockMeta `protobuf:"bytes,1,opt,name=block_meta,json=blockMeta,proto3" json:"block_meta,omitempty"` } -func (m *ResponsePing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func (m *BlockMetaByHeightResponse) Reset() { *m = BlockMetaByHeightResponse{} } +func (m *BlockMetaByHeightResponse) String() string { return proto.CompactTextString(m) } +func (*BlockMetaByHeightResponse) ProtoMessage() {} +func (*BlockMetaByHeightResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{15} +} +func (m *BlockMetaByHeightResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockMetaByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetaByHeightResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockMetaByHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetaByHeightResponse.Merge(m, src) +} +func (m *BlockMetaByHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *BlockMetaByHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetaByHeightResponse.DiscardUnknown(m) } -func (m *ResponseBroadcastTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_BlockMetaByHeightResponse proto.InternalMessageInfo + +func (m *BlockMetaByHeightResponse) GetBlockMeta() *types1.BlockMeta { + if m != nil { + return m.BlockMeta } - return dAtA[:n], nil + return nil } -func (m *ResponseBroadcastTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type CommitResponse struct { + Commit *types1.Commit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"` } -func (m *ResponseBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DeliverTx != nil { - { - size, err := m.DeliverTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.CheckTx != nil { - { - size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *CommitResponse) Reset() { *m = CommitResponse{} } +func (m *CommitResponse) String() string { return proto.CompactTextString(m) } +func (*CommitResponse) ProtoMessage() {} +func (*CommitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{16} +} +func (m *CommitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0xa + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *CommitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitResponse.Merge(m, src) +} +func (m *CommitResponse) XXX_Size() int { + return m.Size() +} +func (m *CommitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CommitResponse.DiscardUnknown(m) } -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +var xxx_messageInfo_CommitResponse proto.InternalMessageInfo + +func (m *CommitResponse) GetCommit() *types1.Commit { + if m != nil { + return m.Commit } - dAtA[offset] = uint8(v) - return base + return nil } -func (m *RequestPing) Size() (n int) { - if m == nil { - return 0 + +type ValidatorSetResponse struct { + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` +} + +func (m *ValidatorSetResponse) Reset() { *m = ValidatorSetResponse{} } +func (m *ValidatorSetResponse) String() string { return proto.CompactTextString(m) } +func (*ValidatorSetResponse) ProtoMessage() {} +func (*ValidatorSetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{17} +} +func (m *ValidatorSetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorSetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorSetResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - var l int - _ = l - return n +} +func (m *ValidatorSetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorSetResponse.Merge(m, src) +} +func (m *ValidatorSetResponse) XXX_Size() int { + return m.Size() +} +func (m *ValidatorSetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorSetResponse.DiscardUnknown(m) } -func (m *RequestBroadcastTx) Size() (n int) { - if m == nil { - return 0 +var xxx_messageInfo_ValidatorSetResponse proto.InternalMessageInfo + +func (m *ValidatorSetResponse) GetValidatorSet() *types1.ValidatorSet { + if m != nil { + return m.ValidatorSet } - var l int - _ = l - l = len(m.Tx) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + return nil +} + +type NewHeightEvent struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *NewHeightEvent) Reset() { *m = NewHeightEvent{} } +func (m *NewHeightEvent) String() string { return proto.CompactTextString(m) } +func (*NewHeightEvent) ProtoMessage() {} +func (*NewHeightEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{18} +} +func (m *NewHeightEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NewHeightEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NewHeightEvent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return n +} +func (m *NewHeightEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_NewHeightEvent.Merge(m, src) +} +func (m *NewHeightEvent) XXX_Size() int { + return m.Size() +} +func (m *NewHeightEvent) XXX_DiscardUnknown() { + xxx_messageInfo_NewHeightEvent.DiscardUnknown(m) } -func (m *ResponsePing) Size() (n int) { - if m == nil { - return 0 +var xxx_messageInfo_NewHeightEvent proto.InternalMessageInfo + +func (m *NewHeightEvent) GetHeight() int64 { + if m != nil { + return m.Height } - var l int - _ = l - return n + return 0 } -func (m *ResponseBroadcastTx) Size() (n int) { - if m == nil { - return 0 +func (m *NewHeightEvent) GetHash() []byte { + if m != nil { + return m.Hash } - var l int - _ = l - if m.CheckTx != nil { - l = m.CheckTx.Size() - n += 1 + l + sovTypes(uint64(l)) + return nil +} + +type StatusResponse struct { + NodeInfo *p2p.DefaultNodeInfo `protobuf:"bytes,1,opt,name=node_info,json=nodeInfo,proto3" json:"node_info,omitempty"` + SyncInfo *SyncInfo `protobuf:"bytes,2,opt,name=sync_info,json=syncInfo,proto3" json:"sync_info,omitempty"` + ValidatorInfo *ValidatorInfo `protobuf:"bytes,3,opt,name=validator_info,json=validatorInfo,proto3" json:"validator_info,omitempty"` +} + +func (m *StatusResponse) Reset() { *m = StatusResponse{} } +func (m *StatusResponse) String() string { return proto.CompactTextString(m) } +func (*StatusResponse) ProtoMessage() {} +func (*StatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{19} +} +func (m *StatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - if m.DeliverTx != nil { - l = m.DeliverTx.Size() - n += 1 + l + sovTypes(uint64(l)) +} +func (m *StatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusResponse.Merge(m, src) +} +func (m *StatusResponse) XXX_Size() int { + return m.Size() +} +func (m *StatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusResponse proto.InternalMessageInfo + +func (m *StatusResponse) GetNodeInfo() *p2p.DefaultNodeInfo { + if m != nil { + return m.NodeInfo } - return n + return nil } -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *StatusResponse) GetSyncInfo() *SyncInfo { + if m != nil { + return m.SyncInfo + } + return nil } -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *StatusResponse) GetValidatorInfo() *ValidatorInfo { + if m != nil { + return m.ValidatorInfo + } + return nil } -func (m *RequestPing) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + +type SyncInfo struct { + LatestBlockHash []byte `protobuf:"bytes,1,opt,name=latest_block_hash,json=latestBlockHash,proto3" json:"latest_block_hash,omitempty"` + LatestAppHash []byte `protobuf:"bytes,2,opt,name=latest_app_hash,json=latestAppHash,proto3" json:"latest_app_hash,omitempty"` + LatestBlockHeight int64 `protobuf:"varint,3,opt,name=latest_block_height,json=latestBlockHeight,proto3" json:"latest_block_height,omitempty"` + LatestBlockTime time.Time `protobuf:"bytes,4,opt,name=latest_block_time,json=latestBlockTime,proto3,stdtime" json:"latest_block_time"` + EarliestBlockHash []byte `protobuf:"bytes,5,opt,name=earliest_block_hash,json=earliestBlockHash,proto3" json:"earliest_block_hash,omitempty"` + EarliestAppHash []byte `protobuf:"bytes,6,opt,name=earliest_app_hash,json=earliestAppHash,proto3" json:"earliest_app_hash,omitempty"` + EarliestBlockHeight int64 `protobuf:"varint,7,opt,name=earliest_block_height,json=earliestBlockHeight,proto3" json:"earliest_block_height,omitempty"` + EarliestBlockTime time.Time `protobuf:"bytes,8,opt,name=earliest_block_time,json=earliestBlockTime,proto3,stdtime" json:"earliest_block_time"` + CatchingUp bool `protobuf:"varint,9,opt,name=catching_up,json=catchingUp,proto3" json:"catching_up,omitempty"` +} + +func (m *SyncInfo) Reset() { *m = SyncInfo{} } +func (m *SyncInfo) String() string { return proto.CompactTextString(m) } +func (*SyncInfo) ProtoMessage() {} +func (*SyncInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{20} +} +func (m *SyncInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SyncInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SyncInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SyncInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SyncInfo.Merge(m, src) +} +func (m *SyncInfo) XXX_Size() int { + return m.Size() +} +func (m *SyncInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SyncInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SyncInfo proto.InternalMessageInfo + +func (m *SyncInfo) GetLatestBlockHash() []byte { + if m != nil { + return m.LatestBlockHash + } + return nil +} + +func (m *SyncInfo) GetLatestAppHash() []byte { + if m != nil { + return m.LatestAppHash + } + return nil +} + +func (m *SyncInfo) GetLatestBlockHeight() int64 { + if m != nil { + return m.LatestBlockHeight + } + return 0 +} + +func (m *SyncInfo) GetLatestBlockTime() time.Time { + if m != nil { + return m.LatestBlockTime + } + return time.Time{} +} + +func (m *SyncInfo) GetEarliestBlockHash() []byte { + if m != nil { + return m.EarliestBlockHash + } + return nil +} + +func (m *SyncInfo) GetEarliestAppHash() []byte { + if m != nil { + return m.EarliestAppHash + } + return nil +} + +func (m *SyncInfo) GetEarliestBlockHeight() int64 { + if m != nil { + return m.EarliestBlockHeight + } + return 0 +} + +func (m *SyncInfo) GetEarliestBlockTime() time.Time { + if m != nil { + return m.EarliestBlockTime + } + return time.Time{} +} + +func (m *SyncInfo) GetCatchingUp() bool { + if m != nil { + return m.CatchingUp + } + return false +} + +type ValidatorInfo struct { + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PubKey *crypto.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` +} + +func (m *ValidatorInfo) Reset() { *m = ValidatorInfo{} } +func (m *ValidatorInfo) String() string { return proto.CompactTextString(m) } +func (*ValidatorInfo) ProtoMessage() {} +func (*ValidatorInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{21} +} +func (m *ValidatorInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorInfo.Merge(m, src) +} +func (m *ValidatorInfo) XXX_Size() int { + return m.Size() +} +func (m *ValidatorInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorInfo proto.InternalMessageInfo + +func (m *ValidatorInfo) GetAddress() []byte { + if m != nil { + return m.Address + } + return nil +} + +func (m *ValidatorInfo) GetPubKey() *crypto.PublicKey { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *ValidatorInfo) GetVotingPower() int64 { + if m != nil { + return m.VotingPower + } + return 0 +} + +func init() { + proto.RegisterType((*RequestPing)(nil), "tendermint.rpc.grpc.RequestPing") + proto.RegisterType((*RequestBroadcastTx)(nil), "tendermint.rpc.grpc.RequestBroadcastTx") + proto.RegisterType((*BlockByHashRequest)(nil), "tendermint.rpc.grpc.BlockByHashRequest") + proto.RegisterType((*BlockByHeightRequest)(nil), "tendermint.rpc.grpc.BlockByHeightRequest") + proto.RegisterType((*BlockMetaByHashRequest)(nil), "tendermint.rpc.grpc.BlockMetaByHashRequest") + proto.RegisterType((*BlockMetaByHeightRequest)(nil), "tendermint.rpc.grpc.BlockMetaByHeightRequest") + proto.RegisterType((*CommitRequest)(nil), "tendermint.rpc.grpc.CommitRequest") + proto.RegisterType((*ValidatorSetRequest)(nil), "tendermint.rpc.grpc.ValidatorSetRequest") + proto.RegisterType((*SubscribeNewHeightsRequest)(nil), "tendermint.rpc.grpc.SubscribeNewHeightsRequest") + proto.RegisterType((*StatusRequest)(nil), "tendermint.rpc.grpc.StatusRequest") + proto.RegisterType((*ResponsePing)(nil), "tendermint.rpc.grpc.ResponsePing") + proto.RegisterType((*ResponseBroadcastTx)(nil), "tendermint.rpc.grpc.ResponseBroadcastTx") + proto.RegisterType((*BlockByHashResponse)(nil), "tendermint.rpc.grpc.BlockByHashResponse") + proto.RegisterType((*BlockByHeightResponse)(nil), "tendermint.rpc.grpc.BlockByHeightResponse") + proto.RegisterType((*BlockMetaByHashResponse)(nil), "tendermint.rpc.grpc.BlockMetaByHashResponse") + proto.RegisterType((*BlockMetaByHeightResponse)(nil), "tendermint.rpc.grpc.BlockMetaByHeightResponse") + proto.RegisterType((*CommitResponse)(nil), "tendermint.rpc.grpc.CommitResponse") + proto.RegisterType((*ValidatorSetResponse)(nil), "tendermint.rpc.grpc.ValidatorSetResponse") + proto.RegisterType((*NewHeightEvent)(nil), "tendermint.rpc.grpc.NewHeightEvent") + proto.RegisterType((*StatusResponse)(nil), "tendermint.rpc.grpc.StatusResponse") + proto.RegisterType((*SyncInfo)(nil), "tendermint.rpc.grpc.SyncInfo") + proto.RegisterType((*ValidatorInfo)(nil), "tendermint.rpc.grpc.ValidatorInfo") +} + +func init() { proto.RegisterFile("tendermint/rpc/grpc/types.proto", fileDescriptor_0ffff5682c662b95) } + +var fileDescriptor_0ffff5682c662b95 = []byte{ + // 1185 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x3a, 0x89, 0xe3, 0x3c, 0xff, 0x89, 0x32, 0x4e, 0x53, 0xb3, 0x0d, 0x76, 0xba, 0x20, + 0x9a, 0x86, 0x76, 0x1d, 0x19, 0xf5, 0xd2, 0x56, 0x48, 0x71, 0x82, 0x44, 0x94, 0x52, 0x19, 0x27, + 0x05, 0x09, 0x0e, 0x66, 0x77, 0x3d, 0xb1, 0x57, 0xb1, 0x77, 0x87, 0xdd, 0xb1, 0x1b, 0x9f, 0xf9, + 0x02, 0xbd, 0x20, 0x21, 0x3e, 0x07, 0x57, 0xee, 0x3d, 0xf6, 0x82, 0xc4, 0x09, 0x50, 0x72, 0xe0, + 0x6b, 0xa0, 0x9d, 0x99, 0xb5, 0x67, 0xb3, 0x5e, 0xc7, 0x91, 0x38, 0xf6, 0x62, 0xcd, 0x9f, 0xdf, + 0xfb, 0xcd, 0xfb, 0xb7, 0xef, 0x3d, 0x43, 0x85, 0x62, 0xa7, 0x8d, 0xbd, 0xbe, 0xed, 0xd0, 0xaa, + 0x47, 0xac, 0x6a, 0x27, 0xf8, 0xa1, 0x23, 0x82, 0x7d, 0x9d, 0x78, 0x2e, 0x75, 0x51, 0x71, 0x02, + 0xd0, 0x3d, 0x62, 0xe9, 0x01, 0x40, 0xbd, 0x27, 0x49, 0x19, 0xa6, 0x65, 0xcb, 0x12, 0xea, 0x96, + 0x74, 0xc9, 0xce, 0x23, 0xb7, 0xaa, 0x74, 0x4b, 0x6a, 0x24, 0x51, 0xd2, 0xf2, 0x46, 0x84, 0xba, + 0xd5, 0x73, 0x3c, 0x0a, 0x6f, 0xb7, 0x63, 0xbc, 0x43, 0xa3, 0x67, 0xb7, 0x0d, 0xea, 0x7a, 0x02, + 0x51, 0xe9, 0xb8, 0x6e, 0xa7, 0x87, 0xab, 0x6c, 0x67, 0x0e, 0xce, 0xaa, 0xd4, 0xee, 0x63, 0x9f, + 0x1a, 0x7d, 0x22, 0x00, 0x1b, 0x1d, 0xb7, 0xe3, 0xb2, 0x65, 0x35, 0x58, 0xf1, 0x53, 0x2d, 0x0f, + 0xd9, 0x26, 0xfe, 0x71, 0x80, 0x7d, 0xda, 0xb0, 0x9d, 0x8e, 0xf6, 0x31, 0x20, 0xb1, 0xad, 0x7b, + 0xae, 0xd1, 0xb6, 0x0c, 0x9f, 0x9e, 0x5e, 0xa0, 0x02, 0xa4, 0xe8, 0x45, 0x49, 0xd9, 0x56, 0x76, + 0x72, 0xcd, 0x14, 0xbd, 0xd0, 0x3e, 0x07, 0x54, 0xef, 0xb9, 0xd6, 0x79, 0x7d, 0xf4, 0xa5, 0xe1, + 0x77, 0x85, 0x00, 0x42, 0xb0, 0xd4, 0x35, 0xfc, 0xae, 0xc0, 0xb1, 0x35, 0xda, 0x80, 0x65, 0xe2, + 0xb9, 0x43, 0x5c, 0x4a, 0x6d, 0x2b, 0x3b, 0x99, 0x26, 0xdf, 0x68, 0x87, 0xb0, 0x11, 0xca, 0x63, + 0xbb, 0xd3, 0xa5, 0x21, 0xc3, 0x26, 0xa4, 0xbb, 0xec, 0x80, 0x71, 0x2c, 0x36, 0xc5, 0x2e, 0x81, + 0xe5, 0x11, 0x6c, 0x32, 0x96, 0xaf, 0x30, 0x35, 0x6e, 0xd4, 0x44, 0xab, 0x41, 0x49, 0x46, 0xcf, + 0xf3, 0xae, 0xf6, 0x00, 0xf2, 0x07, 0x6e, 0xbf, 0x6f, 0xdf, 0x08, 0x7c, 0x0c, 0xc5, 0x6f, 0xc2, + 0x78, 0x9c, 0xe0, 0x1b, 0xe1, 0x5b, 0xa0, 0x9e, 0x0c, 0x4c, 0xdf, 0xf2, 0x6c, 0x13, 0xbf, 0xc4, + 0xaf, 0xb9, 0x32, 0xbe, 0x90, 0xd2, 0xd6, 0x20, 0x7f, 0x42, 0x0d, 0x3a, 0x18, 0x1f, 0x14, 0x20, + 0xd7, 0xc4, 0x3e, 0x71, 0x1d, 0x1f, 0xb3, 0x20, 0xfd, 0xac, 0x40, 0x31, 0x3c, 0x90, 0xc3, 0xf4, + 0x0c, 0x32, 0x56, 0x17, 0x5b, 0xe7, 0x2d, 0x11, 0xac, 0x6c, 0x6d, 0x5b, 0x97, 0x32, 0x38, 0x48, + 0x56, 0x3d, 0x94, 0x3b, 0x08, 0x80, 0xa7, 0x17, 0xcd, 0x15, 0x8b, 0x2f, 0xd0, 0x3e, 0x40, 0x1b, + 0xf7, 0xec, 0x21, 0xf6, 0x02, 0xf1, 0x14, 0x13, 0xd7, 0x12, 0xc5, 0x0f, 0x39, 0xf4, 0xf4, 0xa2, + 0xb9, 0xda, 0x0e, 0x97, 0xda, 0x2f, 0x29, 0x28, 0x46, 0xf2, 0x82, 0x63, 0xd1, 0x13, 0x00, 0x33, + 0x38, 0x6e, 0x11, 0xc3, 0xa3, 0x42, 0xb3, 0x4d, 0x99, 0x9a, 0x7f, 0x07, 0x0d, 0xc3, 0xa3, 0xcd, + 0x55, 0x86, 0x0c, 0x96, 0x68, 0x0f, 0xd2, 0x16, 0xf3, 0xbe, 0xd0, 0xa6, 0x14, 0x17, 0x11, 0xd1, + 0x11, 0x38, 0x74, 0x00, 0xf9, 0xf1, 0x67, 0xd1, 0xf2, 0x31, 0x2d, 0x2d, 0x32, 0xc1, 0x72, 0x5c, + 0x30, 0x12, 0xad, 0xdc, 0x50, 0xda, 0xa1, 0xa7, 0xa1, 0xb6, 0x7d, 0x4c, 0x8d, 0xd2, 0x12, 0x63, + 0xb8, 0x17, 0x67, 0x18, 0x27, 0x93, 0x50, 0x39, 0x58, 0xa2, 0xbb, 0xb0, 0x62, 0xfb, 0xad, 0x9e, + 0xe1, 0xd3, 0xd2, 0x32, 0x4b, 0xd5, 0xb4, 0xed, 0xbf, 0x30, 0x7c, 0xaa, 0xfd, 0x9a, 0x82, 0x3b, + 0xd7, 0x52, 0xfe, 0xbd, 0x73, 0x42, 0xe7, 0xbc, 0x82, 0xbb, 0xb1, 0x0f, 0x59, 0x78, 0x27, 0xfa, + 0x9e, 0x72, 0x9b, 0xf7, 0xb4, 0x6f, 0xe1, 0x83, 0x29, 0x5f, 0xfc, 0xff, 0x40, 0x5c, 0x87, 0x42, + 0x58, 0x16, 0x04, 0xdb, 0x24, 0x1a, 0xca, 0x7c, 0xd1, 0xd0, 0xbe, 0x87, 0x8d, 0x68, 0xc5, 0x10, + 0x4c, 0xb1, 0x28, 0x29, 0xb7, 0x8f, 0x92, 0xf6, 0x1c, 0x0a, 0xe3, 0xb2, 0xf2, 0xc5, 0x10, 0x3b, + 0xc9, 0x95, 0x35, 0xac, 0x94, 0x29, 0xa9, 0x52, 0xfe, 0xa1, 0x40, 0x21, 0x2c, 0x40, 0x42, 0xab, + 0xe7, 0xb0, 0xea, 0xb8, 0x6d, 0xdc, 0xb2, 0x9d, 0x33, 0x57, 0x68, 0x54, 0x91, 0x35, 0x22, 0x35, + 0xa2, 0x1f, 0xe2, 0x33, 0x63, 0xd0, 0xa3, 0x2f, 0xdd, 0x36, 0x3e, 0x72, 0xce, 0xdc, 0x66, 0xc6, + 0x11, 0x2b, 0xf4, 0x14, 0x56, 0xfd, 0x91, 0x63, 0x71, 0x69, 0x9e, 0xae, 0x1f, 0xea, 0x53, 0x5a, + 0xab, 0x7e, 0x32, 0x72, 0x2c, 0x2e, 0xeb, 0x8b, 0x15, 0x3a, 0x82, 0xc2, 0xc4, 0x1f, 0x8c, 0x60, + 0x31, 0x5e, 0x9a, 0xc6, 0x04, 0x63, 0x9f, 0x30, 0x96, 0x89, 0x27, 0x83, 0xad, 0xf6, 0xef, 0x22, + 0x64, 0xc2, 0x17, 0xd0, 0x2e, 0xac, 0xf7, 0x0c, 0x8a, 0x7d, 0xda, 0xe2, 0x69, 0x20, 0xf5, 0x8b, + 0x35, 0x7e, 0xc1, 0x42, 0x1f, 0x24, 0x23, 0xfa, 0x04, 0xc4, 0x51, 0xcb, 0x20, 0xa4, 0x25, 0xf9, + 0x2b, 0xcf, 0x8f, 0xf7, 0x09, 0x61, 0x38, 0x1d, 0x8a, 0x51, 0x4e, 0xee, 0xf1, 0x45, 0xe6, 0xf1, + 0x75, 0x99, 0x95, 0x3b, 0xbf, 0x71, 0x4d, 0x87, 0xa0, 0x63, 0x8b, 0x6f, 0x4a, 0xd5, 0x79, 0x3b, + 0xd7, 0xc3, 0x76, 0xae, 0x9f, 0x86, 0xed, 0xbc, 0x9e, 0x79, 0xfb, 0x57, 0x65, 0xe1, 0xcd, 0xdf, + 0x15, 0x25, 0xa2, 0x69, 0x70, 0x1f, 0x68, 0x80, 0x0d, 0xaf, 0x67, 0x5f, 0xb3, 0x6b, 0x99, 0x69, + 0xbb, 0x1e, 0x5e, 0x4d, 0x2c, 0xdb, 0x85, 0xf1, 0xe1, 0xc4, 0xb6, 0x34, 0xf7, 0x42, 0x78, 0x11, + 0x5a, 0x57, 0x83, 0x3b, 0xd7, 0xb9, 0xb9, 0x7d, 0x2b, 0xcc, 0xbe, 0x62, 0x94, 0x9d, 0x5b, 0x78, + 0x1a, 0xd3, 0x87, 0xd9, 0x98, 0xb9, 0x85, 0x8d, 0x51, 0xad, 0x99, 0x95, 0x15, 0xc8, 0x5a, 0x06, + 0xb5, 0xba, 0xb6, 0xd3, 0x69, 0x0d, 0x48, 0x69, 0x95, 0x15, 0x13, 0x08, 0x8f, 0x5e, 0x11, 0xed, + 0x27, 0x05, 0xf2, 0x91, 0x54, 0x40, 0x25, 0x58, 0x31, 0xda, 0x6d, 0x0f, 0xfb, 0xbe, 0x08, 0x72, + 0xb8, 0x45, 0x4f, 0x60, 0x85, 0x0c, 0xcc, 0xd6, 0x39, 0x1e, 0x89, 0xd4, 0xdc, 0x92, 0x33, 0x8b, + 0x4f, 0x62, 0x7a, 0x63, 0x60, 0xf6, 0x6c, 0xeb, 0x18, 0x8f, 0x9a, 0x69, 0x32, 0x30, 0x8f, 0xf1, + 0x08, 0xdd, 0x87, 0xdc, 0xd0, 0xa5, 0x81, 0x06, 0xc4, 0x7d, 0x8d, 0x3d, 0x11, 0xe4, 0x2c, 0x3f, + 0x6b, 0x04, 0x47, 0xb5, 0xdf, 0x15, 0xc8, 0x8d, 0xdb, 0xf3, 0x7e, 0xe3, 0x08, 0x1d, 0xc3, 0x52, + 0xd0, 0xbf, 0xd1, 0xf6, 0xd4, 0xdc, 0x95, 0xc6, 0x30, 0xf5, 0x7e, 0x02, 0x62, 0x32, 0x04, 0xa0, + 0x1f, 0x20, 0x2b, 0xf7, 0xfe, 0x07, 0xb3, 0x38, 0x25, 0xa0, 0xba, 0x33, 0x93, 0x5a, 0x42, 0xd6, + 0x7e, 0x4b, 0x43, 0x86, 0x39, 0x3d, 0xd0, 0xdd, 0x84, 0xac, 0xd4, 0xda, 0x13, 0x9e, 0x8b, 0x0f, + 0x85, 0x09, 0xcf, 0x4d, 0x99, 0x12, 0xf6, 0x14, 0xd4, 0x83, 0xb5, 0x6b, 0x7d, 0x00, 0x7d, 0x9a, + 0x2c, 0x1e, 0x1b, 0xfb, 0xd4, 0x47, 0xf3, 0x81, 0x45, 0x4d, 0xeb, 0x42, 0x3e, 0xd2, 0x91, 0xd1, + 0xc3, 0x99, 0xaa, 0xca, 0x03, 0xa3, 0xba, 0x3b, 0x0f, 0x74, 0x6c, 0x97, 0x07, 0xeb, 0xb1, 0x46, + 0x84, 0x1e, 0xdf, 0xa8, 0x6c, 0xe4, 0x45, 0x7d, 0x5e, 0xb8, 0xb0, 0xee, 0x6b, 0x48, 0xf3, 0x8e, + 0x83, 0xa6, 0x57, 0xca, 0xc8, 0x5c, 0xab, 0x7e, 0x34, 0x13, 0x23, 0x28, 0x2d, 0xc8, 0xc9, 0x3d, + 0x07, 0xed, 0xcc, 0x2e, 0xc1, 0x93, 0x39, 0x58, 0x7d, 0x38, 0x07, 0x52, 0x3c, 0xd2, 0x87, 0xe2, + 0x94, 0xd1, 0x18, 0x55, 0xa7, 0xf7, 0x8b, 0xc4, 0x21, 0x3a, 0xc1, 0xa2, 0x68, 0x57, 0xdc, 0x53, + 0x02, 0x37, 0xf1, 0x56, 0x97, 0xe0, 0xa6, 0xc8, 0x20, 0x9e, 0x40, 0x1a, 0xed, 0x95, 0xf5, 0x17, + 0x6f, 0x2f, 0xcb, 0xca, 0xbb, 0xcb, 0xb2, 0xf2, 0xcf, 0x65, 0x59, 0x79, 0x73, 0x55, 0x5e, 0x78, + 0x77, 0x55, 0x5e, 0xf8, 0xf3, 0xaa, 0xbc, 0xf0, 0x5d, 0xad, 0x63, 0xd3, 0xee, 0xc0, 0xd4, 0x2d, + 0xb7, 0x5f, 0x95, 0xff, 0xcf, 0xc5, 0xff, 0x85, 0x3e, 0xb3, 0x5c, 0x0f, 0x07, 0x0b, 0x33, 0xcd, + 0x8a, 0xe3, 0x67, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x15, 0xb6, 0x85, 0xef, 0xac, 0x0e, 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 + +// BroadcastAPIClient is the client API for BroadcastAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type BroadcastAPIClient interface { + Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) + BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) +} + +type broadcastAPIClient struct { + cc *grpc.ClientConn +} + +func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient { + return &broadcastAPIClient{cc} +} + +func (c *broadcastAPIClient) Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) { + out := new(ResponsePing) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BroadcastAPI/Ping", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *broadcastAPIClient) BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) { + out := new(ResponseBroadcastTx) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BroadcastAPI/BroadcastTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BroadcastAPIServer is the server API for BroadcastAPI service. +type BroadcastAPIServer interface { + Ping(context.Context, *RequestPing) (*ResponsePing, error) + BroadcastTx(context.Context, *RequestBroadcastTx) (*ResponseBroadcastTx, error) +} + +// UnimplementedBroadcastAPIServer can be embedded to have forward compatible implementations. +type UnimplementedBroadcastAPIServer struct { +} + +func (*UnimplementedBroadcastAPIServer) Ping(ctx context.Context, req *RequestPing) (*ResponsePing, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} +func (*UnimplementedBroadcastAPIServer) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) { + return nil, status.Errorf(codes.Unimplemented, "method BroadcastTx not implemented") +} + +func RegisterBroadcastAPIServer(s *grpc.Server, srv BroadcastAPIServer) { + s.RegisterService(&_BroadcastAPI_serviceDesc, srv) +} + +func _BroadcastAPI_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestPing) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BroadcastAPIServer).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BroadcastAPI/Ping", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BroadcastAPIServer).Ping(ctx, req.(*RequestPing)) + } + return interceptor(ctx, in, info, handler) +} + +func _BroadcastAPI_BroadcastTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestBroadcastTx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BroadcastAPIServer).BroadcastTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BroadcastAPI/BroadcastTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BroadcastAPIServer).BroadcastTx(ctx, req.(*RequestBroadcastTx)) + } + return interceptor(ctx, in, info, handler) +} + +var _BroadcastAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "tendermint.rpc.grpc.BroadcastAPI", + HandlerType: (*BroadcastAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ping", + Handler: _BroadcastAPI_Ping_Handler, + }, + { + MethodName: "BroadcastTx", + Handler: _BroadcastAPI_BroadcastTx_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "tendermint/rpc/grpc/types.proto", +} + +// BlockAPIClient is the client API for BlockAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type BlockAPIClient interface { + BlockByHash(ctx context.Context, in *BlockByHashRequest, opts ...grpc.CallOption) (BlockAPI_BlockByHashClient, error) + BlockMetaByHash(ctx context.Context, in *BlockMetaByHashRequest, opts ...grpc.CallOption) (*BlockMetaByHashResponse, error) + BlockByHeight(ctx context.Context, in *BlockByHeightRequest, opts ...grpc.CallOption) (BlockAPI_BlockByHeightClient, error) + BlockMetaByHeight(ctx context.Context, in *BlockMetaByHeightRequest, opts ...grpc.CallOption) (*BlockMetaByHeightResponse, error) + Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) + ValidatorSet(ctx context.Context, in *ValidatorSetRequest, opts ...grpc.CallOption) (*ValidatorSetResponse, error) + SubscribeNewHeights(ctx context.Context, in *SubscribeNewHeightsRequest, opts ...grpc.CallOption) (BlockAPI_SubscribeNewHeightsClient, error) + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) +} + +type blockAPIClient struct { + cc *grpc.ClientConn +} + +func NewBlockAPIClient(cc *grpc.ClientConn) BlockAPIClient { + return &blockAPIClient{cc} +} + +func (c *blockAPIClient) BlockByHash(ctx context.Context, in *BlockByHashRequest, opts ...grpc.CallOption) (BlockAPI_BlockByHashClient, error) { + stream, err := c.cc.NewStream(ctx, &_BlockAPI_serviceDesc.Streams[0], "/tendermint.rpc.grpc.BlockAPI/BlockByHash", opts...) + if err != nil { + return nil, err + } + x := &blockAPIBlockByHashClient{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 BlockAPI_BlockByHashClient interface { + Recv() (*BlockByHashResponse, error) + grpc.ClientStream +} + +type blockAPIBlockByHashClient struct { + grpc.ClientStream +} + +func (x *blockAPIBlockByHashClient) Recv() (*BlockByHashResponse, error) { + m := new(BlockByHashResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *blockAPIClient) BlockMetaByHash(ctx context.Context, in *BlockMetaByHashRequest, opts ...grpc.CallOption) (*BlockMetaByHashResponse, error) { + out := new(BlockMetaByHashResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/BlockMetaByHash", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockAPIClient) BlockByHeight(ctx context.Context, in *BlockByHeightRequest, opts ...grpc.CallOption) (BlockAPI_BlockByHeightClient, error) { + stream, err := c.cc.NewStream(ctx, &_BlockAPI_serviceDesc.Streams[1], "/tendermint.rpc.grpc.BlockAPI/BlockByHeight", opts...) + if err != nil { + return nil, err + } + x := &blockAPIBlockByHeightClient{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 BlockAPI_BlockByHeightClient interface { + Recv() (*BlockByHeightResponse, error) + grpc.ClientStream +} + +type blockAPIBlockByHeightClient struct { + grpc.ClientStream +} + +func (x *blockAPIBlockByHeightClient) Recv() (*BlockByHeightResponse, error) { + m := new(BlockByHeightResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *blockAPIClient) BlockMetaByHeight(ctx context.Context, in *BlockMetaByHeightRequest, opts ...grpc.CallOption) (*BlockMetaByHeightResponse, error) { + out := new(BlockMetaByHeightResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/BlockMetaByHeight", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockAPIClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) { + out := new(CommitResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/Commit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockAPIClient) ValidatorSet(ctx context.Context, in *ValidatorSetRequest, opts ...grpc.CallOption) (*ValidatorSetResponse, error) { + out := new(ValidatorSetResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/ValidatorSet", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockAPIClient) SubscribeNewHeights(ctx context.Context, in *SubscribeNewHeightsRequest, opts ...grpc.CallOption) (BlockAPI_SubscribeNewHeightsClient, error) { + stream, err := c.cc.NewStream(ctx, &_BlockAPI_serviceDesc.Streams[2], "/tendermint.rpc.grpc.BlockAPI/SubscribeNewHeights", opts...) + if err != nil { + return nil, err + } + x := &blockAPISubscribeNewHeightsClient{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 BlockAPI_SubscribeNewHeightsClient interface { + Recv() (*NewHeightEvent, error) + grpc.ClientStream +} + +type blockAPISubscribeNewHeightsClient struct { + grpc.ClientStream +} + +func (x *blockAPISubscribeNewHeightsClient) Recv() (*NewHeightEvent, error) { + m := new(NewHeightEvent) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *blockAPIClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + out := new(StatusResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/Status", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BlockAPIServer is the server API for BlockAPI service. +type BlockAPIServer interface { + BlockByHash(*BlockByHashRequest, BlockAPI_BlockByHashServer) error + BlockMetaByHash(context.Context, *BlockMetaByHashRequest) (*BlockMetaByHashResponse, error) + BlockByHeight(*BlockByHeightRequest, BlockAPI_BlockByHeightServer) error + BlockMetaByHeight(context.Context, *BlockMetaByHeightRequest) (*BlockMetaByHeightResponse, error) + Commit(context.Context, *CommitRequest) (*CommitResponse, error) + ValidatorSet(context.Context, *ValidatorSetRequest) (*ValidatorSetResponse, error) + SubscribeNewHeights(*SubscribeNewHeightsRequest, BlockAPI_SubscribeNewHeightsServer) error + Status(context.Context, *StatusRequest) (*StatusResponse, error) +} + +// UnimplementedBlockAPIServer can be embedded to have forward compatible implementations. +type UnimplementedBlockAPIServer struct { +} + +func (*UnimplementedBlockAPIServer) BlockByHash(req *BlockByHashRequest, srv BlockAPI_BlockByHashServer) error { + return status.Errorf(codes.Unimplemented, "method BlockByHash not implemented") +} +func (*UnimplementedBlockAPIServer) BlockMetaByHash(ctx context.Context, req *BlockMetaByHashRequest) (*BlockMetaByHashResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockMetaByHash not implemented") +} +func (*UnimplementedBlockAPIServer) BlockByHeight(req *BlockByHeightRequest, srv BlockAPI_BlockByHeightServer) error { + return status.Errorf(codes.Unimplemented, "method BlockByHeight not implemented") +} +func (*UnimplementedBlockAPIServer) BlockMetaByHeight(ctx context.Context, req *BlockMetaByHeightRequest) (*BlockMetaByHeightResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockMetaByHeight not implemented") +} +func (*UnimplementedBlockAPIServer) Commit(ctx context.Context, req *CommitRequest) (*CommitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") +} +func (*UnimplementedBlockAPIServer) ValidatorSet(ctx context.Context, req *ValidatorSetRequest) (*ValidatorSetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorSet not implemented") +} +func (*UnimplementedBlockAPIServer) SubscribeNewHeights(req *SubscribeNewHeightsRequest, srv BlockAPI_SubscribeNewHeightsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeNewHeights not implemented") +} +func (*UnimplementedBlockAPIServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} + +func RegisterBlockAPIServer(s *grpc.Server, srv BlockAPIServer) { + s.RegisterService(&_BlockAPI_serviceDesc, srv) +} + +func _BlockAPI_BlockByHash_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(BlockByHashRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BlockAPIServer).BlockByHash(m, &blockAPIBlockByHashServer{stream}) +} + +type BlockAPI_BlockByHashServer interface { + Send(*BlockByHashResponse) error + grpc.ServerStream +} + +type blockAPIBlockByHashServer struct { + grpc.ServerStream +} + +func (x *blockAPIBlockByHashServer) Send(m *BlockByHashResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _BlockAPI_BlockMetaByHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockMetaByHashRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).BlockMetaByHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/BlockMetaByHash", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).BlockMetaByHash(ctx, req.(*BlockMetaByHashRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockAPI_BlockByHeight_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(BlockByHeightRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BlockAPIServer).BlockByHeight(m, &blockAPIBlockByHeightServer{stream}) +} + +type BlockAPI_BlockByHeightServer interface { + Send(*BlockByHeightResponse) error + grpc.ServerStream +} + +type blockAPIBlockByHeightServer struct { + grpc.ServerStream +} + +func (x *blockAPIBlockByHeightServer) Send(m *BlockByHeightResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _BlockAPI_BlockMetaByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockMetaByHeightRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).BlockMetaByHeight(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/BlockMetaByHeight", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).BlockMetaByHeight(ctx, req.(*BlockMetaByHeightRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockAPI_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).Commit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/Commit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).Commit(ctx, req.(*CommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockAPI_ValidatorSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidatorSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).ValidatorSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/ValidatorSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).ValidatorSet(ctx, req.(*ValidatorSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockAPI_SubscribeNewHeights_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeNewHeightsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BlockAPIServer).SubscribeNewHeights(m, &blockAPISubscribeNewHeightsServer{stream}) +} + +type BlockAPI_SubscribeNewHeightsServer interface { + Send(*NewHeightEvent) error + grpc.ServerStream +} + +type blockAPISubscribeNewHeightsServer struct { + grpc.ServerStream +} + +func (x *blockAPISubscribeNewHeightsServer) Send(m *NewHeightEvent) error { + return x.ServerStream.SendMsg(m) +} + +func _BlockAPI_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _BlockAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "tendermint.rpc.grpc.BlockAPI", + HandlerType: (*BlockAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BlockMetaByHash", + Handler: _BlockAPI_BlockMetaByHash_Handler, + }, + { + MethodName: "BlockMetaByHeight", + Handler: _BlockAPI_BlockMetaByHeight_Handler, + }, + { + MethodName: "Commit", + Handler: _BlockAPI_Commit_Handler, + }, + { + MethodName: "ValidatorSet", + Handler: _BlockAPI_ValidatorSet_Handler, + }, + { + MethodName: "Status", + Handler: _BlockAPI_Status_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "BlockByHash", + Handler: _BlockAPI_BlockByHash_Handler, + ServerStreams: true, + }, + { + StreamName: "BlockByHeight", + Handler: _BlockAPI_BlockByHeight_Handler, + ServerStreams: true, + }, + { + StreamName: "SubscribeNewHeights", + Handler: _BlockAPI_SubscribeNewHeights_Handler, + ServerStreams: true, + }, + }, + Metadata: "tendermint/rpc/grpc/types.proto", +} + +func (m *RequestPing) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RequestPing) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *RequestBroadcastTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RequestBroadcastTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Tx) > 0 { + i -= len(m.Tx) + copy(dAtA[i:], m.Tx) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockByHashRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockByHashRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockByHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Prove { + i-- + if m.Prove { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockByHeightRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockByHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockByHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Prove { + i-- + if m.Prove { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BlockMetaByHashRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockMetaByHashRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetaByHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockMetaByHeightRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockMetaByHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetaByHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CommitRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CommitRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ValidatorSetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorSetRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorSetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SubscribeNewHeightsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SubscribeNewHeightsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscribeNewHeightsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *StatusRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ResponsePing) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResponsePing) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponsePing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ResponseBroadcastTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResponseBroadcastTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponseBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DeliverTx != nil { + { + size, err := m.DeliverTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.CheckTx != nil { + { + size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockByHashResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockByHashResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockByHashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsLast { + i-- + if m.IsLast { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.BlockMeta != nil { + { + size, err := m.BlockMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ValidatorSet != nil { + { + size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.BlockPart != nil { + { + size, err := m.BlockPart.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockByHeightResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockByHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockByHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsLast { + i-- + if m.IsLast { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.BlockMeta != nil { + { + size, err := m.BlockMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ValidatorSet != nil { + { + size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.BlockPart != nil { + { + size, err := m.BlockPart.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockMetaByHashResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockMetaByHashResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetaByHashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockMeta != nil { + { + size, err := m.BlockMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockMetaByHeightResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockMetaByHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetaByHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockMeta != nil { + { + size, err := m.BlockMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CommitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CommitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorSetResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorSetResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorSetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValidatorSet != nil { + { + size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NewHeightEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NewHeightEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NewHeightEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x12 + } + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StatusResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValidatorInfo != nil { + { + size, err := m.ValidatorInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.SyncInfo != nil { + { + size, err := m.SyncInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.NodeInfo != nil { + { + size, err := m.NodeInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SyncInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CatchingUp { + i-- + if m.CatchingUp { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + n18, err18 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EarliestBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EarliestBlockTime):]) + if err18 != nil { + return 0, err18 + } + i -= n18 + i = encodeVarintTypes(dAtA, i, uint64(n18)) + i-- + dAtA[i] = 0x42 + if m.EarliestBlockHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.EarliestBlockHeight)) + i-- + dAtA[i] = 0x38 + } + if len(m.EarliestAppHash) > 0 { + i -= len(m.EarliestAppHash) + copy(dAtA[i:], m.EarliestAppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.EarliestAppHash))) + i-- + dAtA[i] = 0x32 + } + if len(m.EarliestBlockHash) > 0 { + i -= len(m.EarliestBlockHash) + copy(dAtA[i:], m.EarliestBlockHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.EarliestBlockHash))) + i-- + dAtA[i] = 0x2a + } + n19, err19 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LatestBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LatestBlockTime):]) + if err19 != nil { + return 0, err19 + } + i -= n19 + i = encodeVarintTypes(dAtA, i, uint64(n19)) + i-- + dAtA[i] = 0x22 + if m.LatestBlockHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LatestBlockHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.LatestAppHash) > 0 { + i -= len(m.LatestAppHash) + copy(dAtA[i:], m.LatestAppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.LatestAppHash))) + i-- + dAtA[i] = 0x12 + } + if len(m.LatestBlockHash) > 0 { + i -= len(m.LatestBlockHash) + copy(dAtA[i:], m.LatestBlockHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.LatestBlockHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VotingPower != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.VotingPower)) + i-- + dAtA[i] = 0x18 + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RequestPing) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *RequestBroadcastTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Tx) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BlockByHashRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Prove { + n += 2 + } + return n +} + +func (m *BlockByHeightRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + if m.Prove { + n += 2 + } + return n +} + +func (m *BlockMetaByHashRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BlockMetaByHeightRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + return n +} + +func (m *CommitRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + return n +} + +func (m *ValidatorSetRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + return n +} + +func (m *SubscribeNewHeightsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *StatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ResponsePing) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ResponseBroadcastTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CheckTx != nil { + l = m.CheckTx.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.DeliverTx != nil { + l = m.DeliverTx.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BlockByHashResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockPart != nil { + l = m.BlockPart.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ValidatorSet != nil { + l = m.ValidatorSet.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.BlockMeta != nil { + l = m.BlockMeta.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.IsLast { + n += 2 + } + return n +} + +func (m *BlockByHeightResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockPart != nil { + l = m.BlockPart.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ValidatorSet != nil { + l = m.ValidatorSet.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.BlockMeta != nil { + l = m.BlockMeta.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.IsLast { + n += 2 + } + return n +} + +func (m *BlockMetaByHashResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockMeta != nil { + l = m.BlockMeta.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BlockMetaByHeightResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockMeta != nil { + l = m.BlockMeta.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *CommitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *ValidatorSetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorSet != nil { + l = m.ValidatorSet.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *NewHeightEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *StatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NodeInfo != nil { + l = m.NodeInfo.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.SyncInfo != nil { + l = m.SyncInfo.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ValidatorInfo != nil { + l = m.ValidatorInfo.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *SyncInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.LatestBlockHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.LatestAppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.LatestBlockHeight != 0 { + n += 1 + sovTypes(uint64(m.LatestBlockHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LatestBlockTime) + n += 1 + l + sovTypes(uint64(l)) + l = len(m.EarliestBlockHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.EarliestAppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.EarliestBlockHeight != 0 { + n += 1 + sovTypes(uint64(m.EarliestBlockHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EarliestBlockTime) + n += 1 + l + sovTypes(uint64(l)) + if m.CatchingUp { + n += 2 + } + return n +} + +func (m *ValidatorInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.VotingPower != 0 { + n += 1 + sovTypes(uint64(m.VotingPower)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RequestPing) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestPing: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestPing: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestBroadcastTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestBroadcastTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) + if m.Tx == nil { + m.Tx = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockByHashRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockByHashRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockByHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Prove", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Prove = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockByHeightRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockByHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Prove", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Prove = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetaByHashRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockMetaByHashRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockMetaByHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetaByHeightRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockMetaByHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockMetaByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommitRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CommitRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorSetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorSetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SubscribeNewHeightsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SubscribeNewHeightsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SubscribeNewHeightsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponsePing) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponsePing: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponsePing: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseBroadcastTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CheckTx == nil { + m.CheckTx = &types.ResponseCheckTx{} + } + if err := m.CheckTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DeliverTx == nil { + m.DeliverTx = &types.ResponseDeliverTx{} + } + if err := m.DeliverTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockByHashResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockByHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockByHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockPart", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockPart == nil { + m.BlockPart = &types1.Part{} + } + if err := m.BlockPart.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commit == nil { + m.Commit = &types1.Commit{} + } + if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorSet == nil { + m.ValidatorSet = &types1.ValidatorSet{} + } + if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockMeta == nil { + m.BlockMeta = &types1.BlockMeta{} + } + if err := m.BlockMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLast", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsLast = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockByHeightResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockByHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockPart", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockPart == nil { + m.BlockPart = &types1.Part{} + } + if err := m.BlockPart.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commit == nil { + m.Commit = &types1.Commit{} + } + if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorSet == nil { + m.ValidatorSet = &types1.ValidatorSet{} + } + if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockMeta == nil { + m.BlockMeta = &types1.BlockMeta{} + } + if err := m.BlockMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLast", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsLast = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetaByHashResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockMetaByHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockMetaByHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockMeta == nil { + m.BlockMeta = &types1.BlockMeta{} + } + if err := m.BlockMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetaByHeightResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockMetaByHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockMetaByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockMeta == nil { + m.BlockMeta = &types1.BlockMeta{} + } + if err := m.BlockMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CommitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commit == nil { + m.Commit = &types1.Commit{} + } + if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorSetResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorSetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorSetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorSet == nil { + m.ValidatorSet = &types1.ValidatorSet{} + } + if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NewHeightEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NewHeightEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NewHeightEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeInfo == nil { + m.NodeInfo = &p2p.DefaultNodeInfo{} + } + if err := m.NodeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SyncInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SyncInfo == nil { + m.SyncInfo = &SyncInfo{} + } + if err := m.SyncInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorInfo == nil { + m.ValidatorInfo = &ValidatorInfo{} + } + if err := m.ValidatorInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LatestBlockHash = append(m.LatestBlockHash[:0], dAtA[iNdEx:postIndex]...) + if m.LatestBlockHash == nil { + m.LatestBlockHash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestAppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LatestAppHash = append(m.LatestAppHash[:0], dAtA[iNdEx:postIndex]...) + if m.LatestAppHash == nil { + m.LatestAppHash = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHeight", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + m.LatestBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LatestBlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockTime", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestPing: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestPing: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestBroadcastTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LatestBlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err } - if iNdEx >= l { + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EarliestBlockHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.EarliestBlockHash = append(m.EarliestBlockHash[:0], dAtA[iNdEx:postIndex]...) + if m.EarliestBlockHash == nil { + m.EarliestBlockHash = []byte{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestBroadcastTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EarliestAppHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -640,61 +5183,83 @@ func (m *RequestBroadcastTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) - if m.Tx == nil { - m.Tx = []byte{} + m.EarliestAppHash = append(m.EarliestAppHash[:0], dAtA[iNdEx:postIndex]...) + if m.EarliestAppHash == nil { + m.EarliestAppHash = []byte{} } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EarliestBlockHeight", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + m.EarliestBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EarliestBlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EarliestBlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return ErrInvalidLengthTypes } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponsePing) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EarliestBlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err } - if iNdEx >= l { - return io.ErrUnexpectedEOF + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CatchingUp", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponsePing: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponsePing: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + m.CatchingUp = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -716,7 +5281,7 @@ func (m *ResponsePing) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { +func (m *ValidatorInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -739,17 +5304,17 @@ func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseBroadcastTx: wiretype end group for non-group") + return fmt.Errorf("proto: ValidatorInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ValidatorInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -759,31 +5324,29 @@ func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if m.CheckTx == nil { - m.CheckTx = &types.ResponseCheckTx{} - } - if err := m.CheckTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -810,13 +5373,32 @@ func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DeliverTx == nil { - m.DeliverTx = &types.ResponseDeliverTx{} + if m.PubKey == nil { + m.PubKey = &crypto.PublicKey{} } - if err := m.DeliverTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) + } + m.VotingPower = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VotingPower |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/proto/tendermint/rpc/grpc/types.proto b/proto/tendermint/rpc/grpc/types.proto index ee948a4065..6688429fda 100644 --- a/proto/tendermint/rpc/grpc/types.proto +++ b/proto/tendermint/rpc/grpc/types.proto @@ -3,6 +3,12 @@ package tendermint.rpc.grpc; option go_package = "github.com/tendermint/tendermint/rpc/grpc;coregrpc"; import "tendermint/abci/types.proto"; +import "tendermint/types/types.proto"; +import "tendermint/p2p/types.proto"; +import "tendermint/crypto/keys.proto"; +import "tendermint/types/validator.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; //---------------------------------------- // Request types @@ -13,6 +19,36 @@ message RequestBroadcastTx { bytes tx = 1; } +message BlockByHashRequest { + bytes hash = 1; + bool prove = 2; +} + +message BlockByHeightRequest { + int64 height = 1; + bool prove = 2; +} + +message BlockMetaByHashRequest { + bytes hash = 1; +} + +message BlockMetaByHeightRequest { + int64 height = 1; +} + +message CommitRequest { + int64 height = 1; +} + +message ValidatorSetRequest { + int64 height = 1; +} + +message SubscribeNewHeightsRequest {} + +message StatusRequest {} + //---------------------------------------- // Response types @@ -23,6 +59,71 @@ message ResponseBroadcastTx { tendermint.abci.ResponseDeliverTx deliver_tx = 2; } +message BlockByHashResponse { + tendermint.types.Part block_part = 1; + tendermint.types.Commit commit = 2; + tendermint.types.ValidatorSet validator_set = 3; + tendermint.types.BlockMeta block_meta = 4; + bool is_last = 5; +} + +message BlockByHeightResponse { + tendermint.types.Part block_part = 1; + tendermint.types.Commit commit = 2; + tendermint.types.ValidatorSet validator_set = 3; + tendermint.types.BlockMeta block_meta = 4; + bool is_last = 5; +} + +message BlockMetaByHashResponse { + tendermint.types.BlockMeta block_meta = 1; +} + +message BlockMetaByHeightResponse { + tendermint.types.BlockMeta block_meta = 1; +} + +message CommitResponse { + tendermint.types.Commit commit = 1; +} + +message ValidatorSetResponse { + tendermint.types.ValidatorSet validator_set = 1; +} + +message NewHeightEvent { + int64 height = 1; + bytes hash = 2; +} + +message StatusResponse { + tendermint.p2p.DefaultNodeInfo node_info = 1; + SyncInfo sync_info = 2; + ValidatorInfo validator_info = 3; +} + +message SyncInfo { + bytes latest_block_hash = 1; + bytes latest_app_hash = 2; + int64 latest_block_height = 3; + google.protobuf.Timestamp latest_block_time = 4 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + bytes earliest_block_hash = 5; + bytes earliest_app_hash = 6; + int64 earliest_block_height = 7; + google.protobuf.Timestamp earliest_block_time = 8 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + bool catching_up = 9; +} + +message ValidatorInfo { + bytes address = 1; + tendermint.crypto.PublicKey pub_key = 2; + int64 voting_power = 3; +} + //---------------------------------------- // Service Definition @@ -30,3 +131,14 @@ service BroadcastAPI { rpc Ping(RequestPing) returns (ResponsePing); rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx); } + +service BlockAPI { + rpc BlockByHash(BlockByHashRequest) returns (stream BlockByHashResponse); + rpc BlockMetaByHash(BlockMetaByHashRequest) returns (BlockMetaByHashResponse); + rpc BlockByHeight(BlockByHeightRequest) returns (stream BlockByHeightResponse); + rpc BlockMetaByHeight(BlockMetaByHeightRequest) returns (BlockMetaByHeightResponse); + rpc Commit(CommitRequest) returns (CommitResponse); + rpc ValidatorSet(ValidatorSetRequest) returns (ValidatorSetResponse); + rpc SubscribeNewHeights(SubscribeNewHeightsRequest) returns (stream NewHeightEvent); + rpc Status(StatusRequest) returns (StatusResponse); +} diff --git a/proto/tendermint/store/types.proto b/proto/tendermint/store/types.proto index e1d994b4b4..64a32d1f71 100644 --- a/proto/tendermint/store/types.proto +++ b/proto/tendermint/store/types.proto @@ -11,11 +11,11 @@ message BlockStoreState { // TxInfo describes the location of a tx inside a committed block // as well as the result of executing the transaction and the error log output. message TxInfo { - int64 height = 1; - uint32 index = 2; + int64 height = 1; + uint32 index = 2; // The response code of executing the tx. 0 means // successfully executed, all others are error codes. - uint32 code = 3; + uint32 code = 3; // The error log output generated if the transaction execution fails. - string error = 4; + string error = 4; } diff --git a/rpc/core/status.go b/rpc/core/status.go index 5c9c9e3408..1261d6d6ec 100644 --- a/rpc/core/status.go +++ b/rpc/core/status.go @@ -13,7 +13,7 @@ import ( // Status returns CometBFT status including node info, pubkey, latest block // hash, app hash, block height and time. // More: https://docs.cometbft.com/v0.34/rpc/#/Info/status -func Status(ctx *rpctypes.Context) (*ctypes.ResultStatus, error) { +func Status(_ *rpctypes.Context) (*ctypes.ResultStatus, error) { var ( earliestBlockHeight int64 earliestBlockHash cmtbytes.HexBytes diff --git a/rpc/grpc/api.go b/rpc/grpc/api.go index 62c6b66c17..78ed7480c5 100644 --- a/rpc/grpc/api.go +++ b/rpc/grpc/api.go @@ -2,10 +2,22 @@ package coregrpc import ( "context" + "errors" + "fmt" + "sync" + "time" + + "github.com/tendermint/tendermint/crypto/encoding" + + "github.com/tendermint/tendermint/proto/tendermint/crypto" + + "github.com/tendermint/tendermint/libs/rand" abci "github.com/tendermint/tendermint/abci/types" - core "github.com/tendermint/tendermint/rpc/core" + "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/tendermint/tendermint/rpc/core" rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types" + eventstypes "github.com/tendermint/tendermint/types" ) type broadcastAPI struct { @@ -37,3 +49,347 @@ func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcast }, }, nil } + +type BlockAPI struct { + sync.Mutex + heightListeners map[chan NewHeightEvent]struct{} + newBlockSubscription eventstypes.Subscription +} + +func NewBlockAPI() *BlockAPI { + return &BlockAPI{ + // TODO(rach-id) make 1000 configurable if there is a need for it + heightListeners: make(map[chan NewHeightEvent]struct{}, 1000), + } +} + +func (blockAPI *BlockAPI) StartNewBlockEventListener(ctx context.Context) { + env := core.GetEnvironment() + if blockAPI.newBlockSubscription == nil { + var err error + blockAPI.newBlockSubscription, err = env.EventBus.Subscribe( + ctx, + fmt.Sprintf("new-block-grpc-subscription-%s", rand.Str(6)), + eventstypes.EventQueryNewBlock, + 500, + ) + if err != nil { + env.Logger.Error("Failed to subscribe to new blocks", "err", err) + return + } + } + for { + select { + case <-ctx.Done(): + return + case <-blockAPI.newBlockSubscription.Cancelled(): + env.Logger.Error("cancelled grpc subscription. retrying") + ok, err := blockAPI.retryNewBlocksSubscription(ctx) + if err != nil { + blockAPI.closeAllListeners() + return + } + if !ok { + // this will happen when the context is done. we can stop here + return + } + case event, ok := <-blockAPI.newBlockSubscription.Out(): + if !ok { + env.Logger.Error("new blocks subscription closed. re-subscribing") + ok, err := blockAPI.retryNewBlocksSubscription(ctx) + if err != nil { + blockAPI.closeAllListeners() + return + } + if !ok { + // this will happen when the context is done. we can stop here + return + } + continue + } + newBlockEvent, ok := event.Events()[eventstypes.EventTypeKey] + if !ok || len(newBlockEvent) == 0 || newBlockEvent[0] != eventstypes.EventNewBlock { + continue + } + data, ok := event.Data().(eventstypes.EventDataNewBlock) + if !ok { + env.Logger.Debug("couldn't cast event data to new block") + continue + } + blockAPI.broadcastToListeners(ctx, data.Block.Height, data.Block.Hash()) + } + } + +} + +func (blockAPI *BlockAPI) retryNewBlocksSubscription(ctx context.Context) (bool, error) { + env := core.GetEnvironment() + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + blockAPI.Lock() + defer blockAPI.Unlock() + for i := 1; i < 6; i++ { + select { + case <-ctx.Done(): + return false, nil + case <-ticker.C: + var err error + blockAPI.newBlockSubscription, err = env.EventBus.Subscribe( + ctx, + fmt.Sprintf("new-block-grpc-subscription-%s", rand.Str(6)), + eventstypes.EventQueryNewBlock, + 500, + ) + if err != nil { + env.Logger.Error("Failed to subscribe to new blocks. retrying", "err", err, "retry_number", i) + } else { + return true, nil + } + } + } + return false, errors.New("couldn't recover from failed blocks subscription. stopping listeners") +} + +func (blockAPI *BlockAPI) broadcastToListeners(ctx context.Context, height int64, hash []byte) { + blockAPI.Lock() + defer blockAPI.Unlock() + for ch := range blockAPI.heightListeners { + func() { + defer func() { + if r := recover(); r != nil { + core.GetEnvironment().Logger.Debug("failed to write to heights listener", "err", r) + } + }() + select { + case <-ctx.Done(): + return + case ch <- NewHeightEvent{Height: height, Hash: hash}: + } + }() + } +} + +func (blockAPI *BlockAPI) addHeightListener() chan NewHeightEvent { + blockAPI.Lock() + defer blockAPI.Unlock() + ch := make(chan NewHeightEvent, 50) + blockAPI.heightListeners[ch] = struct{}{} + return ch +} + +func (blockAPI *BlockAPI) removeHeightListener(ch chan NewHeightEvent) { + blockAPI.Lock() + defer blockAPI.Unlock() + delete(blockAPI.heightListeners, ch) +} + +func (blockAPI *BlockAPI) closeAllListeners() { + blockAPI.Lock() + defer blockAPI.Unlock() + for channel := range blockAPI.heightListeners { + delete(blockAPI.heightListeners, channel) + } +} + +func (blockAPI *BlockAPI) BlockByHash(req *BlockByHashRequest, stream BlockAPI_BlockByHashServer) error { + blockStore := core.GetEnvironment().BlockStore + blockMeta := blockStore.LoadBlockMetaByHash(req.Hash) + if blockMeta == nil { + return fmt.Errorf("nil block meta for block hash %d", req.Hash) + } + commit := blockStore.LoadBlockCommit(blockMeta.Header.Height) + if commit == nil { + return fmt.Errorf("nil commit for block hash %d", req.Hash) + } + protoCommit := commit.ToProto() + + validatorSet, err := core.GetEnvironment().StateStore.LoadValidators(blockMeta.Header.Height) + if err != nil { + return err + } + protoValidatorSet, err := validatorSet.ToProto() + if err != nil { + return err + } + + for i := 0; i < int(blockMeta.BlockID.PartSetHeader.Total); i++ { + part, err := blockStore.LoadBlockPart(blockMeta.Header.Height, i).ToProto() + if err != nil { + return err + } + if part == nil { + return fmt.Errorf("nil block part %d for block hash %d", i, req.Hash) + } + if !req.Prove { + part.Proof = crypto.Proof{} + } + isLastPart := i == int(blockMeta.BlockID.PartSetHeader.Total)-1 + resp := BlockByHashResponse{ + BlockPart: part, + IsLast: isLastPart, + } + if i == 0 { + resp.BlockMeta = blockMeta.ToProto() + resp.ValidatorSet = protoValidatorSet + resp.Commit = protoCommit + } + err = stream.Send(&resp) + if err != nil { + return err + } + } + return nil +} + +func (blockAPI *BlockAPI) BlockByHeight(req *BlockByHeightRequest, stream BlockAPI_BlockByHeightServer) error { + blockStore := core.GetEnvironment().BlockStore + + blockMeta := blockStore.LoadBlockMeta(req.Height) + if blockMeta == nil { + return fmt.Errorf("nil block meta for height %d", req.Height) + } + + commit := blockStore.LoadSeenCommit(req.Height) + if commit == nil { + return fmt.Errorf("nil block commit for height %d", req.Height) + } + protoCommit := commit.ToProto() + + validatorSet, err := core.GetEnvironment().StateStore.LoadValidators(req.Height) + if err != nil { + return err + } + protoValidatorSet, err := validatorSet.ToProto() + if err != nil { + return err + } + + for i := 0; i < int(blockMeta.BlockID.PartSetHeader.Total); i++ { + part, err := blockStore.LoadBlockPart(req.Height, i).ToProto() + if err != nil { + return err + } + if part == nil { + return fmt.Errorf("nil block part %d for height %d", i, req.Height) + } + if !req.Prove { + part.Proof = crypto.Proof{} + } + isLastPart := i == int(blockMeta.BlockID.PartSetHeader.Total)-1 + resp := BlockByHeightResponse{ + BlockPart: part, + IsLast: isLastPart, + } + if i == 0 { + resp.BlockMeta = blockMeta.ToProto() + resp.ValidatorSet = protoValidatorSet + resp.Commit = protoCommit + } + err = stream.Send(&resp) + if err != nil { + return err + } + } + return nil +} + +func (blockAPI *BlockAPI) BlockMetaByHash(_ context.Context, req *BlockMetaByHashRequest) (*BlockMetaByHashResponse, error) { + blockMeta := core.GetEnvironment().BlockStore.LoadBlockMetaByHash(req.Hash) + if blockMeta == nil { + return nil, fmt.Errorf("nil block meta for block hash %d", req.Hash) + } + return &BlockMetaByHashResponse{ + BlockMeta: blockMeta.ToProto(), + }, nil +} + +func (blockAPI *BlockAPI) Status(_ context.Context, _ *StatusRequest) (*StatusResponse, error) { + status, err := core.Status(nil) + if err != nil { + return nil, err + } + + protoPubKey, err := encoding.PubKeyToProto(status.ValidatorInfo.PubKey) + if err != nil { + return nil, err + } + return &StatusResponse{ + NodeInfo: status.NodeInfo.ToProto(), + SyncInfo: &SyncInfo{ + LatestBlockHash: status.SyncInfo.LatestBlockHash, + LatestAppHash: status.SyncInfo.LatestAppHash, + LatestBlockHeight: status.SyncInfo.LatestBlockHeight, + LatestBlockTime: status.SyncInfo.LatestBlockTime, + EarliestBlockHash: status.SyncInfo.EarliestBlockHash, + EarliestAppHash: status.SyncInfo.EarliestAppHash, + EarliestBlockHeight: status.SyncInfo.EarliestBlockHeight, + EarliestBlockTime: status.SyncInfo.EarliestBlockTime, + CatchingUp: status.SyncInfo.CatchingUp, + }, + ValidatorInfo: &ValidatorInfo{ + Address: status.ValidatorInfo.Address, + PubKey: &protoPubKey, + VotingPower: status.ValidatorInfo.VotingPower, + }, + }, nil +} + +func (blockAPI *BlockAPI) BlockMetaByHeight(_ context.Context, req *BlockMetaByHeightRequest) (*BlockMetaByHeightResponse, error) { + blockMeta := core.GetEnvironment().BlockStore.LoadBlockMeta(req.Height) + if blockMeta == nil { + return nil, fmt.Errorf("nil block meta for block height %d", req.Height) + } + return &BlockMetaByHeightResponse{ + BlockMeta: blockMeta.ToProto(), + }, nil +} + +func (blockAPI *BlockAPI) Commit(_ context.Context, req *CommitRequest) (*CommitResponse, error) { + commit := core.GetEnvironment().BlockStore.LoadSeenCommit(req.Height) + if commit == nil { + return nil, fmt.Errorf("nil block commit for height %d", req.Height) + } + protoCommit := commit.ToProto() + + return &CommitResponse{ + Commit: &types.Commit{ + Height: protoCommit.Height, + Round: protoCommit.Round, + BlockID: protoCommit.BlockID, + Signatures: protoCommit.Signatures, + }, + }, nil +} + +func (blockAPI *BlockAPI) ValidatorSet(_ context.Context, req *ValidatorSetRequest) (*ValidatorSetResponse, error) { + validatorSet, err := core.GetEnvironment().StateStore.LoadValidators(req.Height) + if err != nil { + return nil, err + } + protoValidatorSet, err := validatorSet.ToProto() + if err != nil { + return nil, err + } + return &ValidatorSetResponse{ + ValidatorSet: protoValidatorSet, + }, nil +} + +func (blockAPI *BlockAPI) SubscribeNewHeights(_ *SubscribeNewHeightsRequest, stream BlockAPI_SubscribeNewHeightsServer) error { + heightListener := blockAPI.addHeightListener() + defer blockAPI.removeHeightListener(heightListener) + + for { + select { + case event, ok := <-heightListener: + if !ok { + return errors.New("blocks subscription closed from the service side") + } + if err := stream.Send(&event); err != nil { + return err + } + case <-stream.Context().Done(): + return nil + } + } +} diff --git a/rpc/grpc/client_server.go b/rpc/grpc/client_server.go index 196c464645..5fcbbe852b 100644 --- a/rpc/grpc/client_server.go +++ b/rpc/grpc/client_server.go @@ -21,6 +21,9 @@ type Config struct { func StartGRPCServer(ln net.Listener) error { grpcServer := grpc.NewServer() RegisterBroadcastAPIServer(grpcServer, &broadcastAPI{}) + api := NewBlockAPI() + go api.StartNewBlockEventListener(context.Background()) + RegisterBlockAPIServer(grpcServer, api) return grpcServer.Serve(ln) } @@ -34,6 +37,23 @@ func StartGRPCClient(protoAddr string) BroadcastAPIClient { return NewBroadcastAPIClient(conn) } +// StartBlockAPIGRPCClient dials the gRPC server using protoAddr and returns a new +// BlockAPIClient. +func StartBlockAPIGRPCClient(protoAddr string, opts ...grpc.DialOption) (BlockAPIClient, error) { + if len(opts) == 0 { + opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) + } + opts = append(opts, grpc.WithContextDialer(dialerFunc)) + conn, err := grpc.Dial( //nolint:staticcheck + protoAddr, + opts..., + ) + if err != nil { + return nil, err + } + return NewBlockAPIClient(conn), nil +} + func dialerFunc(ctx context.Context, addr string) (net.Conn, error) { return cmtnet.Connect(addr) } diff --git a/rpc/grpc/grpc_test.go b/rpc/grpc/grpc_test.go index 073ff51c99..dd7c1f0e4b 100644 --- a/rpc/grpc/grpc_test.go +++ b/rpc/grpc/grpc_test.go @@ -1,9 +1,19 @@ +//nolint:dupl package coregrpc_test import ( "context" "os" "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/tendermint/tendermint/libs/rand" + "github.com/tendermint/tendermint/proto/tendermint/crypto" + rpcclient "github.com/tendermint/tendermint/rpc/client" + rpchttp "github.com/tendermint/tendermint/rpc/client/http" + "github.com/tendermint/tendermint/rpc/core" + "github.com/tendermint/tendermint/types" "github.com/stretchr/testify/require" @@ -33,3 +43,351 @@ func TestBroadcastTx(t *testing.T) { require.EqualValues(t, 0, res.CheckTx.Code) require.EqualValues(t, 0, res.DeliverTx.Code) } + +func setupClient(t *testing.T) core_grpc.BlockAPIClient { + client, err := rpctest.GetBlockAPIClient() + require.NoError(t, err) + return client +} + +func TestBlockByHash(t *testing.T) { + client := setupClient(t) + expectedBlockMeta := core.GetEnvironment().BlockStore.LoadBlockMeta(1) + + // query the block along with the part proofs + res, err := client.BlockByHash(context.Background(), &core_grpc.BlockByHashRequest{ + Hash: expectedBlockMeta.BlockID.Hash, + Prove: true, + }) + require.NoError(t, err) + + part, err := res.Recv() + require.NoError(t, err) + + require.NotNil(t, part.BlockPart) + require.NotNil(t, part.ValidatorSet) + require.NotNil(t, part.Commit) + require.NotNil(t, part.BlockMeta) + + assert.NotEqual(t, part.BlockPart.Proof, crypto.Proof{}) + assert.Equal(t, part.BlockMeta.BlockID.Hash, expectedBlockMeta.BlockID.Hash.Bytes()) + + // query the block along without the part proofs + res, err = client.BlockByHash(context.Background(), &core_grpc.BlockByHashRequest{ + Hash: expectedBlockMeta.BlockID.Hash, + Prove: false, + }) + require.NoError(t, err) + + part, err = res.Recv() + require.NoError(t, err) + + require.NotNil(t, part.BlockPart) + require.NotNil(t, part.ValidatorSet) + require.NotNil(t, part.Commit) + require.NotNil(t, part.BlockMeta) + + assert.Equal(t, part.BlockPart.Proof, crypto.Proof{}) + assert.Equal(t, part.BlockMeta.BlockID.Hash, expectedBlockMeta.BlockID.Hash.Bytes()) +} + +func TestBlockMetaByHash(t *testing.T) { + client := setupClient(t) + waitForHeight(t, 2) + expectedBlockMeta := core.GetEnvironment().BlockStore.LoadBlockMeta(1) + + res, err := client.BlockMetaByHash(context.Background(), &core_grpc.BlockMetaByHashRequest{ + Hash: expectedBlockMeta.BlockID.Hash, + }) + require.NoError(t, err) + + assert.Equal(t, expectedBlockMeta.BlockID.Hash.Bytes(), res.BlockMeta.BlockID.Hash) +} + +func TestBlockMetaByHeight(t *testing.T) { + client := setupClient(t) + waitForHeight(t, 2) + expectedBlockMeta := core.GetEnvironment().BlockStore.LoadBlockMeta(1) + + res, err := client.BlockMetaByHeight(context.Background(), &core_grpc.BlockMetaByHeightRequest{ + Height: 1, + }) + require.NoError(t, err) + + assert.Equal(t, expectedBlockMeta.BlockID.Hash.Bytes(), res.BlockMeta.BlockID.Hash) +} + +func TestCommit(t *testing.T) { + client := setupClient(t) + waitForHeight(t, 2) + expectedBlockCommit := core.GetEnvironment().BlockStore.LoadSeenCommit(1) + + res, err := client.Commit(context.Background(), &core_grpc.CommitRequest{ + Height: 1, + }) + require.NoError(t, err) + + assert.Equal(t, expectedBlockCommit.BlockID.Hash.Bytes(), res.Commit.BlockID.Hash) +} + +func TestValidatorSet(t *testing.T) { + client := setupClient(t) + waitForHeight(t, 2) + expectedValidatorSet, err := core.GetEnvironment().StateStore.LoadValidators(1) + require.NoError(t, err) + + res, err := client.ValidatorSet(context.Background(), &core_grpc.ValidatorSetRequest{ + Height: 1, + }) + require.NoError(t, err) + + assert.Equal(t, len(expectedValidatorSet.Validators), len(res.ValidatorSet.Validators)) +} + +func TestStatus(t *testing.T) { + client := setupClient(t) + expectedStatus, err := core.Status(nil) + require.NoError(t, err) + + res, err := client.Status(context.Background(), &core_grpc.StatusRequest{}) + require.NoError(t, err) + assert.Equal(t, string(expectedStatus.NodeInfo.DefaultNodeID), res.NodeInfo.DefaultNodeID) +} + +func TestSubscribeNewHeights(t *testing.T) { + client := setupClient(t) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + stream, err := client.SubscribeNewHeights(ctx, &core_grpc.SubscribeNewHeightsRequest{}) + require.NoError(t, err) + store := core.GetEnvironment().BlockStore + + go func() { + listenedHeightsCount := 0 + defer func() { + assert.Greater(t, listenedHeightsCount, 0) + }() + for { + res, err := stream.Recv() + if ctx.Err() != nil { + return + } + require.NoError(t, err) + require.Greater(t, res.Height, int64(0)) + assert.Equal(t, store.LoadBlockMeta(res.Height).BlockID.Hash.Bytes(), res.Hash) + listenedHeightsCount++ + } + }() + + time.Sleep(5 * time.Second) +} + +func TestBlockByHash_Streaming(t *testing.T) { + client := setupClient(t) + + // send a big transaction that would result in a block + // containing multiple block parts + txRes, err := rpctest.GetGRPCClient().BroadcastTx( + context.Background(), + &core_grpc.RequestBroadcastTx{Tx: rand.NewRand().Bytes(1000000)}, + ) + require.NoError(t, err) + require.EqualValues(t, 0, txRes.CheckTx.Code) + require.EqualValues(t, 0, txRes.DeliverTx.Code) + + var expectedBlockMeta types.BlockMeta + for i := int64(1); i < 500; i++ { + waitForHeight(t, i+1) + blockMeta := core.GetEnvironment().BlockStore.LoadBlockMeta(i) + if blockMeta.BlockID.PartSetHeader.Total > 1 { + expectedBlockMeta = *blockMeta + break + } + } + + // query the block without the part proofs + res, err := client.BlockByHash(context.Background(), &core_grpc.BlockByHashRequest{ + Hash: expectedBlockMeta.BlockID.Hash, + Prove: false, + }) + require.NoError(t, err) + + part1, err := res.Recv() + require.NoError(t, err) + + require.NotNil(t, part1.BlockPart) + require.NotNil(t, part1.ValidatorSet) + require.NotNil(t, part1.Commit) + require.NotNil(t, part1.BlockMeta) + + assert.Equal(t, part1.BlockPart.Proof, crypto.Proof{}) + assert.Equal(t, part1.BlockMeta.BlockID.Hash, expectedBlockMeta.BlockID.Hash.Bytes()) + + part2, err := res.Recv() + require.NoError(t, err) + + require.NotNil(t, part2.BlockPart) + require.Nil(t, part2.ValidatorSet) + require.Nil(t, part2.Commit) + require.Nil(t, part2.BlockMeta) + + assert.Equal(t, part2.BlockPart.Proof, crypto.Proof{}) + + // query the block along with the part proofs + res, err = client.BlockByHash(context.Background(), &core_grpc.BlockByHashRequest{ + Hash: expectedBlockMeta.BlockID.Hash, + Prove: true, + }) + require.NoError(t, err) + + part1, err = res.Recv() + require.NoError(t, err) + + require.NotNil(t, part1.BlockPart) + require.NotNil(t, part1.ValidatorSet) + require.NotNil(t, part1.Commit) + require.NotNil(t, part1.BlockMeta) + + assert.NotEqual(t, part1.BlockPart.Proof, crypto.Proof{}) + assert.Equal(t, part1.BlockMeta.BlockID.Hash, expectedBlockMeta.BlockID.Hash.Bytes()) + + part2, err = res.Recv() + require.NoError(t, err) + + require.NotNil(t, part2.BlockPart) + require.Nil(t, part2.ValidatorSet) + require.Nil(t, part2.Commit) + require.Nil(t, part2.BlockMeta) + + assert.NotEqual(t, part2.BlockPart.Proof, crypto.Proof{}) +} + +func TestBlockByHeight(t *testing.T) { + client := setupClient(t) + waitForHeight(t, 2) + expectedBlockMeta := core.GetEnvironment().BlockStore.LoadBlockMeta(1) + + // query the block along with the part proofs + res, err := client.BlockByHeight(context.Background(), &core_grpc.BlockByHeightRequest{ + Height: expectedBlockMeta.Header.Height, + Prove: true, + }) + require.NoError(t, err) + + part, err := res.Recv() + require.NoError(t, err) + + require.NotNil(t, part.BlockPart) + require.NotNil(t, part.ValidatorSet) + require.NotNil(t, part.Commit) + require.NotNil(t, part.BlockMeta) + + assert.NotEqual(t, part.BlockPart.Proof, crypto.Proof{}) + assert.Equal(t, part.BlockMeta.BlockID.Hash, expectedBlockMeta.BlockID.Hash.Bytes()) + + // query the block along without the part proofs + res, err = client.BlockByHeight(context.Background(), &core_grpc.BlockByHeightRequest{ + Height: expectedBlockMeta.Header.Height, + Prove: false, + }) + require.NoError(t, err) + + part, err = res.Recv() + require.NoError(t, err) + + require.NotNil(t, part.BlockPart) + require.NotNil(t, part.ValidatorSet) + require.NotNil(t, part.Commit) + require.NotNil(t, part.BlockMeta) + + assert.Equal(t, part.BlockPart.Proof, crypto.Proof{}) + assert.Equal(t, part.BlockMeta.BlockID.Hash, expectedBlockMeta.BlockID.Hash.Bytes()) +} + +func TestBlockQuery_Streaming(t *testing.T) { + client := setupClient(t) + + // send a big transaction that would result in a block + // containing multiple block parts + txRes, err := rpctest.GetGRPCClient().BroadcastTx( + context.Background(), + &core_grpc.RequestBroadcastTx{Tx: rand.NewRand().Bytes(1000000)}, + ) + require.NoError(t, err) + require.EqualValues(t, 0, txRes.CheckTx.Code) + require.EqualValues(t, 0, txRes.DeliverTx.Code) + + var expectedBlockMeta types.BlockMeta + for i := int64(1); i < 500; i++ { + waitForHeight(t, i+1) + blockMeta := core.GetEnvironment().BlockStore.LoadBlockMeta(i) + if blockMeta.BlockID.PartSetHeader.Total > 1 { + expectedBlockMeta = *blockMeta + break + } + } + + // query the block without the part proofs + res, err := client.BlockByHeight(context.Background(), &core_grpc.BlockByHeightRequest{ + Height: expectedBlockMeta.Header.Height, + Prove: false, + }) + require.NoError(t, err) + + part1, err := res.Recv() + require.NoError(t, err) + + require.NotNil(t, part1.BlockPart) + require.NotNil(t, part1.ValidatorSet) + require.NotNil(t, part1.Commit) + require.NotNil(t, part1.BlockMeta) + + assert.Equal(t, part1.BlockPart.Proof, crypto.Proof{}) + assert.Equal(t, part1.BlockMeta.BlockID.Hash, expectedBlockMeta.BlockID.Hash.Bytes()) + + part2, err := res.Recv() + require.NoError(t, err) + + require.NotNil(t, part2.BlockPart) + require.Nil(t, part2.ValidatorSet) + require.Nil(t, part2.Commit) + require.Nil(t, part2.BlockMeta) + + assert.Equal(t, part2.BlockPart.Proof, crypto.Proof{}) + + // query the block along with the part proofs + res, err = client.BlockByHeight(context.Background(), &core_grpc.BlockByHeightRequest{ + Height: expectedBlockMeta.Header.Height, + Prove: true, + }) + require.NoError(t, err) + + part1, err = res.Recv() + require.NoError(t, err) + + require.NotNil(t, part1.BlockPart) + require.NotNil(t, part1.ValidatorSet) + require.NotNil(t, part1.Commit) + require.NotNil(t, part1.BlockMeta) + + assert.NotEqual(t, part1.BlockPart.Proof, crypto.Proof{}) + assert.Equal(t, part1.BlockMeta.BlockID.Hash, expectedBlockMeta.BlockID.Hash.Bytes()) + + part2, err = res.Recv() + require.NoError(t, err) + + require.NotNil(t, part2.BlockPart) + require.Nil(t, part2.ValidatorSet) + require.Nil(t, part2.Commit) + require.Nil(t, part2.BlockMeta) + + assert.NotEqual(t, part2.BlockPart.Proof, crypto.Proof{}) +} + +func waitForHeight(t *testing.T, height int64) { + rpcAddr := rpctest.GetConfig().RPC.ListenAddress + c, err := rpchttp.New(rpcAddr, "/websocket") + require.NoError(t, err) + err = rpcclient.WaitForHeight(c, height, nil) + require.NoError(t, err) +} diff --git a/rpc/grpc/types.pb.go b/rpc/grpc/types.pb.go index b9cbee03fc..e49e9dc121 100644 --- a/rpc/grpc/types.pb.go +++ b/rpc/grpc/types.pb.go @@ -6,20 +6,28 @@ package coregrpc import ( context "context" fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types "github.com/tendermint/tendermint/abci/types" + crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" + p2p "github.com/tendermint/tendermint/proto/tendermint/p2p" + types1 "github.com/tendermint/tendermint/proto/tendermint/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -107,6 +115,358 @@ func (m *RequestBroadcastTx) GetTx() []byte { return nil } +type BlockByHashRequest struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Prove bool `protobuf:"varint,2,opt,name=prove,proto3" json:"prove,omitempty"` +} + +func (m *BlockByHashRequest) Reset() { *m = BlockByHashRequest{} } +func (m *BlockByHashRequest) String() string { return proto.CompactTextString(m) } +func (*BlockByHashRequest) ProtoMessage() {} +func (*BlockByHashRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{2} +} +func (m *BlockByHashRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockByHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockByHashRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockByHashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockByHashRequest.Merge(m, src) +} +func (m *BlockByHashRequest) XXX_Size() int { + return m.Size() +} +func (m *BlockByHashRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BlockByHashRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockByHashRequest proto.InternalMessageInfo + +func (m *BlockByHashRequest) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *BlockByHashRequest) GetProve() bool { + if m != nil { + return m.Prove + } + return false +} + +type BlockByHeightRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Prove bool `protobuf:"varint,2,opt,name=prove,proto3" json:"prove,omitempty"` +} + +func (m *BlockByHeightRequest) Reset() { *m = BlockByHeightRequest{} } +func (m *BlockByHeightRequest) String() string { return proto.CompactTextString(m) } +func (*BlockByHeightRequest) ProtoMessage() {} +func (*BlockByHeightRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{3} +} +func (m *BlockByHeightRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockByHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockByHeightRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockByHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockByHeightRequest.Merge(m, src) +} +func (m *BlockByHeightRequest) XXX_Size() int { + return m.Size() +} +func (m *BlockByHeightRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BlockByHeightRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockByHeightRequest proto.InternalMessageInfo + +func (m *BlockByHeightRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *BlockByHeightRequest) GetProve() bool { + if m != nil { + return m.Prove + } + return false +} + +type BlockMetaByHashRequest struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *BlockMetaByHashRequest) Reset() { *m = BlockMetaByHashRequest{} } +func (m *BlockMetaByHashRequest) String() string { return proto.CompactTextString(m) } +func (*BlockMetaByHashRequest) ProtoMessage() {} +func (*BlockMetaByHashRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{4} +} +func (m *BlockMetaByHashRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockMetaByHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetaByHashRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockMetaByHashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetaByHashRequest.Merge(m, src) +} +func (m *BlockMetaByHashRequest) XXX_Size() int { + return m.Size() +} +func (m *BlockMetaByHashRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetaByHashRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockMetaByHashRequest proto.InternalMessageInfo + +func (m *BlockMetaByHashRequest) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +type BlockMetaByHeightRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *BlockMetaByHeightRequest) Reset() { *m = BlockMetaByHeightRequest{} } +func (m *BlockMetaByHeightRequest) String() string { return proto.CompactTextString(m) } +func (*BlockMetaByHeightRequest) ProtoMessage() {} +func (*BlockMetaByHeightRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{5} +} +func (m *BlockMetaByHeightRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockMetaByHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetaByHeightRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockMetaByHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetaByHeightRequest.Merge(m, src) +} +func (m *BlockMetaByHeightRequest) XXX_Size() int { + return m.Size() +} +func (m *BlockMetaByHeightRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetaByHeightRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockMetaByHeightRequest proto.InternalMessageInfo + +func (m *BlockMetaByHeightRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +type CommitRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *CommitRequest) Reset() { *m = CommitRequest{} } +func (m *CommitRequest) String() string { return proto.CompactTextString(m) } +func (*CommitRequest) ProtoMessage() {} +func (*CommitRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{6} +} +func (m *CommitRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommitRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CommitRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitRequest.Merge(m, src) +} +func (m *CommitRequest) XXX_Size() int { + return m.Size() +} +func (m *CommitRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CommitRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CommitRequest proto.InternalMessageInfo + +func (m *CommitRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +type ValidatorSetRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *ValidatorSetRequest) Reset() { *m = ValidatorSetRequest{} } +func (m *ValidatorSetRequest) String() string { return proto.CompactTextString(m) } +func (*ValidatorSetRequest) ProtoMessage() {} +func (*ValidatorSetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{7} +} +func (m *ValidatorSetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorSetRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorSetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorSetRequest.Merge(m, src) +} +func (m *ValidatorSetRequest) XXX_Size() int { + return m.Size() +} +func (m *ValidatorSetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorSetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorSetRequest proto.InternalMessageInfo + +func (m *ValidatorSetRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +type SubscribeNewHeightsRequest struct { +} + +func (m *SubscribeNewHeightsRequest) Reset() { *m = SubscribeNewHeightsRequest{} } +func (m *SubscribeNewHeightsRequest) String() string { return proto.CompactTextString(m) } +func (*SubscribeNewHeightsRequest) ProtoMessage() {} +func (*SubscribeNewHeightsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{8} +} +func (m *SubscribeNewHeightsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SubscribeNewHeightsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SubscribeNewHeightsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SubscribeNewHeightsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubscribeNewHeightsRequest.Merge(m, src) +} +func (m *SubscribeNewHeightsRequest) XXX_Size() int { + return m.Size() +} +func (m *SubscribeNewHeightsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SubscribeNewHeightsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SubscribeNewHeightsRequest proto.InternalMessageInfo + +type StatusRequest struct { +} + +func (m *StatusRequest) Reset() { *m = StatusRequest{} } +func (m *StatusRequest) String() string { return proto.CompactTextString(m) } +func (*StatusRequest) ProtoMessage() {} +func (*StatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{9} +} +func (m *StatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusRequest.Merge(m, src) +} +func (m *StatusRequest) XXX_Size() int { + return m.Size() +} +func (m *StatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusRequest proto.InternalMessageInfo + type ResponsePing struct { } @@ -114,7 +474,7 @@ func (m *ResponsePing) Reset() { *m = ResponsePing{} } func (m *ResponsePing) String() string { return proto.CompactTextString(m) } func (*ResponsePing) ProtoMessage() {} func (*ResponsePing) Descriptor() ([]byte, []int) { - return fileDescriptor_0ffff5682c662b95, []int{2} + return fileDescriptor_0ffff5682c662b95, []int{10} } func (m *ResponsePing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -152,7 +512,7 @@ func (m *ResponseBroadcastTx) Reset() { *m = ResponseBroadcastTx{} } func (m *ResponseBroadcastTx) String() string { return proto.CompactTextString(m) } func (*ResponseBroadcastTx) ProtoMessage() {} func (*ResponseBroadcastTx) Descriptor() ([]byte, []int) { - return fileDescriptor_0ffff5682c662b95, []int{3} + return fileDescriptor_0ffff5682c662b95, []int{11} } func (m *ResponseBroadcastTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -195,425 +555,4608 @@ func (m *ResponseBroadcastTx) GetDeliverTx() *types.ResponseDeliverTx { return nil } -func init() { - proto.RegisterType((*RequestPing)(nil), "tendermint.rpc.grpc.RequestPing") - proto.RegisterType((*RequestBroadcastTx)(nil), "tendermint.rpc.grpc.RequestBroadcastTx") - proto.RegisterType((*ResponsePing)(nil), "tendermint.rpc.grpc.ResponsePing") - proto.RegisterType((*ResponseBroadcastTx)(nil), "tendermint.rpc.grpc.ResponseBroadcastTx") +type BlockByHashResponse struct { + BlockPart *types1.Part `protobuf:"bytes,1,opt,name=block_part,json=blockPart,proto3" json:"block_part,omitempty"` + Commit *types1.Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,3,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + BlockMeta *types1.BlockMeta `protobuf:"bytes,4,opt,name=block_meta,json=blockMeta,proto3" json:"block_meta,omitempty"` + IsLast bool `protobuf:"varint,5,opt,name=is_last,json=isLast,proto3" json:"is_last,omitempty"` } -func init() { proto.RegisterFile("tendermint/rpc/grpc/types.proto", fileDescriptor_0ffff5682c662b95) } - -var fileDescriptor_0ffff5682c662b95 = []byte{ - // 316 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0x49, 0xcd, 0x4b, - 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0x2a, 0x48, 0xd6, 0x4f, 0x07, 0x11, 0x25, 0x95, - 0x05, 0xa9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xc2, 0x08, 0x05, 0x7a, 0x45, 0x05, - 0xc9, 0x7a, 0x20, 0x05, 0x52, 0xd2, 0x48, 0xba, 0x12, 0x93, 0x92, 0x33, 0x91, 0x75, 0x28, 0xf1, - 0x72, 0x71, 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x04, 0x64, 0xe6, 0xa5, 0x2b, 0xa9, 0x70, - 0x09, 0x41, 0xb9, 0x4e, 0x45, 0xf9, 0x89, 0x29, 0xc9, 0x89, 0xc5, 0x25, 0x21, 0x15, 0x42, 0x7c, - 0x5c, 0x4c, 0x25, 0x15, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x4c, 0x25, 0x15, 0x4a, 0x7c, - 0x5c, 0x3c, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x60, 0x5d, 0x53, 0x19, 0xb9, 0x84, - 0x61, 0x02, 0xc8, 0xfa, 0xac, 0xb9, 0x38, 0x92, 0x33, 0x52, 0x93, 0xb3, 0xe3, 0xa1, 0xba, 0xb9, - 0x8d, 0x14, 0xf4, 0x90, 0x5c, 0x08, 0x72, 0x8c, 0x1e, 0x4c, 0x9f, 0x33, 0x48, 0x61, 0x48, 0x45, - 0x10, 0x7b, 0x32, 0x84, 0x21, 0xe4, 0xc8, 0xc5, 0x95, 0x92, 0x9a, 0x93, 0x59, 0x96, 0x5a, 0x04, - 0xd2, 0xce, 0x04, 0xd6, 0xae, 0x84, 0x53, 0xbb, 0x0b, 0x44, 0x69, 0x48, 0x45, 0x10, 0x67, 0x0a, - 0x8c, 0x69, 0xb4, 0x97, 0x91, 0x8b, 0x07, 0xee, 0x1e, 0xc7, 0x00, 0x4f, 0x21, 0x6f, 0x2e, 0x16, - 0x90, 0x83, 0x85, 0x50, 0x9c, 0x01, 0x0b, 0x28, 0x3d, 0xa4, 0x80, 0x90, 0x52, 0xc4, 0xa1, 0x02, - 0xe1, 0x6b, 0xa1, 0x04, 0x2e, 0x6e, 0x64, 0xcf, 0xaa, 0xe3, 0x33, 0x13, 0x49, 0xa1, 0x94, 0x06, - 0x5e, 0xa3, 0x91, 0x54, 0x3a, 0xf9, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, - 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, - 0x94, 0x51, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x52, 0xf4, 0x62, - 0x49, 0x1f, 0xd6, 0xc9, 0xf9, 0x45, 0xa9, 0x20, 0x46, 0x12, 0x1b, 0x38, 0xc6, 0x8d, 0x01, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xf6, 0x4b, 0x02, 0xd8, 0x46, 0x02, 0x00, 0x00, +func (m *BlockByHashResponse) Reset() { *m = BlockByHashResponse{} } +func (m *BlockByHashResponse) String() string { return proto.CompactTextString(m) } +func (*BlockByHashResponse) ProtoMessage() {} +func (*BlockByHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{12} +} +func (m *BlockByHashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockByHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockByHashResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockByHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockByHashResponse.Merge(m, src) +} +func (m *BlockByHashResponse) XXX_Size() int { + return m.Size() +} +func (m *BlockByHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BlockByHashResponse.DiscardUnknown(m) } -// 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 +var xxx_messageInfo_BlockByHashResponse proto.InternalMessageInfo -// BroadcastAPIClient is the client API for BroadcastAPI service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type BroadcastAPIClient interface { - Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) - BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) +func (m *BlockByHashResponse) GetBlockPart() *types1.Part { + if m != nil { + return m.BlockPart + } + return nil } -type broadcastAPIClient struct { - cc *grpc.ClientConn +func (m *BlockByHashResponse) GetCommit() *types1.Commit { + if m != nil { + return m.Commit + } + return nil } -func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient { - return &broadcastAPIClient{cc} +func (m *BlockByHashResponse) GetValidatorSet() *types1.ValidatorSet { + if m != nil { + return m.ValidatorSet + } + return nil } -func (c *broadcastAPIClient) Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) { - out := new(ResponsePing) - err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BroadcastAPI/Ping", in, out, opts...) - if err != nil { - return nil, err +func (m *BlockByHashResponse) GetBlockMeta() *types1.BlockMeta { + if m != nil { + return m.BlockMeta } - return out, nil + return nil } -func (c *broadcastAPIClient) BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) { - out := new(ResponseBroadcastTx) - err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BroadcastAPI/BroadcastTx", in, out, opts...) - if err != nil { - return nil, err +func (m *BlockByHashResponse) GetIsLast() bool { + if m != nil { + return m.IsLast } - return out, nil + return false } -// BroadcastAPIServer is the server API for BroadcastAPI service. -type BroadcastAPIServer interface { - Ping(context.Context, *RequestPing) (*ResponsePing, error) - BroadcastTx(context.Context, *RequestBroadcastTx) (*ResponseBroadcastTx, error) +type BlockByHeightResponse struct { + BlockPart *types1.Part `protobuf:"bytes,1,opt,name=block_part,json=blockPart,proto3" json:"block_part,omitempty"` + Commit *types1.Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,3,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + BlockMeta *types1.BlockMeta `protobuf:"bytes,4,opt,name=block_meta,json=blockMeta,proto3" json:"block_meta,omitempty"` + IsLast bool `protobuf:"varint,5,opt,name=is_last,json=isLast,proto3" json:"is_last,omitempty"` } -// UnimplementedBroadcastAPIServer can be embedded to have forward compatible implementations. -type UnimplementedBroadcastAPIServer struct { +func (m *BlockByHeightResponse) Reset() { *m = BlockByHeightResponse{} } +func (m *BlockByHeightResponse) String() string { return proto.CompactTextString(m) } +func (*BlockByHeightResponse) ProtoMessage() {} +func (*BlockByHeightResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{13} } - -func (*UnimplementedBroadcastAPIServer) Ping(ctx context.Context, req *RequestPing) (*ResponsePing, error) { - return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +func (m *BlockByHeightResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedBroadcastAPIServer) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) { - return nil, status.Errorf(codes.Unimplemented, "method BroadcastTx not implemented") +func (m *BlockByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockByHeightResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } - -func RegisterBroadcastAPIServer(s *grpc.Server, srv BroadcastAPIServer) { - s.RegisterService(&_BroadcastAPI_serviceDesc, srv) +func (m *BlockByHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockByHeightResponse.Merge(m, src) +} +func (m *BlockByHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *BlockByHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BlockByHeightResponse.DiscardUnknown(m) } -func _BroadcastAPI_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestPing) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BroadcastAPIServer).Ping(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/tendermint.rpc.grpc.BroadcastAPI/Ping", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BroadcastAPIServer).Ping(ctx, req.(*RequestPing)) +var xxx_messageInfo_BlockByHeightResponse proto.InternalMessageInfo + +func (m *BlockByHeightResponse) GetBlockPart() *types1.Part { + if m != nil { + return m.BlockPart } - return interceptor(ctx, in, info, handler) + return nil } -func _BroadcastAPI_BroadcastTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestBroadcastTx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BroadcastAPIServer).BroadcastTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/tendermint.rpc.grpc.BroadcastAPI/BroadcastTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BroadcastAPIServer).BroadcastTx(ctx, req.(*RequestBroadcastTx)) +func (m *BlockByHeightResponse) GetCommit() *types1.Commit { + if m != nil { + return m.Commit } - return interceptor(ctx, in, info, handler) + return nil } -var _BroadcastAPI_serviceDesc = grpc.ServiceDesc{ - ServiceName: "tendermint.rpc.grpc.BroadcastAPI", - HandlerType: (*BroadcastAPIServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Ping", - Handler: _BroadcastAPI_Ping_Handler, - }, - { - MethodName: "BroadcastTx", - Handler: _BroadcastAPI_BroadcastTx_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "tendermint/rpc/grpc/types.proto", +func (m *BlockByHeightResponse) GetValidatorSet() *types1.ValidatorSet { + if m != nil { + return m.ValidatorSet + } + return nil } -func (m *RequestPing) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *BlockByHeightResponse) GetBlockMeta() *types1.BlockMeta { + if m != nil { + return m.BlockMeta } - return dAtA[:n], nil + return nil } -func (m *RequestPing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *BlockByHeightResponse) GetIsLast() bool { + if m != nil { + return m.IsLast + } + return false } -func (m *RequestPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +type BlockMetaByHashResponse struct { + BlockMeta *types1.BlockMeta `protobuf:"bytes,1,opt,name=block_meta,json=blockMeta,proto3" json:"block_meta,omitempty"` } -func (m *RequestBroadcastTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (m *BlockMetaByHashResponse) Reset() { *m = BlockMetaByHashResponse{} } +func (m *BlockMetaByHashResponse) String() string { return proto.CompactTextString(m) } +func (*BlockMetaByHashResponse) ProtoMessage() {} +func (*BlockMetaByHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{14} } - -func (m *RequestBroadcastTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *BlockMetaByHashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -func (m *RequestBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tx) > 0 { - i -= len(m.Tx) - copy(dAtA[i:], m.Tx) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) - i-- - dAtA[i] = 0xa +func (m *BlockMetaByHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetaByHashResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *BlockMetaByHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetaByHashResponse.Merge(m, src) +} +func (m *BlockMetaByHashResponse) XXX_Size() int { + return m.Size() +} +func (m *BlockMetaByHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetaByHashResponse.DiscardUnknown(m) } -func (m *ResponsePing) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_BlockMetaByHashResponse proto.InternalMessageInfo + +func (m *BlockMetaByHashResponse) GetBlockMeta() *types1.BlockMeta { + if m != nil { + return m.BlockMeta } - return dAtA[:n], nil + return nil } -func (m *ResponsePing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type BlockMetaByHeightResponse struct { + BlockMeta *types1.BlockMeta `protobuf:"bytes,1,opt,name=block_meta,json=blockMeta,proto3" json:"block_meta,omitempty"` } -func (m *ResponsePing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func (m *BlockMetaByHeightResponse) Reset() { *m = BlockMetaByHeightResponse{} } +func (m *BlockMetaByHeightResponse) String() string { return proto.CompactTextString(m) } +func (*BlockMetaByHeightResponse) ProtoMessage() {} +func (*BlockMetaByHeightResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{15} +} +func (m *BlockMetaByHeightResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockMetaByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetaByHeightResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockMetaByHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetaByHeightResponse.Merge(m, src) +} +func (m *BlockMetaByHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *BlockMetaByHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetaByHeightResponse.DiscardUnknown(m) } -func (m *ResponseBroadcastTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_BlockMetaByHeightResponse proto.InternalMessageInfo + +func (m *BlockMetaByHeightResponse) GetBlockMeta() *types1.BlockMeta { + if m != nil { + return m.BlockMeta } - return dAtA[:n], nil + return nil } -func (m *ResponseBroadcastTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type CommitResponse struct { + Commit *types1.Commit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"` } -func (m *ResponseBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DeliverTx != nil { - { - size, err := m.DeliverTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.CheckTx != nil { - { - size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) +func (m *CommitResponse) Reset() { *m = CommitResponse{} } +func (m *CommitResponse) String() string { return proto.CompactTextString(m) } +func (*CommitResponse) ProtoMessage() {} +func (*CommitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{16} +} +func (m *CommitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0xa + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *CommitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitResponse.Merge(m, src) +} +func (m *CommitResponse) XXX_Size() int { + return m.Size() +} +func (m *CommitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CommitResponse.DiscardUnknown(m) } -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +var xxx_messageInfo_CommitResponse proto.InternalMessageInfo + +func (m *CommitResponse) GetCommit() *types1.Commit { + if m != nil { + return m.Commit } - dAtA[offset] = uint8(v) - return base + return nil } -func (m *RequestPing) Size() (n int) { - if m == nil { - return 0 + +type ValidatorSetResponse struct { + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` +} + +func (m *ValidatorSetResponse) Reset() { *m = ValidatorSetResponse{} } +func (m *ValidatorSetResponse) String() string { return proto.CompactTextString(m) } +func (*ValidatorSetResponse) ProtoMessage() {} +func (*ValidatorSetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{17} +} +func (m *ValidatorSetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorSetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorSetResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - var l int - _ = l - return n +} +func (m *ValidatorSetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorSetResponse.Merge(m, src) +} +func (m *ValidatorSetResponse) XXX_Size() int { + return m.Size() +} +func (m *ValidatorSetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorSetResponse.DiscardUnknown(m) } -func (m *RequestBroadcastTx) Size() (n int) { - if m == nil { - return 0 +var xxx_messageInfo_ValidatorSetResponse proto.InternalMessageInfo + +func (m *ValidatorSetResponse) GetValidatorSet() *types1.ValidatorSet { + if m != nil { + return m.ValidatorSet } - var l int - _ = l - l = len(m.Tx) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + return nil +} + +type NewHeightEvent struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *NewHeightEvent) Reset() { *m = NewHeightEvent{} } +func (m *NewHeightEvent) String() string { return proto.CompactTextString(m) } +func (*NewHeightEvent) ProtoMessage() {} +func (*NewHeightEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{18} +} +func (m *NewHeightEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NewHeightEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NewHeightEvent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return n +} +func (m *NewHeightEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_NewHeightEvent.Merge(m, src) +} +func (m *NewHeightEvent) XXX_Size() int { + return m.Size() +} +func (m *NewHeightEvent) XXX_DiscardUnknown() { + xxx_messageInfo_NewHeightEvent.DiscardUnknown(m) } -func (m *ResponsePing) Size() (n int) { - if m == nil { - return 0 +var xxx_messageInfo_NewHeightEvent proto.InternalMessageInfo + +func (m *NewHeightEvent) GetHeight() int64 { + if m != nil { + return m.Height } - var l int - _ = l - return n + return 0 } -func (m *ResponseBroadcastTx) Size() (n int) { - if m == nil { - return 0 +func (m *NewHeightEvent) GetHash() []byte { + if m != nil { + return m.Hash } - var l int - _ = l - if m.CheckTx != nil { - l = m.CheckTx.Size() - n += 1 + l + sovTypes(uint64(l)) + return nil +} + +type StatusResponse struct { + NodeInfo *p2p.DefaultNodeInfo `protobuf:"bytes,1,opt,name=node_info,json=nodeInfo,proto3" json:"node_info,omitempty"` + SyncInfo *SyncInfo `protobuf:"bytes,2,opt,name=sync_info,json=syncInfo,proto3" json:"sync_info,omitempty"` + ValidatorInfo *ValidatorInfo `protobuf:"bytes,3,opt,name=validator_info,json=validatorInfo,proto3" json:"validator_info,omitempty"` +} + +func (m *StatusResponse) Reset() { *m = StatusResponse{} } +func (m *StatusResponse) String() string { return proto.CompactTextString(m) } +func (*StatusResponse) ProtoMessage() {} +func (*StatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{19} +} +func (m *StatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - if m.DeliverTx != nil { - l = m.DeliverTx.Size() - n += 1 + l + sovTypes(uint64(l)) +} +func (m *StatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusResponse.Merge(m, src) +} +func (m *StatusResponse) XXX_Size() int { + return m.Size() +} +func (m *StatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusResponse proto.InternalMessageInfo + +func (m *StatusResponse) GetNodeInfo() *p2p.DefaultNodeInfo { + if m != nil { + return m.NodeInfo } - return n + return nil } -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *StatusResponse) GetSyncInfo() *SyncInfo { + if m != nil { + return m.SyncInfo + } + return nil } -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *StatusResponse) GetValidatorInfo() *ValidatorInfo { + if m != nil { + return m.ValidatorInfo + } + return nil } -func (m *RequestPing) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + +type SyncInfo struct { + LatestBlockHash []byte `protobuf:"bytes,1,opt,name=latest_block_hash,json=latestBlockHash,proto3" json:"latest_block_hash,omitempty"` + LatestAppHash []byte `protobuf:"bytes,2,opt,name=latest_app_hash,json=latestAppHash,proto3" json:"latest_app_hash,omitempty"` + LatestBlockHeight int64 `protobuf:"varint,3,opt,name=latest_block_height,json=latestBlockHeight,proto3" json:"latest_block_height,omitempty"` + LatestBlockTime time.Time `protobuf:"bytes,4,opt,name=latest_block_time,json=latestBlockTime,proto3,stdtime" json:"latest_block_time"` + EarliestBlockHash []byte `protobuf:"bytes,5,opt,name=earliest_block_hash,json=earliestBlockHash,proto3" json:"earliest_block_hash,omitempty"` + EarliestAppHash []byte `protobuf:"bytes,6,opt,name=earliest_app_hash,json=earliestAppHash,proto3" json:"earliest_app_hash,omitempty"` + EarliestBlockHeight int64 `protobuf:"varint,7,opt,name=earliest_block_height,json=earliestBlockHeight,proto3" json:"earliest_block_height,omitempty"` + EarliestBlockTime time.Time `protobuf:"bytes,8,opt,name=earliest_block_time,json=earliestBlockTime,proto3,stdtime" json:"earliest_block_time"` + CatchingUp bool `protobuf:"varint,9,opt,name=catching_up,json=catchingUp,proto3" json:"catching_up,omitempty"` +} + +func (m *SyncInfo) Reset() { *m = SyncInfo{} } +func (m *SyncInfo) String() string { return proto.CompactTextString(m) } +func (*SyncInfo) ProtoMessage() {} +func (*SyncInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{20} +} +func (m *SyncInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SyncInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SyncInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SyncInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SyncInfo.Merge(m, src) +} +func (m *SyncInfo) XXX_Size() int { + return m.Size() +} +func (m *SyncInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SyncInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SyncInfo proto.InternalMessageInfo + +func (m *SyncInfo) GetLatestBlockHash() []byte { + if m != nil { + return m.LatestBlockHash + } + return nil +} + +func (m *SyncInfo) GetLatestAppHash() []byte { + if m != nil { + return m.LatestAppHash + } + return nil +} + +func (m *SyncInfo) GetLatestBlockHeight() int64 { + if m != nil { + return m.LatestBlockHeight + } + return 0 +} + +func (m *SyncInfo) GetLatestBlockTime() time.Time { + if m != nil { + return m.LatestBlockTime + } + return time.Time{} +} + +func (m *SyncInfo) GetEarliestBlockHash() []byte { + if m != nil { + return m.EarliestBlockHash + } + return nil +} + +func (m *SyncInfo) GetEarliestAppHash() []byte { + if m != nil { + return m.EarliestAppHash + } + return nil +} + +func (m *SyncInfo) GetEarliestBlockHeight() int64 { + if m != nil { + return m.EarliestBlockHeight + } + return 0 +} + +func (m *SyncInfo) GetEarliestBlockTime() time.Time { + if m != nil { + return m.EarliestBlockTime + } + return time.Time{} +} + +func (m *SyncInfo) GetCatchingUp() bool { + if m != nil { + return m.CatchingUp + } + return false +} + +type ValidatorInfo struct { + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PubKey *crypto.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` +} + +func (m *ValidatorInfo) Reset() { *m = ValidatorInfo{} } +func (m *ValidatorInfo) String() string { return proto.CompactTextString(m) } +func (*ValidatorInfo) ProtoMessage() {} +func (*ValidatorInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{21} +} +func (m *ValidatorInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorInfo.Merge(m, src) +} +func (m *ValidatorInfo) XXX_Size() int { + return m.Size() +} +func (m *ValidatorInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorInfo proto.InternalMessageInfo + +func (m *ValidatorInfo) GetAddress() []byte { + if m != nil { + return m.Address + } + return nil +} + +func (m *ValidatorInfo) GetPubKey() *crypto.PublicKey { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *ValidatorInfo) GetVotingPower() int64 { + if m != nil { + return m.VotingPower + } + return 0 +} + +func init() { + proto.RegisterType((*RequestPing)(nil), "tendermint.rpc.grpc.RequestPing") + proto.RegisterType((*RequestBroadcastTx)(nil), "tendermint.rpc.grpc.RequestBroadcastTx") + proto.RegisterType((*BlockByHashRequest)(nil), "tendermint.rpc.grpc.BlockByHashRequest") + proto.RegisterType((*BlockByHeightRequest)(nil), "tendermint.rpc.grpc.BlockByHeightRequest") + proto.RegisterType((*BlockMetaByHashRequest)(nil), "tendermint.rpc.grpc.BlockMetaByHashRequest") + proto.RegisterType((*BlockMetaByHeightRequest)(nil), "tendermint.rpc.grpc.BlockMetaByHeightRequest") + proto.RegisterType((*CommitRequest)(nil), "tendermint.rpc.grpc.CommitRequest") + proto.RegisterType((*ValidatorSetRequest)(nil), "tendermint.rpc.grpc.ValidatorSetRequest") + proto.RegisterType((*SubscribeNewHeightsRequest)(nil), "tendermint.rpc.grpc.SubscribeNewHeightsRequest") + proto.RegisterType((*StatusRequest)(nil), "tendermint.rpc.grpc.StatusRequest") + proto.RegisterType((*ResponsePing)(nil), "tendermint.rpc.grpc.ResponsePing") + proto.RegisterType((*ResponseBroadcastTx)(nil), "tendermint.rpc.grpc.ResponseBroadcastTx") + proto.RegisterType((*BlockByHashResponse)(nil), "tendermint.rpc.grpc.BlockByHashResponse") + proto.RegisterType((*BlockByHeightResponse)(nil), "tendermint.rpc.grpc.BlockByHeightResponse") + proto.RegisterType((*BlockMetaByHashResponse)(nil), "tendermint.rpc.grpc.BlockMetaByHashResponse") + proto.RegisterType((*BlockMetaByHeightResponse)(nil), "tendermint.rpc.grpc.BlockMetaByHeightResponse") + proto.RegisterType((*CommitResponse)(nil), "tendermint.rpc.grpc.CommitResponse") + proto.RegisterType((*ValidatorSetResponse)(nil), "tendermint.rpc.grpc.ValidatorSetResponse") + proto.RegisterType((*NewHeightEvent)(nil), "tendermint.rpc.grpc.NewHeightEvent") + proto.RegisterType((*StatusResponse)(nil), "tendermint.rpc.grpc.StatusResponse") + proto.RegisterType((*SyncInfo)(nil), "tendermint.rpc.grpc.SyncInfo") + proto.RegisterType((*ValidatorInfo)(nil), "tendermint.rpc.grpc.ValidatorInfo") +} + +func init() { proto.RegisterFile("tendermint/rpc/grpc/types.proto", fileDescriptor_0ffff5682c662b95) } + +var fileDescriptor_0ffff5682c662b95 = []byte{ + // 1185 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x3a, 0x89, 0xe3, 0x3c, 0xff, 0x89, 0x32, 0x4e, 0x53, 0xb3, 0x0d, 0x76, 0xba, 0x20, + 0x9a, 0x86, 0x76, 0x1d, 0x19, 0xf5, 0xd2, 0x56, 0x48, 0x71, 0x82, 0x44, 0x94, 0x52, 0x19, 0x27, + 0x05, 0x09, 0x0e, 0x66, 0x77, 0x3d, 0xb1, 0x57, 0xb1, 0x77, 0x87, 0xdd, 0xb1, 0x1b, 0x9f, 0xf9, + 0x02, 0xbd, 0x20, 0x21, 0x3e, 0x07, 0x57, 0xee, 0x3d, 0xf6, 0x82, 0xc4, 0x09, 0x50, 0x72, 0xe0, + 0x6b, 0xa0, 0x9d, 0x99, 0xb5, 0x67, 0xb3, 0x5e, 0xc7, 0x91, 0x38, 0xf6, 0x62, 0xcd, 0x9f, 0xdf, + 0xfb, 0xcd, 0xfb, 0xb7, 0xef, 0x3d, 0x43, 0x85, 0x62, 0xa7, 0x8d, 0xbd, 0xbe, 0xed, 0xd0, 0xaa, + 0x47, 0xac, 0x6a, 0x27, 0xf8, 0xa1, 0x23, 0x82, 0x7d, 0x9d, 0x78, 0x2e, 0x75, 0x51, 0x71, 0x02, + 0xd0, 0x3d, 0x62, 0xe9, 0x01, 0x40, 0xbd, 0x27, 0x49, 0x19, 0xa6, 0x65, 0xcb, 0x12, 0xea, 0x96, + 0x74, 0xc9, 0xce, 0x23, 0xb7, 0xaa, 0x74, 0x4b, 0x6a, 0x24, 0x51, 0xd2, 0xf2, 0x46, 0x84, 0xba, + 0xd5, 0x73, 0x3c, 0x0a, 0x6f, 0xb7, 0x63, 0xbc, 0x43, 0xa3, 0x67, 0xb7, 0x0d, 0xea, 0x7a, 0x02, + 0x51, 0xe9, 0xb8, 0x6e, 0xa7, 0x87, 0xab, 0x6c, 0x67, 0x0e, 0xce, 0xaa, 0xd4, 0xee, 0x63, 0x9f, + 0x1a, 0x7d, 0x22, 0x00, 0x1b, 0x1d, 0xb7, 0xe3, 0xb2, 0x65, 0x35, 0x58, 0xf1, 0x53, 0x2d, 0x0f, + 0xd9, 0x26, 0xfe, 0x71, 0x80, 0x7d, 0xda, 0xb0, 0x9d, 0x8e, 0xf6, 0x31, 0x20, 0xb1, 0xad, 0x7b, + 0xae, 0xd1, 0xb6, 0x0c, 0x9f, 0x9e, 0x5e, 0xa0, 0x02, 0xa4, 0xe8, 0x45, 0x49, 0xd9, 0x56, 0x76, + 0x72, 0xcd, 0x14, 0xbd, 0xd0, 0x3e, 0x07, 0x54, 0xef, 0xb9, 0xd6, 0x79, 0x7d, 0xf4, 0xa5, 0xe1, + 0x77, 0x85, 0x00, 0x42, 0xb0, 0xd4, 0x35, 0xfc, 0xae, 0xc0, 0xb1, 0x35, 0xda, 0x80, 0x65, 0xe2, + 0xb9, 0x43, 0x5c, 0x4a, 0x6d, 0x2b, 0x3b, 0x99, 0x26, 0xdf, 0x68, 0x87, 0xb0, 0x11, 0xca, 0x63, + 0xbb, 0xd3, 0xa5, 0x21, 0xc3, 0x26, 0xa4, 0xbb, 0xec, 0x80, 0x71, 0x2c, 0x36, 0xc5, 0x2e, 0x81, + 0xe5, 0x11, 0x6c, 0x32, 0x96, 0xaf, 0x30, 0x35, 0x6e, 0xd4, 0x44, 0xab, 0x41, 0x49, 0x46, 0xcf, + 0xf3, 0xae, 0xf6, 0x00, 0xf2, 0x07, 0x6e, 0xbf, 0x6f, 0xdf, 0x08, 0x7c, 0x0c, 0xc5, 0x6f, 0xc2, + 0x78, 0x9c, 0xe0, 0x1b, 0xe1, 0x5b, 0xa0, 0x9e, 0x0c, 0x4c, 0xdf, 0xf2, 0x6c, 0x13, 0xbf, 0xc4, + 0xaf, 0xb9, 0x32, 0xbe, 0x90, 0xd2, 0xd6, 0x20, 0x7f, 0x42, 0x0d, 0x3a, 0x18, 0x1f, 0x14, 0x20, + 0xd7, 0xc4, 0x3e, 0x71, 0x1d, 0x1f, 0xb3, 0x20, 0xfd, 0xac, 0x40, 0x31, 0x3c, 0x90, 0xc3, 0xf4, + 0x0c, 0x32, 0x56, 0x17, 0x5b, 0xe7, 0x2d, 0x11, 0xac, 0x6c, 0x6d, 0x5b, 0x97, 0x32, 0x38, 0x48, + 0x56, 0x3d, 0x94, 0x3b, 0x08, 0x80, 0xa7, 0x17, 0xcd, 0x15, 0x8b, 0x2f, 0xd0, 0x3e, 0x40, 0x1b, + 0xf7, 0xec, 0x21, 0xf6, 0x02, 0xf1, 0x14, 0x13, 0xd7, 0x12, 0xc5, 0x0f, 0x39, 0xf4, 0xf4, 0xa2, + 0xb9, 0xda, 0x0e, 0x97, 0xda, 0x2f, 0x29, 0x28, 0x46, 0xf2, 0x82, 0x63, 0xd1, 0x13, 0x00, 0x33, + 0x38, 0x6e, 0x11, 0xc3, 0xa3, 0x42, 0xb3, 0x4d, 0x99, 0x9a, 0x7f, 0x07, 0x0d, 0xc3, 0xa3, 0xcd, + 0x55, 0x86, 0x0c, 0x96, 0x68, 0x0f, 0xd2, 0x16, 0xf3, 0xbe, 0xd0, 0xa6, 0x14, 0x17, 0x11, 0xd1, + 0x11, 0x38, 0x74, 0x00, 0xf9, 0xf1, 0x67, 0xd1, 0xf2, 0x31, 0x2d, 0x2d, 0x32, 0xc1, 0x72, 0x5c, + 0x30, 0x12, 0xad, 0xdc, 0x50, 0xda, 0xa1, 0xa7, 0xa1, 0xb6, 0x7d, 0x4c, 0x8d, 0xd2, 0x12, 0x63, + 0xb8, 0x17, 0x67, 0x18, 0x27, 0x93, 0x50, 0x39, 0x58, 0xa2, 0xbb, 0xb0, 0x62, 0xfb, 0xad, 0x9e, + 0xe1, 0xd3, 0xd2, 0x32, 0x4b, 0xd5, 0xb4, 0xed, 0xbf, 0x30, 0x7c, 0xaa, 0xfd, 0x9a, 0x82, 0x3b, + 0xd7, 0x52, 0xfe, 0xbd, 0x73, 0x42, 0xe7, 0xbc, 0x82, 0xbb, 0xb1, 0x0f, 0x59, 0x78, 0x27, 0xfa, + 0x9e, 0x72, 0x9b, 0xf7, 0xb4, 0x6f, 0xe1, 0x83, 0x29, 0x5f, 0xfc, 0xff, 0x40, 0x5c, 0x87, 0x42, + 0x58, 0x16, 0x04, 0xdb, 0x24, 0x1a, 0xca, 0x7c, 0xd1, 0xd0, 0xbe, 0x87, 0x8d, 0x68, 0xc5, 0x10, + 0x4c, 0xb1, 0x28, 0x29, 0xb7, 0x8f, 0x92, 0xf6, 0x1c, 0x0a, 0xe3, 0xb2, 0xf2, 0xc5, 0x10, 0x3b, + 0xc9, 0x95, 0x35, 0xac, 0x94, 0x29, 0xa9, 0x52, 0xfe, 0xa1, 0x40, 0x21, 0x2c, 0x40, 0x42, 0xab, + 0xe7, 0xb0, 0xea, 0xb8, 0x6d, 0xdc, 0xb2, 0x9d, 0x33, 0x57, 0x68, 0x54, 0x91, 0x35, 0x22, 0x35, + 0xa2, 0x1f, 0xe2, 0x33, 0x63, 0xd0, 0xa3, 0x2f, 0xdd, 0x36, 0x3e, 0x72, 0xce, 0xdc, 0x66, 0xc6, + 0x11, 0x2b, 0xf4, 0x14, 0x56, 0xfd, 0x91, 0x63, 0x71, 0x69, 0x9e, 0xae, 0x1f, 0xea, 0x53, 0x5a, + 0xab, 0x7e, 0x32, 0x72, 0x2c, 0x2e, 0xeb, 0x8b, 0x15, 0x3a, 0x82, 0xc2, 0xc4, 0x1f, 0x8c, 0x60, + 0x31, 0x5e, 0x9a, 0xc6, 0x04, 0x63, 0x9f, 0x30, 0x96, 0x89, 0x27, 0x83, 0xad, 0xf6, 0xef, 0x22, + 0x64, 0xc2, 0x17, 0xd0, 0x2e, 0xac, 0xf7, 0x0c, 0x8a, 0x7d, 0xda, 0xe2, 0x69, 0x20, 0xf5, 0x8b, + 0x35, 0x7e, 0xc1, 0x42, 0x1f, 0x24, 0x23, 0xfa, 0x04, 0xc4, 0x51, 0xcb, 0x20, 0xa4, 0x25, 0xf9, + 0x2b, 0xcf, 0x8f, 0xf7, 0x09, 0x61, 0x38, 0x1d, 0x8a, 0x51, 0x4e, 0xee, 0xf1, 0x45, 0xe6, 0xf1, + 0x75, 0x99, 0x95, 0x3b, 0xbf, 0x71, 0x4d, 0x87, 0xa0, 0x63, 0x8b, 0x6f, 0x4a, 0xd5, 0x79, 0x3b, + 0xd7, 0xc3, 0x76, 0xae, 0x9f, 0x86, 0xed, 0xbc, 0x9e, 0x79, 0xfb, 0x57, 0x65, 0xe1, 0xcd, 0xdf, + 0x15, 0x25, 0xa2, 0x69, 0x70, 0x1f, 0x68, 0x80, 0x0d, 0xaf, 0x67, 0x5f, 0xb3, 0x6b, 0x99, 0x69, + 0xbb, 0x1e, 0x5e, 0x4d, 0x2c, 0xdb, 0x85, 0xf1, 0xe1, 0xc4, 0xb6, 0x34, 0xf7, 0x42, 0x78, 0x11, + 0x5a, 0x57, 0x83, 0x3b, 0xd7, 0xb9, 0xb9, 0x7d, 0x2b, 0xcc, 0xbe, 0x62, 0x94, 0x9d, 0x5b, 0x78, + 0x1a, 0xd3, 0x87, 0xd9, 0x98, 0xb9, 0x85, 0x8d, 0x51, 0xad, 0x99, 0x95, 0x15, 0xc8, 0x5a, 0x06, + 0xb5, 0xba, 0xb6, 0xd3, 0x69, 0x0d, 0x48, 0x69, 0x95, 0x15, 0x13, 0x08, 0x8f, 0x5e, 0x11, 0xed, + 0x27, 0x05, 0xf2, 0x91, 0x54, 0x40, 0x25, 0x58, 0x31, 0xda, 0x6d, 0x0f, 0xfb, 0xbe, 0x08, 0x72, + 0xb8, 0x45, 0x4f, 0x60, 0x85, 0x0c, 0xcc, 0xd6, 0x39, 0x1e, 0x89, 0xd4, 0xdc, 0x92, 0x33, 0x8b, + 0x4f, 0x62, 0x7a, 0x63, 0x60, 0xf6, 0x6c, 0xeb, 0x18, 0x8f, 0x9a, 0x69, 0x32, 0x30, 0x8f, 0xf1, + 0x08, 0xdd, 0x87, 0xdc, 0xd0, 0xa5, 0x81, 0x06, 0xc4, 0x7d, 0x8d, 0x3d, 0x11, 0xe4, 0x2c, 0x3f, + 0x6b, 0x04, 0x47, 0xb5, 0xdf, 0x15, 0xc8, 0x8d, 0xdb, 0xf3, 0x7e, 0xe3, 0x08, 0x1d, 0xc3, 0x52, + 0xd0, 0xbf, 0xd1, 0xf6, 0xd4, 0xdc, 0x95, 0xc6, 0x30, 0xf5, 0x7e, 0x02, 0x62, 0x32, 0x04, 0xa0, + 0x1f, 0x20, 0x2b, 0xf7, 0xfe, 0x07, 0xb3, 0x38, 0x25, 0xa0, 0xba, 0x33, 0x93, 0x5a, 0x42, 0xd6, + 0x7e, 0x4b, 0x43, 0x86, 0x39, 0x3d, 0xd0, 0xdd, 0x84, 0xac, 0xd4, 0xda, 0x13, 0x9e, 0x8b, 0x0f, + 0x85, 0x09, 0xcf, 0x4d, 0x99, 0x12, 0xf6, 0x14, 0xd4, 0x83, 0xb5, 0x6b, 0x7d, 0x00, 0x7d, 0x9a, + 0x2c, 0x1e, 0x1b, 0xfb, 0xd4, 0x47, 0xf3, 0x81, 0x45, 0x4d, 0xeb, 0x42, 0x3e, 0xd2, 0x91, 0xd1, + 0xc3, 0x99, 0xaa, 0xca, 0x03, 0xa3, 0xba, 0x3b, 0x0f, 0x74, 0x6c, 0x97, 0x07, 0xeb, 0xb1, 0x46, + 0x84, 0x1e, 0xdf, 0xa8, 0x6c, 0xe4, 0x45, 0x7d, 0x5e, 0xb8, 0xb0, 0xee, 0x6b, 0x48, 0xf3, 0x8e, + 0x83, 0xa6, 0x57, 0xca, 0xc8, 0x5c, 0xab, 0x7e, 0x34, 0x13, 0x23, 0x28, 0x2d, 0xc8, 0xc9, 0x3d, + 0x07, 0xed, 0xcc, 0x2e, 0xc1, 0x93, 0x39, 0x58, 0x7d, 0x38, 0x07, 0x52, 0x3c, 0xd2, 0x87, 0xe2, + 0x94, 0xd1, 0x18, 0x55, 0xa7, 0xf7, 0x8b, 0xc4, 0x21, 0x3a, 0xc1, 0xa2, 0x68, 0x57, 0xdc, 0x53, + 0x02, 0x37, 0xf1, 0x56, 0x97, 0xe0, 0xa6, 0xc8, 0x20, 0x9e, 0x40, 0x1a, 0xed, 0x95, 0xf5, 0x17, + 0x6f, 0x2f, 0xcb, 0xca, 0xbb, 0xcb, 0xb2, 0xf2, 0xcf, 0x65, 0x59, 0x79, 0x73, 0x55, 0x5e, 0x78, + 0x77, 0x55, 0x5e, 0xf8, 0xf3, 0xaa, 0xbc, 0xf0, 0x5d, 0xad, 0x63, 0xd3, 0xee, 0xc0, 0xd4, 0x2d, + 0xb7, 0x5f, 0x95, 0xff, 0xcf, 0xc5, 0xff, 0x85, 0x3e, 0xb3, 0x5c, 0x0f, 0x07, 0x0b, 0x33, 0xcd, + 0x8a, 0xe3, 0x67, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x15, 0xb6, 0x85, 0xef, 0xac, 0x0e, 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 + +// BroadcastAPIClient is the client API for BroadcastAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type BroadcastAPIClient interface { + Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) + BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) +} + +type broadcastAPIClient struct { + cc *grpc.ClientConn +} + +func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient { + return &broadcastAPIClient{cc} +} + +func (c *broadcastAPIClient) Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) { + out := new(ResponsePing) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BroadcastAPI/Ping", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *broadcastAPIClient) BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) { + out := new(ResponseBroadcastTx) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BroadcastAPI/BroadcastTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BroadcastAPIServer is the server API for BroadcastAPI service. +type BroadcastAPIServer interface { + Ping(context.Context, *RequestPing) (*ResponsePing, error) + BroadcastTx(context.Context, *RequestBroadcastTx) (*ResponseBroadcastTx, error) +} + +// UnimplementedBroadcastAPIServer can be embedded to have forward compatible implementations. +type UnimplementedBroadcastAPIServer struct { +} + +func (*UnimplementedBroadcastAPIServer) Ping(ctx context.Context, req *RequestPing) (*ResponsePing, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} +func (*UnimplementedBroadcastAPIServer) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) { + return nil, status.Errorf(codes.Unimplemented, "method BroadcastTx not implemented") +} + +func RegisterBroadcastAPIServer(s *grpc.Server, srv BroadcastAPIServer) { + s.RegisterService(&_BroadcastAPI_serviceDesc, srv) +} + +func _BroadcastAPI_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestPing) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BroadcastAPIServer).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BroadcastAPI/Ping", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BroadcastAPIServer).Ping(ctx, req.(*RequestPing)) + } + return interceptor(ctx, in, info, handler) +} + +func _BroadcastAPI_BroadcastTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestBroadcastTx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BroadcastAPIServer).BroadcastTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BroadcastAPI/BroadcastTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BroadcastAPIServer).BroadcastTx(ctx, req.(*RequestBroadcastTx)) + } + return interceptor(ctx, in, info, handler) +} + +var _BroadcastAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "tendermint.rpc.grpc.BroadcastAPI", + HandlerType: (*BroadcastAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ping", + Handler: _BroadcastAPI_Ping_Handler, + }, + { + MethodName: "BroadcastTx", + Handler: _BroadcastAPI_BroadcastTx_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "tendermint/rpc/grpc/types.proto", +} + +// BlockAPIClient is the client API for BlockAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type BlockAPIClient interface { + BlockByHash(ctx context.Context, in *BlockByHashRequest, opts ...grpc.CallOption) (BlockAPI_BlockByHashClient, error) + BlockMetaByHash(ctx context.Context, in *BlockMetaByHashRequest, opts ...grpc.CallOption) (*BlockMetaByHashResponse, error) + BlockByHeight(ctx context.Context, in *BlockByHeightRequest, opts ...grpc.CallOption) (BlockAPI_BlockByHeightClient, error) + BlockMetaByHeight(ctx context.Context, in *BlockMetaByHeightRequest, opts ...grpc.CallOption) (*BlockMetaByHeightResponse, error) + Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) + ValidatorSet(ctx context.Context, in *ValidatorSetRequest, opts ...grpc.CallOption) (*ValidatorSetResponse, error) + SubscribeNewHeights(ctx context.Context, in *SubscribeNewHeightsRequest, opts ...grpc.CallOption) (BlockAPI_SubscribeNewHeightsClient, error) + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) +} + +type blockAPIClient struct { + cc *grpc.ClientConn +} + +func NewBlockAPIClient(cc *grpc.ClientConn) BlockAPIClient { + return &blockAPIClient{cc} +} + +func (c *blockAPIClient) BlockByHash(ctx context.Context, in *BlockByHashRequest, opts ...grpc.CallOption) (BlockAPI_BlockByHashClient, error) { + stream, err := c.cc.NewStream(ctx, &_BlockAPI_serviceDesc.Streams[0], "/tendermint.rpc.grpc.BlockAPI/BlockByHash", opts...) + if err != nil { + return nil, err + } + x := &blockAPIBlockByHashClient{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 BlockAPI_BlockByHashClient interface { + Recv() (*BlockByHashResponse, error) + grpc.ClientStream +} + +type blockAPIBlockByHashClient struct { + grpc.ClientStream +} + +func (x *blockAPIBlockByHashClient) Recv() (*BlockByHashResponse, error) { + m := new(BlockByHashResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *blockAPIClient) BlockMetaByHash(ctx context.Context, in *BlockMetaByHashRequest, opts ...grpc.CallOption) (*BlockMetaByHashResponse, error) { + out := new(BlockMetaByHashResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/BlockMetaByHash", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockAPIClient) BlockByHeight(ctx context.Context, in *BlockByHeightRequest, opts ...grpc.CallOption) (BlockAPI_BlockByHeightClient, error) { + stream, err := c.cc.NewStream(ctx, &_BlockAPI_serviceDesc.Streams[1], "/tendermint.rpc.grpc.BlockAPI/BlockByHeight", opts...) + if err != nil { + return nil, err + } + x := &blockAPIBlockByHeightClient{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 BlockAPI_BlockByHeightClient interface { + Recv() (*BlockByHeightResponse, error) + grpc.ClientStream +} + +type blockAPIBlockByHeightClient struct { + grpc.ClientStream +} + +func (x *blockAPIBlockByHeightClient) Recv() (*BlockByHeightResponse, error) { + m := new(BlockByHeightResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *blockAPIClient) BlockMetaByHeight(ctx context.Context, in *BlockMetaByHeightRequest, opts ...grpc.CallOption) (*BlockMetaByHeightResponse, error) { + out := new(BlockMetaByHeightResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/BlockMetaByHeight", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockAPIClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) { + out := new(CommitResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/Commit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockAPIClient) ValidatorSet(ctx context.Context, in *ValidatorSetRequest, opts ...grpc.CallOption) (*ValidatorSetResponse, error) { + out := new(ValidatorSetResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/ValidatorSet", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockAPIClient) SubscribeNewHeights(ctx context.Context, in *SubscribeNewHeightsRequest, opts ...grpc.CallOption) (BlockAPI_SubscribeNewHeightsClient, error) { + stream, err := c.cc.NewStream(ctx, &_BlockAPI_serviceDesc.Streams[2], "/tendermint.rpc.grpc.BlockAPI/SubscribeNewHeights", opts...) + if err != nil { + return nil, err + } + x := &blockAPISubscribeNewHeightsClient{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 BlockAPI_SubscribeNewHeightsClient interface { + Recv() (*NewHeightEvent, error) + grpc.ClientStream +} + +type blockAPISubscribeNewHeightsClient struct { + grpc.ClientStream +} + +func (x *blockAPISubscribeNewHeightsClient) Recv() (*NewHeightEvent, error) { + m := new(NewHeightEvent) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *blockAPIClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + out := new(StatusResponse) + err := c.cc.Invoke(ctx, "/tendermint.rpc.grpc.BlockAPI/Status", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BlockAPIServer is the server API for BlockAPI service. +type BlockAPIServer interface { + BlockByHash(*BlockByHashRequest, BlockAPI_BlockByHashServer) error + BlockMetaByHash(context.Context, *BlockMetaByHashRequest) (*BlockMetaByHashResponse, error) + BlockByHeight(*BlockByHeightRequest, BlockAPI_BlockByHeightServer) error + BlockMetaByHeight(context.Context, *BlockMetaByHeightRequest) (*BlockMetaByHeightResponse, error) + Commit(context.Context, *CommitRequest) (*CommitResponse, error) + ValidatorSet(context.Context, *ValidatorSetRequest) (*ValidatorSetResponse, error) + SubscribeNewHeights(*SubscribeNewHeightsRequest, BlockAPI_SubscribeNewHeightsServer) error + Status(context.Context, *StatusRequest) (*StatusResponse, error) +} + +// UnimplementedBlockAPIServer can be embedded to have forward compatible implementations. +type UnimplementedBlockAPIServer struct { +} + +func (*UnimplementedBlockAPIServer) BlockByHash(req *BlockByHashRequest, srv BlockAPI_BlockByHashServer) error { + return status.Errorf(codes.Unimplemented, "method BlockByHash not implemented") +} +func (*UnimplementedBlockAPIServer) BlockMetaByHash(ctx context.Context, req *BlockMetaByHashRequest) (*BlockMetaByHashResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockMetaByHash not implemented") +} +func (*UnimplementedBlockAPIServer) BlockByHeight(req *BlockByHeightRequest, srv BlockAPI_BlockByHeightServer) error { + return status.Errorf(codes.Unimplemented, "method BlockByHeight not implemented") +} +func (*UnimplementedBlockAPIServer) BlockMetaByHeight(ctx context.Context, req *BlockMetaByHeightRequest) (*BlockMetaByHeightResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockMetaByHeight not implemented") +} +func (*UnimplementedBlockAPIServer) Commit(ctx context.Context, req *CommitRequest) (*CommitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") +} +func (*UnimplementedBlockAPIServer) ValidatorSet(ctx context.Context, req *ValidatorSetRequest) (*ValidatorSetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorSet not implemented") +} +func (*UnimplementedBlockAPIServer) SubscribeNewHeights(req *SubscribeNewHeightsRequest, srv BlockAPI_SubscribeNewHeightsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeNewHeights not implemented") +} +func (*UnimplementedBlockAPIServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} + +func RegisterBlockAPIServer(s *grpc.Server, srv BlockAPIServer) { + s.RegisterService(&_BlockAPI_serviceDesc, srv) +} + +func _BlockAPI_BlockByHash_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(BlockByHashRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BlockAPIServer).BlockByHash(m, &blockAPIBlockByHashServer{stream}) +} + +type BlockAPI_BlockByHashServer interface { + Send(*BlockByHashResponse) error + grpc.ServerStream +} + +type blockAPIBlockByHashServer struct { + grpc.ServerStream +} + +func (x *blockAPIBlockByHashServer) Send(m *BlockByHashResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _BlockAPI_BlockMetaByHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockMetaByHashRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).BlockMetaByHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/BlockMetaByHash", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).BlockMetaByHash(ctx, req.(*BlockMetaByHashRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockAPI_BlockByHeight_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(BlockByHeightRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BlockAPIServer).BlockByHeight(m, &blockAPIBlockByHeightServer{stream}) +} + +type BlockAPI_BlockByHeightServer interface { + Send(*BlockByHeightResponse) error + grpc.ServerStream +} + +type blockAPIBlockByHeightServer struct { + grpc.ServerStream +} + +func (x *blockAPIBlockByHeightServer) Send(m *BlockByHeightResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _BlockAPI_BlockMetaByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockMetaByHeightRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).BlockMetaByHeight(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/BlockMetaByHeight", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).BlockMetaByHeight(ctx, req.(*BlockMetaByHeightRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockAPI_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).Commit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/Commit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).Commit(ctx, req.(*CommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockAPI_ValidatorSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidatorSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).ValidatorSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/ValidatorSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).ValidatorSet(ctx, req.(*ValidatorSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockAPI_SubscribeNewHeights_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeNewHeightsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BlockAPIServer).SubscribeNewHeights(m, &blockAPISubscribeNewHeightsServer{stream}) +} + +type BlockAPI_SubscribeNewHeightsServer interface { + Send(*NewHeightEvent) error + grpc.ServerStream +} + +type blockAPISubscribeNewHeightsServer struct { + grpc.ServerStream +} + +func (x *blockAPISubscribeNewHeightsServer) Send(m *NewHeightEvent) error { + return x.ServerStream.SendMsg(m) +} + +func _BlockAPI_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockAPIServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.rpc.grpc.BlockAPI/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockAPIServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _BlockAPI_serviceDesc = grpc.ServiceDesc{ + ServiceName: "tendermint.rpc.grpc.BlockAPI", + HandlerType: (*BlockAPIServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BlockMetaByHash", + Handler: _BlockAPI_BlockMetaByHash_Handler, + }, + { + MethodName: "BlockMetaByHeight", + Handler: _BlockAPI_BlockMetaByHeight_Handler, + }, + { + MethodName: "Commit", + Handler: _BlockAPI_Commit_Handler, + }, + { + MethodName: "ValidatorSet", + Handler: _BlockAPI_ValidatorSet_Handler, + }, + { + MethodName: "Status", + Handler: _BlockAPI_Status_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "BlockByHash", + Handler: _BlockAPI_BlockByHash_Handler, + ServerStreams: true, + }, + { + StreamName: "BlockByHeight", + Handler: _BlockAPI_BlockByHeight_Handler, + ServerStreams: true, + }, + { + StreamName: "SubscribeNewHeights", + Handler: _BlockAPI_SubscribeNewHeights_Handler, + ServerStreams: true, + }, + }, + Metadata: "tendermint/rpc/grpc/types.proto", +} + +func (m *RequestPing) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RequestPing) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *RequestBroadcastTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RequestBroadcastTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Tx) > 0 { + i -= len(m.Tx) + copy(dAtA[i:], m.Tx) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockByHashRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockByHashRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockByHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Prove { + i-- + if m.Prove { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockByHeightRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockByHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockByHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Prove { + i-- + if m.Prove { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BlockMetaByHashRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockMetaByHashRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetaByHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockMetaByHeightRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockMetaByHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetaByHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CommitRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CommitRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ValidatorSetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorSetRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorSetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SubscribeNewHeightsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SubscribeNewHeightsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscribeNewHeightsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *StatusRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ResponsePing) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResponsePing) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponsePing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ResponseBroadcastTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResponseBroadcastTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponseBroadcastTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DeliverTx != nil { + { + size, err := m.DeliverTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.CheckTx != nil { + { + size, err := m.CheckTx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockByHashResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockByHashResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockByHashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsLast { + i-- + if m.IsLast { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.BlockMeta != nil { + { + size, err := m.BlockMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ValidatorSet != nil { + { + size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.BlockPart != nil { + { + size, err := m.BlockPart.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockByHeightResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockByHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockByHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsLast { + i-- + if m.IsLast { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.BlockMeta != nil { + { + size, err := m.BlockMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ValidatorSet != nil { + { + size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.BlockPart != nil { + { + size, err := m.BlockPart.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockMetaByHashResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockMetaByHashResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetaByHashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockMeta != nil { + { + size, err := m.BlockMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockMetaByHeightResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockMetaByHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetaByHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockMeta != nil { + { + size, err := m.BlockMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CommitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CommitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorSetResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorSetResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorSetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValidatorSet != nil { + { + size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NewHeightEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NewHeightEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NewHeightEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x12 + } + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StatusResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValidatorInfo != nil { + { + size, err := m.ValidatorInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.SyncInfo != nil { + { + size, err := m.SyncInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.NodeInfo != nil { + { + size, err := m.NodeInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SyncInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CatchingUp { + i-- + if m.CatchingUp { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + n18, err18 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EarliestBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EarliestBlockTime):]) + if err18 != nil { + return 0, err18 + } + i -= n18 + i = encodeVarintTypes(dAtA, i, uint64(n18)) + i-- + dAtA[i] = 0x42 + if m.EarliestBlockHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.EarliestBlockHeight)) + i-- + dAtA[i] = 0x38 + } + if len(m.EarliestAppHash) > 0 { + i -= len(m.EarliestAppHash) + copy(dAtA[i:], m.EarliestAppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.EarliestAppHash))) + i-- + dAtA[i] = 0x32 + } + if len(m.EarliestBlockHash) > 0 { + i -= len(m.EarliestBlockHash) + copy(dAtA[i:], m.EarliestBlockHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.EarliestBlockHash))) + i-- + dAtA[i] = 0x2a + } + n19, err19 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LatestBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LatestBlockTime):]) + if err19 != nil { + return 0, err19 + } + i -= n19 + i = encodeVarintTypes(dAtA, i, uint64(n19)) + i-- + dAtA[i] = 0x22 + if m.LatestBlockHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LatestBlockHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.LatestAppHash) > 0 { + i -= len(m.LatestAppHash) + copy(dAtA[i:], m.LatestAppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.LatestAppHash))) + i-- + dAtA[i] = 0x12 + } + if len(m.LatestBlockHash) > 0 { + i -= len(m.LatestBlockHash) + copy(dAtA[i:], m.LatestBlockHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.LatestBlockHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VotingPower != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.VotingPower)) + i-- + dAtA[i] = 0x18 + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RequestPing) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *RequestBroadcastTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Tx) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BlockByHashRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Prove { + n += 2 + } + return n +} + +func (m *BlockByHeightRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + if m.Prove { + n += 2 + } + return n +} + +func (m *BlockMetaByHashRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BlockMetaByHeightRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + return n +} + +func (m *CommitRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + return n +} + +func (m *ValidatorSetRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + return n +} + +func (m *SubscribeNewHeightsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *StatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ResponsePing) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ResponseBroadcastTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CheckTx != nil { + l = m.CheckTx.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.DeliverTx != nil { + l = m.DeliverTx.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BlockByHashResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockPart != nil { + l = m.BlockPart.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ValidatorSet != nil { + l = m.ValidatorSet.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.BlockMeta != nil { + l = m.BlockMeta.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.IsLast { + n += 2 + } + return n +} + +func (m *BlockByHeightResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockPart != nil { + l = m.BlockPart.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ValidatorSet != nil { + l = m.ValidatorSet.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.BlockMeta != nil { + l = m.BlockMeta.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.IsLast { + n += 2 + } + return n +} + +func (m *BlockMetaByHashResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockMeta != nil { + l = m.BlockMeta.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BlockMetaByHeightResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockMeta != nil { + l = m.BlockMeta.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *CommitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *ValidatorSetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorSet != nil { + l = m.ValidatorSet.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *NewHeightEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *StatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NodeInfo != nil { + l = m.NodeInfo.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.SyncInfo != nil { + l = m.SyncInfo.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ValidatorInfo != nil { + l = m.ValidatorInfo.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *SyncInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.LatestBlockHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.LatestAppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.LatestBlockHeight != 0 { + n += 1 + sovTypes(uint64(m.LatestBlockHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LatestBlockTime) + n += 1 + l + sovTypes(uint64(l)) + l = len(m.EarliestBlockHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.EarliestAppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.EarliestBlockHeight != 0 { + n += 1 + sovTypes(uint64(m.EarliestBlockHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EarliestBlockTime) + n += 1 + l + sovTypes(uint64(l)) + if m.CatchingUp { + n += 2 + } + return n +} + +func (m *ValidatorInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.VotingPower != 0 { + n += 1 + sovTypes(uint64(m.VotingPower)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RequestPing) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestPing: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestPing: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestBroadcastTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestBroadcastTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) + if m.Tx == nil { + m.Tx = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockByHashRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockByHashRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockByHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Prove", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Prove = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockByHeightRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockByHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Prove", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Prove = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetaByHashRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockMetaByHashRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockMetaByHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetaByHeightRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockMetaByHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockMetaByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommitRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CommitRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorSetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorSetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SubscribeNewHeightsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SubscribeNewHeightsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SubscribeNewHeightsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponsePing) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponsePing: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponsePing: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseBroadcastTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CheckTx == nil { + m.CheckTx = &types.ResponseCheckTx{} + } + if err := m.CheckTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DeliverTx == nil { + m.DeliverTx = &types.ResponseDeliverTx{} + } + if err := m.DeliverTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockByHashResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockByHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockByHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockPart", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockPart == nil { + m.BlockPart = &types1.Part{} + } + if err := m.BlockPart.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commit == nil { + m.Commit = &types1.Commit{} + } + if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorSet == nil { + m.ValidatorSet = &types1.ValidatorSet{} + } + if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockMeta == nil { + m.BlockMeta = &types1.BlockMeta{} + } + if err := m.BlockMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLast", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsLast = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockByHeightResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockByHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockPart", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockPart == nil { + m.BlockPart = &types1.Part{} + } + if err := m.BlockPart.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commit == nil { + m.Commit = &types1.Commit{} + } + if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorSet == nil { + m.ValidatorSet = &types1.ValidatorSet{} + } + if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockMeta == nil { + m.BlockMeta = &types1.BlockMeta{} + } + if err := m.BlockMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLast", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsLast = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetaByHashResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockMetaByHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockMetaByHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockMeta == nil { + m.BlockMeta = &types1.BlockMeta{} + } + if err := m.BlockMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetaByHeightResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockMetaByHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockMetaByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockMeta == nil { + m.BlockMeta = &types1.BlockMeta{} + } + if err := m.BlockMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CommitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commit == nil { + m.Commit = &types1.Commit{} + } + if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorSetResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorSetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorSetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorSet == nil { + m.ValidatorSet = &types1.ValidatorSet{} + } + if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NewHeightEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NewHeightEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NewHeightEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeInfo == nil { + m.NodeInfo = &p2p.DefaultNodeInfo{} + } + if err := m.NodeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SyncInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SyncInfo == nil { + m.SyncInfo = &SyncInfo{} + } + if err := m.SyncInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorInfo == nil { + m.ValidatorInfo = &ValidatorInfo{} + } + if err := m.ValidatorInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LatestBlockHash = append(m.LatestBlockHash[:0], dAtA[iNdEx:postIndex]...) + if m.LatestBlockHash == nil { + m.LatestBlockHash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestAppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LatestAppHash = append(m.LatestAppHash[:0], dAtA[iNdEx:postIndex]...) + if m.LatestAppHash == nil { + m.LatestAppHash = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHeight", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + m.LatestBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LatestBlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockTime", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestPing: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestPing: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestBroadcastTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LatestBlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err } - if iNdEx >= l { + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EarliestBlockHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.EarliestBlockHash = append(m.EarliestBlockHash[:0], dAtA[iNdEx:postIndex]...) + if m.EarliestBlockHash == nil { + m.EarliestBlockHash = []byte{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestBroadcastTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EarliestAppHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -640,61 +5183,83 @@ func (m *RequestBroadcastTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Tx = append(m.Tx[:0], dAtA[iNdEx:postIndex]...) - if m.Tx == nil { - m.Tx = []byte{} + m.EarliestAppHash = append(m.EarliestAppHash[:0], dAtA[iNdEx:postIndex]...) + if m.EarliestAppHash == nil { + m.EarliestAppHash = []byte{} } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EarliestBlockHeight", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + m.EarliestBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EarliestBlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EarliestBlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return ErrInvalidLengthTypes } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponsePing) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EarliestBlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err } - if iNdEx >= l { - return io.ErrUnexpectedEOF + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CatchingUp", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponsePing: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponsePing: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + m.CatchingUp = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -716,7 +5281,7 @@ func (m *ResponsePing) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { +func (m *ValidatorInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -739,17 +5304,17 @@ func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseBroadcastTx: wiretype end group for non-group") + return fmt.Errorf("proto: ValidatorInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseBroadcastTx: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ValidatorInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckTx", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -759,31 +5324,29 @@ func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - if m.CheckTx == nil { - m.CheckTx = &types.ResponseCheckTx{} - } - if err := m.CheckTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeliverTx", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -810,13 +5373,32 @@ func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DeliverTx == nil { - m.DeliverTx = &types.ResponseDeliverTx{} + if m.PubKey == nil { + m.PubKey = &crypto.PublicKey{} } - if err := m.DeliverTx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) + } + m.VotingPower = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VotingPower |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index dff4995f01..8cc9a1d342 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -117,6 +117,15 @@ func GetGRPCClient() core_grpc.BroadcastAPIClient { return core_grpc.StartGRPCClient(grpcAddr) } +func GetBlockAPIClient() (core_grpc.BlockAPIClient, error) { + grpcAddr := globalConfig.RPC.GRPCListenAddress + client, err := core_grpc.StartBlockAPIGRPCClient(grpcAddr) + if err != nil { + return nil, err + } + return client, nil +} + // StartTendermint starts a test CometBFT server in a go routine and returns when it is initialized func StartTendermint(app abci.Application, opts ...func(*Options)) *nm.Node { nodeOpts := defaultOptions diff --git a/types/part_set.go b/types/part_set.go index 880b3aaf4a..a654bb5b8f 100644 --- a/types/part_set.go +++ b/types/part_set.go @@ -271,6 +271,20 @@ func (ps *PartSet) Total() uint32 { } func (ps *PartSet) AddPart(part *Part) (bool, error) { + // The proof should be compatible with the number of parts. + if part.Proof.Total != int64(ps.total) { + return false, ErrPartSetInvalidProof + } + + // Check hash proof + if part.Proof.Verify(ps.Hash(), part.Bytes) != nil { + return false, ErrPartSetInvalidProof + } + + return ps.AddPartWithoutProof(part) +} + +func (ps *PartSet) AddPartWithoutProof(part *Part) (bool, error) { if ps == nil { return false, nil } @@ -287,16 +301,6 @@ func (ps *PartSet) AddPart(part *Part) (bool, error) { return false, nil } - // The proof should be compatible with the number of parts. - if part.Proof.Total != int64(ps.total) { - return false, ErrPartSetInvalidProof - } - - // Check hash proof - if part.Proof.Verify(ps.Hash(), part.Bytes) != nil { - return false, ErrPartSetInvalidProof - } - // Add part ps.parts[part.Index] = part ps.partsBitArray.SetIndex(int(part.Index), true)