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..a691dcddf7 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,371 @@ 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 the requested block height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // Prove set to true to return the parts proofs. + 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 the requested block meta height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + 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 the requested block commit height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + 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 the requested validator set height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + 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 +487,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 +525,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 +568,4653 @@ 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 StreamedBlockByHashResponse 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 *StreamedBlockByHashResponse) Reset() { *m = StreamedBlockByHashResponse{} } +func (m *StreamedBlockByHashResponse) String() string { return proto.CompactTextString(m) } +func (*StreamedBlockByHashResponse) ProtoMessage() {} +func (*StreamedBlockByHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{12} +} +func (m *StreamedBlockByHashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StreamedBlockByHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamedBlockByHashResponse.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 *StreamedBlockByHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamedBlockByHashResponse.Merge(m, src) +} +func (m *StreamedBlockByHashResponse) XXX_Size() int { + return m.Size() +} +func (m *StreamedBlockByHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StreamedBlockByHashResponse.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_StreamedBlockByHashResponse 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 *StreamedBlockByHashResponse) GetBlockPart() *types1.Part { + if m != nil { + return m.BlockPart + } + return nil } -type broadcastAPIClient struct { - cc *grpc.ClientConn +func (m *StreamedBlockByHashResponse) GetCommit() *types1.Commit { + if m != nil { + return m.Commit + } + return nil } -func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient { - return &broadcastAPIClient{cc} +func (m *StreamedBlockByHashResponse) 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 *StreamedBlockByHashResponse) 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 *StreamedBlockByHashResponse) 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 StreamedBlockByHeightResponse struct { + BlockPart *types1.Part `protobuf:"bytes,1,opt,name=block_part,json=blockPart,proto3" json:"block_part,omitempty"` + // Commit is only set in the first part, and + // it stays nil in the remaining ones. + Commit *types1.Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` + // ValidatorSet is only set in the first part, and + // it stays nil in the remaining ones. + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,3,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + // BlockMeta is only set in the first part, and + // it stays nil in the remaining ones. + 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 *StreamedBlockByHeightResponse) Reset() { *m = StreamedBlockByHeightResponse{} } +func (m *StreamedBlockByHeightResponse) String() string { return proto.CompactTextString(m) } +func (*StreamedBlockByHeightResponse) ProtoMessage() {} +func (*StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamedBlockByHeightResponse.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 *StreamedBlockByHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamedBlockByHeightResponse.Merge(m, src) +} +func (m *StreamedBlockByHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *StreamedBlockByHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StreamedBlockByHeightResponse.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_StreamedBlockByHeightResponse proto.InternalMessageInfo + +func (m *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 the requested validator set. + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + // Height the height corresponding to the returned + // validator set. + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,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 +} + +func (m *ValidatorSetResponse) GetHeight() int64 { + if m != nil { + return m.Height } - return n + return 0 } -func (m *ResponsePing) Size() (n int) { - if m == nil { - return 0 +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 } - var l int - _ = l - 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 *ResponseBroadcastTx) 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 - if m.CheckTx != nil { - l = m.CheckTx.Size() - n += 1 + l + sovTypes(uint64(l)) + return 0 +} + +func (m *NewHeightEvent) GetHash() []byte { + if m != nil { + return m.Hash } - if m.DeliverTx != nil { - l = m.DeliverTx.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 } - return n +} +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) } -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +var xxx_messageInfo_StatusResponse proto.InternalMessageInfo + +func (m *StatusResponse) GetNodeInfo() *p2p.DefaultNodeInfo { + if m != nil { + return m.NodeInfo + } + return nil } -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *StatusResponse) GetSyncInfo() *SyncInfo { + if m != nil { + return m.SyncInfo + } + 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 + +func (m *StatusResponse) GetValidatorInfo() *ValidatorInfo { + if m != nil { + return m.ValidatorInfo + } + return nil +} + +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((*StreamedBlockByHashResponse)(nil), "tendermint.rpc.grpc.StreamedBlockByHashResponse") + proto.RegisterType((*StreamedBlockByHeightResponse)(nil), "tendermint.rpc.grpc.StreamedBlockByHeightResponse") + 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{ + // 1204 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x3a, 0x8d, 0xe3, 0x3c, 0xff, 0x89, 0x32, 0x0e, 0xa9, 0xd9, 0xa4, 0x76, 0xba, 0x20, + 0x9a, 0x96, 0x76, 0x1d, 0x19, 0xf5, 0xd2, 0x56, 0x48, 0x71, 0x82, 0x44, 0x94, 0x52, 0x19, 0x27, + 0x05, 0x89, 0x8b, 0x19, 0xaf, 0x27, 0xf6, 0x12, 0x7b, 0x77, 0xd8, 0x1d, 0xbb, 0xf1, 0x99, 0x2f, + 0xd0, 0x0b, 0x77, 0xc4, 0xf7, 0xe0, 0xc6, 0xa1, 0xc7, 0x5e, 0x90, 0x38, 0x01, 0x4a, 0x0e, 0x7c, + 0x0d, 0xb4, 0x33, 0xb3, 0xf6, 0x6c, 0xd6, 0x9b, 0xb8, 0x88, 0x23, 0x17, 0xeb, 0xcd, 0x9b, 0xf7, + 0x7e, 0xf3, 0xfe, 0xed, 0x7b, 0xcf, 0x50, 0x61, 0xc4, 0xe9, 0x10, 0x6f, 0x60, 0x3b, 0xac, 0xea, + 0x51, 0xab, 0xda, 0x0d, 0x7e, 0xd8, 0x98, 0x12, 0xdf, 0xa4, 0x9e, 0xcb, 0x5c, 0x54, 0x9c, 0x0a, + 0x98, 0x1e, 0xb5, 0xcc, 0x40, 0x40, 0xdf, 0x54, 0xb4, 0x70, 0xdb, 0xb2, 0x55, 0x0d, 0x7d, 0x4b, + 0xb9, 0xe4, 0xfc, 0xc8, 0xad, 0xae, 0xdc, 0xd2, 0x1a, 0x4d, 0xd4, 0xb4, 0xbc, 0x31, 0x65, 0x6e, + 0xf5, 0x8c, 0x8c, 0xc3, 0xdb, 0xed, 0x18, 0xee, 0x08, 0xf7, 0xed, 0x0e, 0x66, 0xae, 0x27, 0x25, + 0x2a, 0x5d, 0xd7, 0xed, 0xf6, 0x49, 0x95, 0x9f, 0xda, 0xc3, 0xd3, 0x2a, 0xb3, 0x07, 0xc4, 0x67, + 0x78, 0x40, 0xa5, 0xc0, 0x7a, 0xd7, 0xed, 0xba, 0x9c, 0xac, 0x06, 0x94, 0xe0, 0x1a, 0x79, 0xc8, + 0x36, 0xc9, 0xf7, 0x43, 0xe2, 0xb3, 0x86, 0xed, 0x74, 0x8d, 0x0f, 0x01, 0xc9, 0x63, 0xdd, 0x73, + 0x71, 0xc7, 0xc2, 0x3e, 0x3b, 0x39, 0x47, 0x05, 0x48, 0xb1, 0xf3, 0x92, 0xb6, 0xad, 0xed, 0xe4, + 0x9a, 0x29, 0x76, 0x6e, 0x7c, 0x0a, 0xa8, 0xde, 0x77, 0xad, 0xb3, 0xfa, 0xf8, 0x73, 0xec, 0xf7, + 0xa4, 0x02, 0x42, 0x70, 0xab, 0x87, 0xfd, 0x9e, 0x94, 0xe3, 0x34, 0x5a, 0x87, 0x25, 0xea, 0xb9, + 0x23, 0x52, 0x4a, 0x6d, 0x6b, 0x3b, 0x99, 0xa6, 0x38, 0x18, 0x07, 0xb0, 0x1e, 0xea, 0x13, 0xbb, + 0xdb, 0x63, 0x21, 0xc2, 0x06, 0xa4, 0x7b, 0x9c, 0xc1, 0x31, 0x16, 0x9b, 0xf2, 0x94, 0x80, 0xf2, + 0x10, 0x36, 0x38, 0xca, 0x17, 0x84, 0xe1, 0x1b, 0x2d, 0x31, 0x6a, 0x50, 0x52, 0xa5, 0xe7, 0x79, + 0xd7, 0xb8, 0x07, 0xf9, 0x7d, 0x77, 0x30, 0xb0, 0x6f, 0x14, 0x7c, 0x04, 0xc5, 0xaf, 0xc2, 0x7c, + 0x1c, 0x93, 0x1b, 0xc5, 0xb7, 0x40, 0x3f, 0x1e, 0xb6, 0x7d, 0xcb, 0xb3, 0xdb, 0xe4, 0x05, 0x79, + 0x25, 0x8c, 0xf1, 0xa5, 0x96, 0xb1, 0x0a, 0xf9, 0x63, 0x86, 0xd9, 0x70, 0xc2, 0x28, 0x40, 0xae, + 0x49, 0x7c, 0xea, 0x3a, 0x3e, 0xe1, 0x49, 0xfa, 0x51, 0x83, 0x62, 0xc8, 0x50, 0xd3, 0xf4, 0x14, + 0x32, 0x56, 0x8f, 0x58, 0x67, 0x2d, 0x99, 0xac, 0x6c, 0x6d, 0xdb, 0x54, 0x2a, 0x38, 0x28, 0x56, + 0x33, 0xd4, 0xdb, 0x0f, 0x04, 0x4f, 0xce, 0x9b, 0xcb, 0x96, 0x20, 0xd0, 0x1e, 0x40, 0x87, 0xf4, + 0xed, 0x11, 0xf1, 0x02, 0xf5, 0x14, 0x57, 0x37, 0x12, 0xd5, 0x0f, 0x84, 0xe8, 0xc9, 0x79, 0x73, + 0xa5, 0x13, 0x92, 0xc6, 0x4f, 0x29, 0xd8, 0x3c, 0x66, 0x1e, 0xc1, 0x03, 0xd2, 0x89, 0xd4, 0x87, + 0xd0, 0x41, 0x8f, 0x01, 0xda, 0x01, 0xbb, 0x45, 0xb1, 0xc7, 0xa4, 0x85, 0x1b, 0xea, 0x13, 0xe2, + 0x7b, 0x68, 0x60, 0x8f, 0x35, 0x57, 0xb8, 0x64, 0x40, 0xa2, 0x5d, 0x48, 0x5b, 0x3c, 0x0b, 0xd2, + 0xaa, 0x52, 0x5c, 0x45, 0x66, 0x49, 0xca, 0xa1, 0x7d, 0xc8, 0x4f, 0x3e, 0x8f, 0x96, 0x4f, 0x58, + 0x69, 0x91, 0x2b, 0x96, 0xe3, 0x8a, 0x91, 0xac, 0xe5, 0x46, 0xca, 0x09, 0x3d, 0x09, 0xad, 0x1d, + 0x10, 0x86, 0x4b, 0xb7, 0x38, 0xc2, 0x66, 0x1c, 0x61, 0x52, 0x54, 0xd2, 0xe4, 0x80, 0x44, 0xb7, + 0x61, 0xd9, 0xf6, 0x5b, 0x7d, 0xec, 0xb3, 0xd2, 0x12, 0x2f, 0xd9, 0xb4, 0xed, 0x3f, 0xc7, 0x3e, + 0x33, 0x7e, 0x4e, 0xc1, 0x9d, 0xab, 0x21, 0x92, 0xa5, 0xf8, 0x7f, 0x90, 0xc2, 0x20, 0xbd, 0x84, + 0xdb, 0xb1, 0x0f, 0x5b, 0x46, 0x27, 0xfa, 0x9e, 0xf6, 0x2e, 0xef, 0x19, 0x5f, 0xc3, 0xfb, 0x33, + 0x3a, 0xc0, 0x7f, 0x00, 0x5c, 0x87, 0x42, 0xd8, 0x26, 0x24, 0xda, 0x34, 0x1b, 0xda, 0x7c, 0xd9, + 0x30, 0x7c, 0x58, 0x8f, 0x76, 0x10, 0x89, 0x14, 0xcb, 0x92, 0xf6, 0x2f, 0xb2, 0x34, 0xed, 0x43, + 0xa9, 0x48, 0x1f, 0x7a, 0x06, 0x85, 0x49, 0xfb, 0xf9, 0x6c, 0x44, 0x9c, 0xe4, 0x0e, 0x1c, 0x76, + 0xd4, 0x94, 0xd2, 0x51, 0x7f, 0xd3, 0xa0, 0x10, 0x36, 0x2a, 0x69, 0xed, 0x33, 0x58, 0x71, 0xdc, + 0x0e, 0x69, 0xd9, 0xce, 0xa9, 0x2b, 0x2d, 0xad, 0xa8, 0x96, 0xd2, 0x1a, 0x35, 0x0f, 0xc8, 0x29, + 0x1e, 0xf6, 0xd9, 0x0b, 0xb7, 0x43, 0x0e, 0x9d, 0x53, 0xb7, 0x99, 0x71, 0x24, 0x85, 0x9e, 0xc0, + 0x8a, 0x3f, 0x76, 0x2c, 0xa1, 0x2d, 0xca, 0xf8, 0x8e, 0x39, 0x63, 0x04, 0x9b, 0xc7, 0x63, 0xc7, + 0x12, 0xba, 0xbe, 0xa4, 0xd0, 0x21, 0x14, 0xa6, 0x71, 0xe2, 0x00, 0x8b, 0xf1, 0x16, 0x36, 0x01, + 0x98, 0xc4, 0x8a, 0xa3, 0x4c, 0x23, 0x1c, 0x1c, 0x8d, 0xbf, 0x17, 0x21, 0x13, 0xbe, 0x80, 0x1e, + 0xc0, 0x5a, 0x1f, 0x33, 0xe2, 0xb3, 0x96, 0x28, 0x0f, 0x65, 0xae, 0xac, 0x8a, 0x0b, 0x5e, 0x12, + 0x41, 0x91, 0xa2, 0x8f, 0x40, 0xb2, 0x5a, 0x98, 0xd2, 0x96, 0x12, 0xaf, 0xbc, 0x60, 0xef, 0x51, + 0xca, 0xe5, 0x4c, 0x28, 0x46, 0x31, 0x45, 0xc4, 0x17, 0x79, 0xc4, 0xd7, 0x54, 0x54, 0x11, 0xfc, + 0xc6, 0x15, 0x1b, 0x82, 0xc9, 0x2e, 0xbf, 0x35, 0xdd, 0x14, 0x63, 0xdf, 0x0c, 0xc7, 0xbe, 0x79, + 0x12, 0x8e, 0xfd, 0x7a, 0xe6, 0xcd, 0x1f, 0x95, 0x85, 0xd7, 0x7f, 0x56, 0xb4, 0x88, 0xa5, 0xc1, + 0x7d, 0x60, 0x01, 0xc1, 0x5e, 0xdf, 0xbe, 0xe2, 0xd7, 0x12, 0xb7, 0x76, 0x2d, 0xbc, 0x9a, 0x7a, + 0xf6, 0x00, 0x26, 0xcc, 0xa9, 0x6f, 0x69, 0x11, 0x85, 0xf0, 0x22, 0xf4, 0xae, 0x06, 0xef, 0x5d, + 0xc5, 0x16, 0xfe, 0x2d, 0x73, 0xff, 0x8a, 0x51, 0x74, 0xe1, 0xe1, 0x49, 0xcc, 0x1e, 0xee, 0x63, + 0xe6, 0x1d, 0x7c, 0x8c, 0x5a, 0xcd, 0xbd, 0xac, 0x40, 0xd6, 0xc2, 0xcc, 0xea, 0xd9, 0x4e, 0xb7, + 0x35, 0xa4, 0xa5, 0x15, 0xde, 0x64, 0x20, 0x64, 0xbd, 0xa4, 0xc6, 0x0f, 0x1a, 0xe4, 0x23, 0xa5, + 0x80, 0x4a, 0xb0, 0x8c, 0x3b, 0x1d, 0x8f, 0xf8, 0xbe, 0x4c, 0x72, 0x78, 0x44, 0x8f, 0x61, 0x99, + 0x0e, 0xdb, 0xad, 0x33, 0x32, 0x96, 0xa5, 0xb9, 0xa5, 0x56, 0x96, 0xd8, 0xd8, 0xcc, 0xc6, 0xb0, + 0xdd, 0xb7, 0xad, 0x23, 0x32, 0x6e, 0xa6, 0xe9, 0xb0, 0x7d, 0x44, 0xc6, 0xe8, 0x2e, 0xe4, 0x46, + 0x2e, 0x0b, 0x2c, 0xa0, 0xee, 0x2b, 0xe2, 0xc9, 0x24, 0x67, 0x05, 0xaf, 0x11, 0xb0, 0x6a, 0xbf, + 0x68, 0x90, 0x9b, 0x8c, 0xf1, 0xbd, 0xc6, 0x21, 0x3a, 0x82, 0x5b, 0xc1, 0x9c, 0x47, 0xdb, 0x33, + 0x6b, 0x57, 0x59, 0xd7, 0xf4, 0xbb, 0x09, 0x12, 0xd3, 0x65, 0x01, 0x7d, 0x0b, 0x59, 0x75, 0x47, + 0xb8, 0x77, 0x1d, 0xa6, 0x22, 0xa8, 0xef, 0x5c, 0x0b, 0xad, 0x48, 0xd6, 0x7e, 0x4d, 0x43, 0x86, + 0x07, 0x3d, 0xb0, 0xfd, 0x3b, 0xc8, 0x2a, 0xa3, 0x3f, 0xe1, 0xb9, 0xf8, 0xf2, 0xa8, 0xef, 0xce, + 0xfe, 0xd0, 0x93, 0xb7, 0x89, 0x5d, 0x0d, 0xf5, 0x61, 0xf5, 0xca, 0x9c, 0x40, 0x1f, 0x27, 0xbf, + 0x17, 0x5b, 0x13, 0xf5, 0x87, 0xf3, 0x09, 0xcb, 0xde, 0x46, 0x21, 0x1f, 0x99, 0xd8, 0xe8, 0xfe, + 0xb5, 0xbe, 0xa9, 0x0b, 0xa6, 0x5e, 0x9b, 0xcb, 0xbb, 0xc8, 0x44, 0xda, 0xd5, 0x90, 0x07, 0x6b, + 0xb1, 0x81, 0x85, 0x1e, 0xdd, 0x68, 0x74, 0xe4, 0x65, 0x73, 0x5e, 0x71, 0xe9, 0xe5, 0x97, 0x90, + 0x16, 0x93, 0x09, 0xcd, 0xee, 0x9c, 0x91, 0x7d, 0x58, 0xff, 0xe0, 0x5a, 0x19, 0x09, 0x69, 0x41, + 0x4e, 0x9d, 0x4d, 0x68, 0xe7, 0xfa, 0x96, 0x3c, 0xdd, 0x9f, 0xf5, 0xfb, 0x73, 0x48, 0xca, 0x47, + 0x06, 0x50, 0x9c, 0xb1, 0x52, 0xa3, 0xea, 0xec, 0xc0, 0x27, 0x2e, 0xdf, 0x09, 0x1e, 0x45, 0xa7, + 0xe4, 0xae, 0x16, 0x84, 0x49, 0x8c, 0xbe, 0x84, 0x30, 0x45, 0x16, 0xf8, 0x04, 0xd0, 0xe8, 0xec, + 0xac, 0x3f, 0x7f, 0x73, 0x51, 0xd6, 0xde, 0x5e, 0x94, 0xb5, 0xbf, 0x2e, 0xca, 0xda, 0xeb, 0xcb, + 0xf2, 0xc2, 0xdb, 0xcb, 0xf2, 0xc2, 0xef, 0x97, 0xe5, 0x85, 0x6f, 0x6a, 0x5d, 0x9b, 0xf5, 0x86, + 0x6d, 0xd3, 0x72, 0x07, 0x55, 0xf5, 0x7f, 0x60, 0xfc, 0xdf, 0xeb, 0x53, 0xcb, 0xf5, 0x48, 0x40, + 0xb4, 0xd3, 0xbc, 0x59, 0x7e, 0xf2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4b, 0xec, 0x45, 0xd8, + 0xe4, 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() (*StreamedBlockByHashResponse, error) + grpc.ClientStream +} + +type blockAPIBlockByHashClient struct { + grpc.ClientStream +} + +func (x *blockAPIBlockByHashClient) Recv() (*StreamedBlockByHashResponse, error) { + m := new(StreamedBlockByHashResponse) + 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() (*StreamedBlockByHeightResponse, error) + grpc.ClientStream +} + +type blockAPIBlockByHeightClient struct { + grpc.ClientStream +} + +func (x *blockAPIBlockByHeightClient) Recv() (*StreamedBlockByHeightResponse, error) { + m := new(StreamedBlockByHeightResponse) + 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(*StreamedBlockByHashResponse) error + grpc.ServerStream +} + +type blockAPIBlockByHashServer struct { + grpc.ServerStream +} + +func (x *blockAPIBlockByHashServer) Send(m *StreamedBlockByHashResponse) 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(*StreamedBlockByHeightResponse) error + grpc.ServerStream +} + +type blockAPIBlockByHeightServer struct { + grpc.ServerStream +} + +func (x *blockAPIBlockByHeightServer) Send(m *StreamedBlockByHeightResponse) 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 *StreamedBlockByHashResponse) 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 *StreamedBlockByHashResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamedBlockByHashResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamedBlockByHeightResponse) 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.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + 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 *StreamedBlockByHashResponse) 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 *StreamedBlockByHeightResponse) 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)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + 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 *StreamedBlockByHashResponse) 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: StreamedBlockByHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamedBlockByHashResponse: 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 *StreamedBlockByHeightResponse) 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: StreamedBlockByHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamedBlockByHeightResponse: 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 + case 2: + 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 *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 +5241,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 +5339,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 +5362,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 +5382,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 +5431,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..ad074101da 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,49 @@ message RequestBroadcastTx { bytes tx = 1; } +message BlockByHashRequest { + bytes hash = 1; + bool prove = 2; +} + +message BlockByHeightRequest { + // Height the requested block height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + int64 height = 1; + // Prove set to true to return the parts proofs. + bool prove = 2; +} + +message BlockMetaByHashRequest { + bytes hash = 1; +} + +message BlockMetaByHeightRequest { + // Height the requested block meta height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + int64 height = 1; +} + +message CommitRequest { + // Height the requested block commit height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + int64 height = 1; +} + +message ValidatorSetRequest { + // Height the requested validator set height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + int64 height = 1; +} + +message SubscribeNewHeightsRequest {} + +message StatusRequest {} + //---------------------------------------- // Response types @@ -23,6 +72,81 @@ message ResponseBroadcastTx { tendermint.abci.ResponseDeliverTx deliver_tx = 2; } +message StreamedBlockByHashResponse { + 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 StreamedBlockByHeightResponse { + tendermint.types.Part block_part = 1; + // Commit is only set in the first part, and + // it stays nil in the remaining ones. + tendermint.types.Commit commit = 2; + // ValidatorSet is only set in the first part, and + // it stays nil in the remaining ones. + tendermint.types.ValidatorSet validator_set = 3; + // BlockMeta is only set in the first part, and + // it stays nil in the remaining ones. + 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 { + // ValidatorSet the requested validator set. + tendermint.types.ValidatorSet validator_set = 1; + // Height the height corresponding to the returned + // validator set. + int64 height = 2; +} + +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 +154,14 @@ service BroadcastAPI { rpc Ping(RequestPing) returns (ResponsePing); rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx); } + +service BlockAPI { + rpc BlockByHash(BlockByHashRequest) returns (stream StreamedBlockByHashResponse); + rpc BlockMetaByHash(BlockMetaByHashRequest) returns (BlockMetaByHashResponse); + rpc BlockByHeight(BlockByHeightRequest) returns (stream StreamedBlockByHeightResponse); + 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/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..cef4176e5e 100644 --- a/rpc/grpc/api.go +++ b/rpc/grpc/api.go @@ -2,10 +2,24 @@ package coregrpc import ( "context" + "errors" + "fmt" + "sync" + "time" + + "github.com/tendermint/tendermint/libs/pubsub" + + "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 +51,399 @@ func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcast }, }, nil } + +type BlockAPI struct { + sync.Mutex + heightListeners map[chan NewHeightEvent]struct{} + newBlockSubscription eventstypes.Subscription + subscriptionID string + subscriptionQuery pubsub.Query +} + +func NewBlockAPI() *BlockAPI { + return &BlockAPI{ + heightListeners: make(map[chan NewHeightEvent]struct{}, 1000), + subscriptionID: fmt.Sprintf("block-api-subscription-%s", rand.Str(6)), + subscriptionQuery: eventstypes.EventQueryNewBlock, + } +} + +func (blockAPI *BlockAPI) StartNewBlockEventListener(ctx context.Context) error { + env := core.GetEnvironment() + if blockAPI.newBlockSubscription == nil { + var err error + blockAPI.newBlockSubscription, err = env.EventBus.Subscribe( + ctx, + blockAPI.subscriptionID, + blockAPI.subscriptionQuery, + 500, + ) + if err != nil { + env.Logger.Error("Failed to subscribe to new blocks", "err", err) + return err + } + } + for { + select { + case <-ctx.Done(): + return nil + case <-blockAPI.newBlockSubscription.Cancelled(): + env.Logger.Error("cancelled grpc subscription. retrying") + ok, err := blockAPI.retryNewBlocksSubscription(ctx) + if err != nil { + return err + } + if !ok { + // this will happen when the context is done. we can stop here + return nil + } + 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 { + return err + } + if !ok { + // this will happen when the context is done. we can stop here + return nil + } + 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") + return fmt.Errorf("couldn't cast event data to new block. Events: %s", event.Events()) + } + blockAPI.broadcastToListeners(ctx, data.Block.Height, data.Block.Hash()) + } + } +} + +// RetryAttempts the number of retry times when the subscription is closed. +const RetryAttempts = 6 + +// SubscriptionCapacity the maximum number of pending blocks in the subscription. +const SubscriptionCapacity = 500 + +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 < RetryAttempts; i++ { + select { + case <-ctx.Done(): + return false, nil + case <-ticker.C: + var err error + blockAPI.newBlockSubscription, err = env.EventBus.Subscribe( + ctx, + fmt.Sprintf("block-api-subscription-%s", rand.Str(6)), + blockAPI.subscriptionQuery, + SubscriptionCapacity, + ) + 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 { + // logging the error then removing the heights listener + core.GetEnvironment().Logger.Debug("failed to write to heights listener", "err", r) + blockAPI.removeHeightListener(ch) + } + }() + 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() + if blockAPI.heightListeners == nil { + // if this is nil, then there is no need to close anything + return + } + for channel := range blockAPI.heightListeners { + delete(blockAPI.heightListeners, channel) + } +} + +// Stop cleans up the BlockAPI instance by closing all listeners +// and ensuring no further events are processed. +func (blockAPI *BlockAPI) Stop(ctx context.Context) error { + blockAPI.Lock() + defer blockAPI.Unlock() + + // close all height listeners + blockAPI.closeAllListeners() + + var err error + // stop the events subscription + if blockAPI.newBlockSubscription != nil { + err = core.GetEnvironment().EventBus.Unsubscribe(ctx, blockAPI.subscriptionID, blockAPI.subscriptionQuery) + blockAPI.newBlockSubscription = nil + } + + core.GetEnvironment().Logger.Info("gRPC streaming API has been stopped") + return err +} + +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 := StreamedBlockByHashResponse{ + 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 + height := req.Height + if height == 0 { + height = blockStore.Height() + } + + blockMeta := blockStore.LoadBlockMeta(height) + if blockMeta == nil { + return fmt.Errorf("nil block meta for height %d", height) + } + + commit := blockStore.LoadSeenCommit(height) + if commit == nil { + return fmt.Errorf("nil block commit for height %d", height) + } + protoCommit := commit.ToProto() + + validatorSet, err := core.GetEnvironment().StateStore.LoadValidators(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(height, i).ToProto() + if err != nil { + return err + } + if part == nil { + return fmt.Errorf("nil block part %d for height %d", i, height) + } + if !req.Prove { + part.Proof = crypto.Proof{} + } + isLastPart := i == int(blockMeta.BlockID.PartSetHeader.Total)-1 + resp := StreamedBlockByHeightResponse{ + 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) { + blockStore := core.GetEnvironment().BlockStore + height := req.Height + if height == 0 { + height = blockStore.Height() + } + blockMeta := blockStore.LoadBlockMeta(height) + if blockMeta == nil { + return nil, fmt.Errorf("nil block meta for block height %d", height) + } + return &BlockMetaByHeightResponse{ + BlockMeta: blockMeta.ToProto(), + }, nil +} + +func (blockAPI *BlockAPI) Commit(_ context.Context, req *CommitRequest) (*CommitResponse, error) { + blockStore := core.GetEnvironment().BlockStore + height := req.Height + if height == 0 { + height = blockStore.Height() + } + commit := blockStore.LoadSeenCommit(height) + if commit == nil { + return nil, fmt.Errorf("nil block commit for height %d", 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) { + blockStore := core.GetEnvironment().BlockStore + height := req.Height + if height == 0 { + height = blockStore.Height() + } + validatorSet, err := core.GetEnvironment().StateStore.LoadValidators(height) + if err != nil { + return nil, err + } + protoValidatorSet, err := validatorSet.ToProto() + if err != nil { + return nil, err + } + return &ValidatorSetResponse{ + ValidatorSet: protoValidatorSet, + Height: height, + }, 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..f63537fb7b 100644 --- a/rpc/grpc/client_server.go +++ b/rpc/grpc/client_server.go @@ -3,6 +3,8 @@ package coregrpc import ( "net" + "github.com/tendermint/tendermint/rpc/core" + "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -21,7 +23,26 @@ type Config struct { func StartGRPCServer(ln net.Listener) error { grpcServer := grpc.NewServer() RegisterBroadcastAPIServer(grpcServer, &broadcastAPI{}) - return grpcServer.Serve(ln) + api := NewBlockAPI() + RegisterBlockAPIServer(grpcServer, api) + errCh := make(chan error, 2) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + go func() { + errCh <- api.StartNewBlockEventListener(ctx) + }() + go func() { + errCh <- grpcServer.Serve(ln) + }() + defer grpcServer.GracefulStop() + defer func(api *BlockAPI, ctx context.Context) { + err := api.Stop(ctx) + if err != nil { + core.GetEnvironment().Logger.Error("error stopping block api", "err", err) + } + }(api, ctx) + // blocks until one errors or returns nil + return <-errCh } // StartGRPCClient dials the gRPC server using protoAddr and returns a new @@ -34,6 +55,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..7fa155a270 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,410 @@ 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) + waitForHeight(t, 2) + expectedBlockMeta := core.GetEnvironment().BlockStore.LoadBlockMeta(1) + require.NotNil(t, expectedBlockMeta) + + // 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 TestLatestBlockMetaByHeight(t *testing.T) { + client := setupClient(t) + waitForHeight(t, 3) + + res, err := client.BlockMetaByHeight(context.Background(), &core_grpc.BlockMetaByHeightRequest{ + Height: 0, + }) + require.NoError(t, err) + + assert.Greater(t, res.BlockMeta.Header.Height, int64(2)) +} + +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 TestLatestCommit(t *testing.T) { + client := setupClient(t) + waitForHeight(t, 3) + + res, err := client.Commit(context.Background(), &core_grpc.CommitRequest{ + Height: 0, + }) + require.NoError(t, err) + + assert.Greater(t, res.Commit.Height, int64(2)) +} + +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 TestLatestValidatorSet(t *testing.T) { + client := setupClient(t) + waitForHeight(t, 3) + + res, err := client.ValidatorSet(context.Background(), &core_grpc.ValidatorSetRequest{ + Height: 0, + }) + require.NoError(t, err) + + assert.Greater(t, res.Height, int64(2)) +} + +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 TestLatestBlockByHeight(t *testing.T) { + client := setupClient(t) + waitForHeight(t, 2) + + // query the block along with the part proofs + res, err := client.BlockByHeight(context.Background(), &core_grpc.BlockByHeightRequest{ + Height: 0, + }) + 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.Greater(t, part.BlockMeta.Header.Height, int64(2)) +} + +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..a691dcddf7 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,371 @@ 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 the requested block height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // Prove set to true to return the parts proofs. + 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 the requested block meta height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + 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 the requested block commit height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + 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 the requested validator set height. + // If height is equal to 0, the latest height stored in the block store + // will be used. + 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 +487,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 +525,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 +568,4653 @@ 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 StreamedBlockByHashResponse 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 *StreamedBlockByHashResponse) Reset() { *m = StreamedBlockByHashResponse{} } +func (m *StreamedBlockByHashResponse) String() string { return proto.CompactTextString(m) } +func (*StreamedBlockByHashResponse) ProtoMessage() {} +func (*StreamedBlockByHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0ffff5682c662b95, []int{12} +} +func (m *StreamedBlockByHashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StreamedBlockByHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamedBlockByHashResponse.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 *StreamedBlockByHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamedBlockByHashResponse.Merge(m, src) +} +func (m *StreamedBlockByHashResponse) XXX_Size() int { + return m.Size() +} +func (m *StreamedBlockByHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StreamedBlockByHashResponse.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_StreamedBlockByHashResponse 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 *StreamedBlockByHashResponse) GetBlockPart() *types1.Part { + if m != nil { + return m.BlockPart + } + return nil } -type broadcastAPIClient struct { - cc *grpc.ClientConn +func (m *StreamedBlockByHashResponse) GetCommit() *types1.Commit { + if m != nil { + return m.Commit + } + return nil } -func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient { - return &broadcastAPIClient{cc} +func (m *StreamedBlockByHashResponse) 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 *StreamedBlockByHashResponse) 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 *StreamedBlockByHashResponse) 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 StreamedBlockByHeightResponse struct { + BlockPart *types1.Part `protobuf:"bytes,1,opt,name=block_part,json=blockPart,proto3" json:"block_part,omitempty"` + // Commit is only set in the first part, and + // it stays nil in the remaining ones. + Commit *types1.Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` + // ValidatorSet is only set in the first part, and + // it stays nil in the remaining ones. + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,3,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + // BlockMeta is only set in the first part, and + // it stays nil in the remaining ones. + 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 *StreamedBlockByHeightResponse) Reset() { *m = StreamedBlockByHeightResponse{} } +func (m *StreamedBlockByHeightResponse) String() string { return proto.CompactTextString(m) } +func (*StreamedBlockByHeightResponse) ProtoMessage() {} +func (*StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamedBlockByHeightResponse.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 *StreamedBlockByHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamedBlockByHeightResponse.Merge(m, src) +} +func (m *StreamedBlockByHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *StreamedBlockByHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StreamedBlockByHeightResponse.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_StreamedBlockByHeightResponse proto.InternalMessageInfo + +func (m *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) 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 the requested validator set. + ValidatorSet *types1.ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + // Height the height corresponding to the returned + // validator set. + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,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 +} + +func (m *ValidatorSetResponse) GetHeight() int64 { + if m != nil { + return m.Height } - return n + return 0 } -func (m *ResponsePing) Size() (n int) { - if m == nil { - return 0 +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 } - var l int - _ = l - 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 *ResponseBroadcastTx) 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 - if m.CheckTx != nil { - l = m.CheckTx.Size() - n += 1 + l + sovTypes(uint64(l)) + return 0 +} + +func (m *NewHeightEvent) GetHash() []byte { + if m != nil { + return m.Hash } - if m.DeliverTx != nil { - l = m.DeliverTx.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 } - return n +} +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) } -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +var xxx_messageInfo_StatusResponse proto.InternalMessageInfo + +func (m *StatusResponse) GetNodeInfo() *p2p.DefaultNodeInfo { + if m != nil { + return m.NodeInfo + } + return nil } -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *StatusResponse) GetSyncInfo() *SyncInfo { + if m != nil { + return m.SyncInfo + } + 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 + +func (m *StatusResponse) GetValidatorInfo() *ValidatorInfo { + if m != nil { + return m.ValidatorInfo + } + return nil +} + +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((*StreamedBlockByHashResponse)(nil), "tendermint.rpc.grpc.StreamedBlockByHashResponse") + proto.RegisterType((*StreamedBlockByHeightResponse)(nil), "tendermint.rpc.grpc.StreamedBlockByHeightResponse") + 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{ + // 1204 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x3a, 0x8d, 0xe3, 0x3c, 0xff, 0x89, 0x32, 0x0e, 0xa9, 0xd9, 0xa4, 0x76, 0xba, 0x20, + 0x9a, 0x96, 0x76, 0x1d, 0x19, 0xf5, 0xd2, 0x56, 0x48, 0x71, 0x82, 0x44, 0x94, 0x52, 0x19, 0x27, + 0x05, 0x89, 0x8b, 0x19, 0xaf, 0x27, 0xf6, 0x12, 0x7b, 0x77, 0xd8, 0x1d, 0xbb, 0xf1, 0x99, 0x2f, + 0xd0, 0x0b, 0x77, 0xc4, 0xf7, 0xe0, 0xc6, 0xa1, 0xc7, 0x5e, 0x90, 0x38, 0x01, 0x4a, 0x0e, 0x7c, + 0x0d, 0xb4, 0x33, 0xb3, 0xf6, 0x6c, 0xd6, 0x9b, 0xb8, 0x88, 0x23, 0x17, 0xeb, 0xcd, 0x9b, 0xf7, + 0x7e, 0xf3, 0xfe, 0xed, 0x7b, 0xcf, 0x50, 0x61, 0xc4, 0xe9, 0x10, 0x6f, 0x60, 0x3b, 0xac, 0xea, + 0x51, 0xab, 0xda, 0x0d, 0x7e, 0xd8, 0x98, 0x12, 0xdf, 0xa4, 0x9e, 0xcb, 0x5c, 0x54, 0x9c, 0x0a, + 0x98, 0x1e, 0xb5, 0xcc, 0x40, 0x40, 0xdf, 0x54, 0xb4, 0x70, 0xdb, 0xb2, 0x55, 0x0d, 0x7d, 0x4b, + 0xb9, 0xe4, 0xfc, 0xc8, 0xad, 0xae, 0xdc, 0xd2, 0x1a, 0x4d, 0xd4, 0xb4, 0xbc, 0x31, 0x65, 0x6e, + 0xf5, 0x8c, 0x8c, 0xc3, 0xdb, 0xed, 0x18, 0xee, 0x08, 0xf7, 0xed, 0x0e, 0x66, 0xae, 0x27, 0x25, + 0x2a, 0x5d, 0xd7, 0xed, 0xf6, 0x49, 0x95, 0x9f, 0xda, 0xc3, 0xd3, 0x2a, 0xb3, 0x07, 0xc4, 0x67, + 0x78, 0x40, 0xa5, 0xc0, 0x7a, 0xd7, 0xed, 0xba, 0x9c, 0xac, 0x06, 0x94, 0xe0, 0x1a, 0x79, 0xc8, + 0x36, 0xc9, 0xf7, 0x43, 0xe2, 0xb3, 0x86, 0xed, 0x74, 0x8d, 0x0f, 0x01, 0xc9, 0x63, 0xdd, 0x73, + 0x71, 0xc7, 0xc2, 0x3e, 0x3b, 0x39, 0x47, 0x05, 0x48, 0xb1, 0xf3, 0x92, 0xb6, 0xad, 0xed, 0xe4, + 0x9a, 0x29, 0x76, 0x6e, 0x7c, 0x0a, 0xa8, 0xde, 0x77, 0xad, 0xb3, 0xfa, 0xf8, 0x73, 0xec, 0xf7, + 0xa4, 0x02, 0x42, 0x70, 0xab, 0x87, 0xfd, 0x9e, 0x94, 0xe3, 0x34, 0x5a, 0x87, 0x25, 0xea, 0xb9, + 0x23, 0x52, 0x4a, 0x6d, 0x6b, 0x3b, 0x99, 0xa6, 0x38, 0x18, 0x07, 0xb0, 0x1e, 0xea, 0x13, 0xbb, + 0xdb, 0x63, 0x21, 0xc2, 0x06, 0xa4, 0x7b, 0x9c, 0xc1, 0x31, 0x16, 0x9b, 0xf2, 0x94, 0x80, 0xf2, + 0x10, 0x36, 0x38, 0xca, 0x17, 0x84, 0xe1, 0x1b, 0x2d, 0x31, 0x6a, 0x50, 0x52, 0xa5, 0xe7, 0x79, + 0xd7, 0xb8, 0x07, 0xf9, 0x7d, 0x77, 0x30, 0xb0, 0x6f, 0x14, 0x7c, 0x04, 0xc5, 0xaf, 0xc2, 0x7c, + 0x1c, 0x93, 0x1b, 0xc5, 0xb7, 0x40, 0x3f, 0x1e, 0xb6, 0x7d, 0xcb, 0xb3, 0xdb, 0xe4, 0x05, 0x79, + 0x25, 0x8c, 0xf1, 0xa5, 0x96, 0xb1, 0x0a, 0xf9, 0x63, 0x86, 0xd9, 0x70, 0xc2, 0x28, 0x40, 0xae, + 0x49, 0x7c, 0xea, 0x3a, 0x3e, 0xe1, 0x49, 0xfa, 0x51, 0x83, 0x62, 0xc8, 0x50, 0xd3, 0xf4, 0x14, + 0x32, 0x56, 0x8f, 0x58, 0x67, 0x2d, 0x99, 0xac, 0x6c, 0x6d, 0xdb, 0x54, 0x2a, 0x38, 0x28, 0x56, + 0x33, 0xd4, 0xdb, 0x0f, 0x04, 0x4f, 0xce, 0x9b, 0xcb, 0x96, 0x20, 0xd0, 0x1e, 0x40, 0x87, 0xf4, + 0xed, 0x11, 0xf1, 0x02, 0xf5, 0x14, 0x57, 0x37, 0x12, 0xd5, 0x0f, 0x84, 0xe8, 0xc9, 0x79, 0x73, + 0xa5, 0x13, 0x92, 0xc6, 0x4f, 0x29, 0xd8, 0x3c, 0x66, 0x1e, 0xc1, 0x03, 0xd2, 0x89, 0xd4, 0x87, + 0xd0, 0x41, 0x8f, 0x01, 0xda, 0x01, 0xbb, 0x45, 0xb1, 0xc7, 0xa4, 0x85, 0x1b, 0xea, 0x13, 0xe2, + 0x7b, 0x68, 0x60, 0x8f, 0x35, 0x57, 0xb8, 0x64, 0x40, 0xa2, 0x5d, 0x48, 0x5b, 0x3c, 0x0b, 0xd2, + 0xaa, 0x52, 0x5c, 0x45, 0x66, 0x49, 0xca, 0xa1, 0x7d, 0xc8, 0x4f, 0x3e, 0x8f, 0x96, 0x4f, 0x58, + 0x69, 0x91, 0x2b, 0x96, 0xe3, 0x8a, 0x91, 0xac, 0xe5, 0x46, 0xca, 0x09, 0x3d, 0x09, 0xad, 0x1d, + 0x10, 0x86, 0x4b, 0xb7, 0x38, 0xc2, 0x66, 0x1c, 0x61, 0x52, 0x54, 0xd2, 0xe4, 0x80, 0x44, 0xb7, + 0x61, 0xd9, 0xf6, 0x5b, 0x7d, 0xec, 0xb3, 0xd2, 0x12, 0x2f, 0xd9, 0xb4, 0xed, 0x3f, 0xc7, 0x3e, + 0x33, 0x7e, 0x4e, 0xc1, 0x9d, 0xab, 0x21, 0x92, 0xa5, 0xf8, 0x7f, 0x90, 0xc2, 0x20, 0xbd, 0x84, + 0xdb, 0xb1, 0x0f, 0x5b, 0x46, 0x27, 0xfa, 0x9e, 0xf6, 0x2e, 0xef, 0x19, 0x5f, 0xc3, 0xfb, 0x33, + 0x3a, 0xc0, 0x7f, 0x00, 0x5c, 0x87, 0x42, 0xd8, 0x26, 0x24, 0xda, 0x34, 0x1b, 0xda, 0x7c, 0xd9, + 0x30, 0x7c, 0x58, 0x8f, 0x76, 0x10, 0x89, 0x14, 0xcb, 0x92, 0xf6, 0x2f, 0xb2, 0x34, 0xed, 0x43, + 0xa9, 0x48, 0x1f, 0x7a, 0x06, 0x85, 0x49, 0xfb, 0xf9, 0x6c, 0x44, 0x9c, 0xe4, 0x0e, 0x1c, 0x76, + 0xd4, 0x94, 0xd2, 0x51, 0x7f, 0xd3, 0xa0, 0x10, 0x36, 0x2a, 0x69, 0xed, 0x33, 0x58, 0x71, 0xdc, + 0x0e, 0x69, 0xd9, 0xce, 0xa9, 0x2b, 0x2d, 0xad, 0xa8, 0x96, 0xd2, 0x1a, 0x35, 0x0f, 0xc8, 0x29, + 0x1e, 0xf6, 0xd9, 0x0b, 0xb7, 0x43, 0x0e, 0x9d, 0x53, 0xb7, 0x99, 0x71, 0x24, 0x85, 0x9e, 0xc0, + 0x8a, 0x3f, 0x76, 0x2c, 0xa1, 0x2d, 0xca, 0xf8, 0x8e, 0x39, 0x63, 0x04, 0x9b, 0xc7, 0x63, 0xc7, + 0x12, 0xba, 0xbe, 0xa4, 0xd0, 0x21, 0x14, 0xa6, 0x71, 0xe2, 0x00, 0x8b, 0xf1, 0x16, 0x36, 0x01, + 0x98, 0xc4, 0x8a, 0xa3, 0x4c, 0x23, 0x1c, 0x1c, 0x8d, 0xbf, 0x17, 0x21, 0x13, 0xbe, 0x80, 0x1e, + 0xc0, 0x5a, 0x1f, 0x33, 0xe2, 0xb3, 0x96, 0x28, 0x0f, 0x65, 0xae, 0xac, 0x8a, 0x0b, 0x5e, 0x12, + 0x41, 0x91, 0xa2, 0x8f, 0x40, 0xb2, 0x5a, 0x98, 0xd2, 0x96, 0x12, 0xaf, 0xbc, 0x60, 0xef, 0x51, + 0xca, 0xe5, 0x4c, 0x28, 0x46, 0x31, 0x45, 0xc4, 0x17, 0x79, 0xc4, 0xd7, 0x54, 0x54, 0x11, 0xfc, + 0xc6, 0x15, 0x1b, 0x82, 0xc9, 0x2e, 0xbf, 0x35, 0xdd, 0x14, 0x63, 0xdf, 0x0c, 0xc7, 0xbe, 0x79, + 0x12, 0x8e, 0xfd, 0x7a, 0xe6, 0xcd, 0x1f, 0x95, 0x85, 0xd7, 0x7f, 0x56, 0xb4, 0x88, 0xa5, 0xc1, + 0x7d, 0x60, 0x01, 0xc1, 0x5e, 0xdf, 0xbe, 0xe2, 0xd7, 0x12, 0xb7, 0x76, 0x2d, 0xbc, 0x9a, 0x7a, + 0xf6, 0x00, 0x26, 0xcc, 0xa9, 0x6f, 0x69, 0x11, 0x85, 0xf0, 0x22, 0xf4, 0xae, 0x06, 0xef, 0x5d, + 0xc5, 0x16, 0xfe, 0x2d, 0x73, 0xff, 0x8a, 0x51, 0x74, 0xe1, 0xe1, 0x49, 0xcc, 0x1e, 0xee, 0x63, + 0xe6, 0x1d, 0x7c, 0x8c, 0x5a, 0xcd, 0xbd, 0xac, 0x40, 0xd6, 0xc2, 0xcc, 0xea, 0xd9, 0x4e, 0xb7, + 0x35, 0xa4, 0xa5, 0x15, 0xde, 0x64, 0x20, 0x64, 0xbd, 0xa4, 0xc6, 0x0f, 0x1a, 0xe4, 0x23, 0xa5, + 0x80, 0x4a, 0xb0, 0x8c, 0x3b, 0x1d, 0x8f, 0xf8, 0xbe, 0x4c, 0x72, 0x78, 0x44, 0x8f, 0x61, 0x99, + 0x0e, 0xdb, 0xad, 0x33, 0x32, 0x96, 0xa5, 0xb9, 0xa5, 0x56, 0x96, 0xd8, 0xd8, 0xcc, 0xc6, 0xb0, + 0xdd, 0xb7, 0xad, 0x23, 0x32, 0x6e, 0xa6, 0xe9, 0xb0, 0x7d, 0x44, 0xc6, 0xe8, 0x2e, 0xe4, 0x46, + 0x2e, 0x0b, 0x2c, 0xa0, 0xee, 0x2b, 0xe2, 0xc9, 0x24, 0x67, 0x05, 0xaf, 0x11, 0xb0, 0x6a, 0xbf, + 0x68, 0x90, 0x9b, 0x8c, 0xf1, 0xbd, 0xc6, 0x21, 0x3a, 0x82, 0x5b, 0xc1, 0x9c, 0x47, 0xdb, 0x33, + 0x6b, 0x57, 0x59, 0xd7, 0xf4, 0xbb, 0x09, 0x12, 0xd3, 0x65, 0x01, 0x7d, 0x0b, 0x59, 0x75, 0x47, + 0xb8, 0x77, 0x1d, 0xa6, 0x22, 0xa8, 0xef, 0x5c, 0x0b, 0xad, 0x48, 0xd6, 0x7e, 0x4d, 0x43, 0x86, + 0x07, 0x3d, 0xb0, 0xfd, 0x3b, 0xc8, 0x2a, 0xa3, 0x3f, 0xe1, 0xb9, 0xf8, 0xf2, 0xa8, 0xef, 0xce, + 0xfe, 0xd0, 0x93, 0xb7, 0x89, 0x5d, 0x0d, 0xf5, 0x61, 0xf5, 0xca, 0x9c, 0x40, 0x1f, 0x27, 0xbf, + 0x17, 0x5b, 0x13, 0xf5, 0x87, 0xf3, 0x09, 0xcb, 0xde, 0x46, 0x21, 0x1f, 0x99, 0xd8, 0xe8, 0xfe, + 0xb5, 0xbe, 0xa9, 0x0b, 0xa6, 0x5e, 0x9b, 0xcb, 0xbb, 0xc8, 0x44, 0xda, 0xd5, 0x90, 0x07, 0x6b, + 0xb1, 0x81, 0x85, 0x1e, 0xdd, 0x68, 0x74, 0xe4, 0x65, 0x73, 0x5e, 0x71, 0xe9, 0xe5, 0x97, 0x90, + 0x16, 0x93, 0x09, 0xcd, 0xee, 0x9c, 0x91, 0x7d, 0x58, 0xff, 0xe0, 0x5a, 0x19, 0x09, 0x69, 0x41, + 0x4e, 0x9d, 0x4d, 0x68, 0xe7, 0xfa, 0x96, 0x3c, 0xdd, 0x9f, 0xf5, 0xfb, 0x73, 0x48, 0xca, 0x47, + 0x06, 0x50, 0x9c, 0xb1, 0x52, 0xa3, 0xea, 0xec, 0xc0, 0x27, 0x2e, 0xdf, 0x09, 0x1e, 0x45, 0xa7, + 0xe4, 0xae, 0x16, 0x84, 0x49, 0x8c, 0xbe, 0x84, 0x30, 0x45, 0x16, 0xf8, 0x04, 0xd0, 0xe8, 0xec, + 0xac, 0x3f, 0x7f, 0x73, 0x51, 0xd6, 0xde, 0x5e, 0x94, 0xb5, 0xbf, 0x2e, 0xca, 0xda, 0xeb, 0xcb, + 0xf2, 0xc2, 0xdb, 0xcb, 0xf2, 0xc2, 0xef, 0x97, 0xe5, 0x85, 0x6f, 0x6a, 0x5d, 0x9b, 0xf5, 0x86, + 0x6d, 0xd3, 0x72, 0x07, 0x55, 0xf5, 0x7f, 0x60, 0xfc, 0xdf, 0xeb, 0x53, 0xcb, 0xf5, 0x48, 0x40, + 0xb4, 0xd3, 0xbc, 0x59, 0x7e, 0xf2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4b, 0xec, 0x45, 0xd8, + 0xe4, 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() (*StreamedBlockByHashResponse, error) + grpc.ClientStream +} + +type blockAPIBlockByHashClient struct { + grpc.ClientStream +} + +func (x *blockAPIBlockByHashClient) Recv() (*StreamedBlockByHashResponse, error) { + m := new(StreamedBlockByHashResponse) + 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() (*StreamedBlockByHeightResponse, error) + grpc.ClientStream +} + +type blockAPIBlockByHeightClient struct { + grpc.ClientStream +} + +func (x *blockAPIBlockByHeightClient) Recv() (*StreamedBlockByHeightResponse, error) { + m := new(StreamedBlockByHeightResponse) + 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(*StreamedBlockByHashResponse) error + grpc.ServerStream +} + +type blockAPIBlockByHashServer struct { + grpc.ServerStream +} + +func (x *blockAPIBlockByHashServer) Send(m *StreamedBlockByHashResponse) 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(*StreamedBlockByHeightResponse) error + grpc.ServerStream +} + +type blockAPIBlockByHeightServer struct { + grpc.ServerStream +} + +func (x *blockAPIBlockByHeightServer) Send(m *StreamedBlockByHeightResponse) 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 *StreamedBlockByHashResponse) 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 *StreamedBlockByHashResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamedBlockByHashResponse) 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 *StreamedBlockByHeightResponse) 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 *StreamedBlockByHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamedBlockByHeightResponse) 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.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + 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 *StreamedBlockByHashResponse) 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 *StreamedBlockByHeightResponse) 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)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + 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 *StreamedBlockByHashResponse) 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: StreamedBlockByHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamedBlockByHashResponse: 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 *StreamedBlockByHeightResponse) 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: StreamedBlockByHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamedBlockByHeightResponse: 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 + case 2: + 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 *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 +5241,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 +5339,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 +5362,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 +5382,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 +5431,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..010a7cc5e7 100644 --- a/types/part_set.go +++ b/types/part_set.go @@ -271,6 +271,27 @@ func (ps *PartSet) Total() uint32 { } func (ps *PartSet) AddPart(part *Part) (bool, error) { + if part == nil { + return false, fmt.Errorf("nil part") + } + + // 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 part == nil { + return false, fmt.Errorf("nil part") + } if ps == nil { return false, nil } @@ -287,16 +308,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)