// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: ibc/core/client/v1/query.proto

package types

import (
	context "context"
	fmt "fmt"
	types "github.com/cosmos/cosmos-sdk/codec/types"
	query "github.com/cosmos/cosmos-sdk/types/query"
	_ "github.com/gogo/protobuf/gogoproto"
	grpc1 "github.com/gogo/protobuf/grpc"
	proto "github.com/gogo/protobuf/proto"
	_ "google.golang.org/genproto/googleapis/api/annotations"
	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"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

// QueryClientStateRequest is the request type for the Query/ClientState RPC
// method
type QueryClientStateRequest struct {
	// client state unique identifier
	ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
}

func (m *QueryClientStateRequest) Reset()         { *m = QueryClientStateRequest{} }
func (m *QueryClientStateRequest) String() string { return proto.CompactTextString(m) }
func (*QueryClientStateRequest) ProtoMessage()    {}
func (*QueryClientStateRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_dc42cdfd1d52d76e, []int{0}
}
func (m *QueryClientStateRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryClientStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryClientStateRequest.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 *QueryClientStateRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryClientStateRequest.Merge(m, src)
}
func (m *QueryClientStateRequest) XXX_Size() int {
	return m.Size()
}
func (m *QueryClientStateRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryClientStateRequest.DiscardUnknown(m)
}

var xxx_messageInfo_QueryClientStateRequest proto.InternalMessageInfo

func (m *QueryClientStateRequest) GetClientId() string {
	if m != nil {
		return m.ClientId
	}
	return ""
}

// QueryClientStateResponse is the response type for the Query/ClientState RPC
// method. Besides the client state, it includes a proof and the height from
// which the proof was retrieved.
type QueryClientStateResponse struct {
	// client state associated with the request identifier
	ClientState *types.Any `protobuf:"bytes,1,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty"`
	// merkle proof of existence
	Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"`
	// merkle proof path
	ProofPath string `protobuf:"bytes,3,opt,name=proof_path,json=proofPath,proto3" json:"proof_path,omitempty"`
	// height at which the proof was retrieved
	ProofHeight Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"`
}

func (m *QueryClientStateResponse) Reset()         { *m = QueryClientStateResponse{} }
func (m *QueryClientStateResponse) String() string { return proto.CompactTextString(m) }
func (*QueryClientStateResponse) ProtoMessage()    {}
func (*QueryClientStateResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_dc42cdfd1d52d76e, []int{1}
}
func (m *QueryClientStateResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryClientStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryClientStateResponse.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 *QueryClientStateResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryClientStateResponse.Merge(m, src)
}
func (m *QueryClientStateResponse) XXX_Size() int {
	return m.Size()
}
func (m *QueryClientStateResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryClientStateResponse.DiscardUnknown(m)
}

var xxx_messageInfo_QueryClientStateResponse proto.InternalMessageInfo

func (m *QueryClientStateResponse) GetClientState() *types.Any {
	if m != nil {
		return m.ClientState
	}
	return nil
}

func (m *QueryClientStateResponse) GetProof() []byte {
	if m != nil {
		return m.Proof
	}
	return nil
}

func (m *QueryClientStateResponse) GetProofPath() string {
	if m != nil {
		return m.ProofPath
	}
	return ""
}

func (m *QueryClientStateResponse) GetProofHeight() Height {
	if m != nil {
		return m.ProofHeight
	}
	return Height{}
}

// QueryClientStatesRequest is the request type for the Query/ClientStates RPC
// method
type QueryClientStatesRequest struct {
	// pagination request
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (m *QueryClientStatesRequest) Reset()         { *m = QueryClientStatesRequest{} }
func (m *QueryClientStatesRequest) String() string { return proto.CompactTextString(m) }
func (*QueryClientStatesRequest) ProtoMessage()    {}
func (*QueryClientStatesRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_dc42cdfd1d52d76e, []int{2}
}
func (m *QueryClientStatesRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryClientStatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryClientStatesRequest.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 *QueryClientStatesRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryClientStatesRequest.Merge(m, src)
}
func (m *QueryClientStatesRequest) XXX_Size() int {
	return m.Size()
}
func (m *QueryClientStatesRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryClientStatesRequest.DiscardUnknown(m)
}

var xxx_messageInfo_QueryClientStatesRequest proto.InternalMessageInfo

func (m *QueryClientStatesRequest) GetPagination() *query.PageRequest {
	if m != nil {
		return m.Pagination
	}
	return nil
}

// QueryClientStatesResponse is the response type for the Query/ClientStates RPC
// method.
type QueryClientStatesResponse struct {
	// list of stored ClientStates of the chain.
	ClientStates []*IdentifiedClientState `protobuf:"bytes,1,rep,name=client_states,json=clientStates,proto3" json:"client_states,omitempty"`
	// pagination response
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (m *QueryClientStatesResponse) Reset()         { *m = QueryClientStatesResponse{} }
func (m *QueryClientStatesResponse) String() string { return proto.CompactTextString(m) }
func (*QueryClientStatesResponse) ProtoMessage()    {}
func (*QueryClientStatesResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_dc42cdfd1d52d76e, []int{3}
}
func (m *QueryClientStatesResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryClientStatesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryClientStatesResponse.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 *QueryClientStatesResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryClientStatesResponse.Merge(m, src)
}
func (m *QueryClientStatesResponse) XXX_Size() int {
	return m.Size()
}
func (m *QueryClientStatesResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryClientStatesResponse.DiscardUnknown(m)
}

var xxx_messageInfo_QueryClientStatesResponse proto.InternalMessageInfo

func (m *QueryClientStatesResponse) GetClientStates() []*IdentifiedClientState {
	if m != nil {
		return m.ClientStates
	}
	return nil
}

func (m *QueryClientStatesResponse) GetPagination() *query.PageResponse {
	if m != nil {
		return m.Pagination
	}
	return nil
}

// QueryConsensusStateRequest is the request type for the Query/ConsensusState
// RPC method. Besides the consensus state, it includes a proof and the height
// from which the proof was retrieved.
type QueryConsensusStateRequest struct {
	// client identifier
	ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// consensus state version number
	VersionNumber uint64 `protobuf:"varint,2,opt,name=version_number,json=versionNumber,proto3" json:"version_number,omitempty"`
	// consensus state version height
	VersionHeight uint64 `protobuf:"varint,3,opt,name=version_height,json=versionHeight,proto3" json:"version_height,omitempty"`
	// latest_height overrrides the height field and queries the latest stored
	// ConsensusState
	LatestHeight bool `protobuf:"varint,4,opt,name=latest_height,json=latestHeight,proto3" json:"latest_height,omitempty"`
}

func (m *QueryConsensusStateRequest) Reset()         { *m = QueryConsensusStateRequest{} }
func (m *QueryConsensusStateRequest) String() string { return proto.CompactTextString(m) }
func (*QueryConsensusStateRequest) ProtoMessage()    {}
func (*QueryConsensusStateRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_dc42cdfd1d52d76e, []int{4}
}
func (m *QueryConsensusStateRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryConsensusStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryConsensusStateRequest.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 *QueryConsensusStateRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryConsensusStateRequest.Merge(m, src)
}
func (m *QueryConsensusStateRequest) XXX_Size() int {
	return m.Size()
}
func (m *QueryConsensusStateRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryConsensusStateRequest.DiscardUnknown(m)
}

var xxx_messageInfo_QueryConsensusStateRequest proto.InternalMessageInfo

func (m *QueryConsensusStateRequest) GetClientId() string {
	if m != nil {
		return m.ClientId
	}
	return ""
}

func (m *QueryConsensusStateRequest) GetVersionNumber() uint64 {
	if m != nil {
		return m.VersionNumber
	}
	return 0
}

func (m *QueryConsensusStateRequest) GetVersionHeight() uint64 {
	if m != nil {
		return m.VersionHeight
	}
	return 0
}

func (m *QueryConsensusStateRequest) GetLatestHeight() bool {
	if m != nil {
		return m.LatestHeight
	}
	return false
}

// QueryConsensusStateResponse is the response type for the Query/ConsensusState
// RPC method
type QueryConsensusStateResponse struct {
	// consensus state associated with the client identifier at the given height
	ConsensusState *types.Any `protobuf:"bytes,1,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty"`
	// merkle proof of existence
	Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"`
	// merkle proof path
	ProofPath string `protobuf:"bytes,3,opt,name=proof_path,json=proofPath,proto3" json:"proof_path,omitempty"`
	// height at which the proof was retrieved
	ProofHeight Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"`
}

func (m *QueryConsensusStateResponse) Reset()         { *m = QueryConsensusStateResponse{} }
func (m *QueryConsensusStateResponse) String() string { return proto.CompactTextString(m) }
func (*QueryConsensusStateResponse) ProtoMessage()    {}
func (*QueryConsensusStateResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_dc42cdfd1d52d76e, []int{5}
}
func (m *QueryConsensusStateResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryConsensusStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryConsensusStateResponse.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 *QueryConsensusStateResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryConsensusStateResponse.Merge(m, src)
}
func (m *QueryConsensusStateResponse) XXX_Size() int {
	return m.Size()
}
func (m *QueryConsensusStateResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryConsensusStateResponse.DiscardUnknown(m)
}

var xxx_messageInfo_QueryConsensusStateResponse proto.InternalMessageInfo

func (m *QueryConsensusStateResponse) GetConsensusState() *types.Any {
	if m != nil {
		return m.ConsensusState
	}
	return nil
}

func (m *QueryConsensusStateResponse) GetProof() []byte {
	if m != nil {
		return m.Proof
	}
	return nil
}

func (m *QueryConsensusStateResponse) GetProofPath() string {
	if m != nil {
		return m.ProofPath
	}
	return ""
}

func (m *QueryConsensusStateResponse) GetProofHeight() Height {
	if m != nil {
		return m.ProofHeight
	}
	return Height{}
}

// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates
// RPC method.
type QueryConsensusStatesRequest struct {
	// client identifier
	ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// pagination request
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (m *QueryConsensusStatesRequest) Reset()         { *m = QueryConsensusStatesRequest{} }
func (m *QueryConsensusStatesRequest) String() string { return proto.CompactTextString(m) }
func (*QueryConsensusStatesRequest) ProtoMessage()    {}
func (*QueryConsensusStatesRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_dc42cdfd1d52d76e, []int{6}
}
func (m *QueryConsensusStatesRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryConsensusStatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryConsensusStatesRequest.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 *QueryConsensusStatesRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryConsensusStatesRequest.Merge(m, src)
}
func (m *QueryConsensusStatesRequest) XXX_Size() int {
	return m.Size()
}
func (m *QueryConsensusStatesRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryConsensusStatesRequest.DiscardUnknown(m)
}

var xxx_messageInfo_QueryConsensusStatesRequest proto.InternalMessageInfo

func (m *QueryConsensusStatesRequest) GetClientId() string {
	if m != nil {
		return m.ClientId
	}
	return ""
}

func (m *QueryConsensusStatesRequest) GetPagination() *query.PageRequest {
	if m != nil {
		return m.Pagination
	}
	return nil
}

// QueryConsensusStatesResponse is the response type for the
// Query/ConsensusStates RPC method
type QueryConsensusStatesResponse struct {
	// consensus states associated with the identifier
	ConsensusStates []ConsensusStateWithHeight `protobuf:"bytes,1,rep,name=consensus_states,json=consensusStates,proto3" json:"consensus_states"`
	// pagination response
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (m *QueryConsensusStatesResponse) Reset()         { *m = QueryConsensusStatesResponse{} }
func (m *QueryConsensusStatesResponse) String() string { return proto.CompactTextString(m) }
func (*QueryConsensusStatesResponse) ProtoMessage()    {}
func (*QueryConsensusStatesResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_dc42cdfd1d52d76e, []int{7}
}
func (m *QueryConsensusStatesResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryConsensusStatesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryConsensusStatesResponse.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 *QueryConsensusStatesResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryConsensusStatesResponse.Merge(m, src)
}
func (m *QueryConsensusStatesResponse) XXX_Size() int {
	return m.Size()
}
func (m *QueryConsensusStatesResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryConsensusStatesResponse.DiscardUnknown(m)
}

var xxx_messageInfo_QueryConsensusStatesResponse proto.InternalMessageInfo

func (m *QueryConsensusStatesResponse) GetConsensusStates() []ConsensusStateWithHeight {
	if m != nil {
		return m.ConsensusStates
	}
	return nil
}

func (m *QueryConsensusStatesResponse) GetPagination() *query.PageResponse {
	if m != nil {
		return m.Pagination
	}
	return nil
}

func init() {
	proto.RegisterType((*QueryClientStateRequest)(nil), "ibc.core.client.v1.QueryClientStateRequest")
	proto.RegisterType((*QueryClientStateResponse)(nil), "ibc.core.client.v1.QueryClientStateResponse")
	proto.RegisterType((*QueryClientStatesRequest)(nil), "ibc.core.client.v1.QueryClientStatesRequest")
	proto.RegisterType((*QueryClientStatesResponse)(nil), "ibc.core.client.v1.QueryClientStatesResponse")
	proto.RegisterType((*QueryConsensusStateRequest)(nil), "ibc.core.client.v1.QueryConsensusStateRequest")
	proto.RegisterType((*QueryConsensusStateResponse)(nil), "ibc.core.client.v1.QueryConsensusStateResponse")
	proto.RegisterType((*QueryConsensusStatesRequest)(nil), "ibc.core.client.v1.QueryConsensusStatesRequest")
	proto.RegisterType((*QueryConsensusStatesResponse)(nil), "ibc.core.client.v1.QueryConsensusStatesResponse")
}

func init() { proto.RegisterFile("ibc/core/client/v1/query.proto", fileDescriptor_dc42cdfd1d52d76e) }

var fileDescriptor_dc42cdfd1d52d76e = []byte{
	// 765 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x4f, 0x4f, 0x13, 0x41,
	0x14, 0xef, 0xf0, 0xc7, 0xc0, 0xb4, 0x80, 0x99, 0x90, 0x58, 0x16, 0x2c, 0x58, 0xa2, 0x82, 0xd2,
	0x19, 0x5a, 0xa3, 0x78, 0xf1, 0x20, 0x24, 0x28, 0x17, 0x02, 0xeb, 0xc1, 0xc4, 0xc4, 0x90, 0xdd,
	0xed, 0xb0, 0x9d, 0x08, 0x3b, 0xa5, 0x33, 0x6d, 0x24, 0x84, 0x0b, 0x9f, 0xc0, 0xc4, 0xc4, 0xab,
	0x5f, 0xc0, 0x78, 0xf2, 0x33, 0x18, 0x2e, 0x26, 0x44, 0x13, 0xe3, 0xc1, 0x18, 0x03, 0x7e, 0x10,
	0xb3, 0x33, 0xb3, 0xb0, 0x0b, 0x4b, 0x58, 0x8d, 0x89, 0xa7, 0xee, 0xbe, 0x3f, 0xf3, 0x7e, 0xef,
	0xf7, 0x7b, 0xf3, 0xba, 0xb0, 0xc4, 0x5c, 0x8f, 0x78, 0xbc, 0x45, 0x89, 0xb7, 0xc1, 0x68, 0x20,
	0x49, 0xa7, 0x4a, 0xb6, 0xda, 0xb4, 0xb5, 0x8d, 0x9b, 0x2d, 0x2e, 0x39, 0x42, 0xcc, 0xf5, 0x70,
	0xe8, 0xc7, 0xda, 0x8f, 0x3b, 0x55, 0xeb, 0x96, 0xc7, 0xc5, 0x26, 0x17, 0xc4, 0x75, 0x04, 0xd5,
	0xc1, 0xa4, 0x53, 0x75, 0xa9, 0x74, 0xaa, 0xa4, 0xe9, 0xf8, 0x2c, 0x70, 0x24, 0xe3, 0x81, 0xce,
	0xb7, 0xc6, 0x53, 0xce, 0x37, 0x27, 0xe9, 0x80, 0x11, 0x9f, 0x73, 0x7f, 0x83, 0x12, 0xf5, 0xe6,
	0xb6, 0xd7, 0x89, 0x13, 0x98, 0xda, 0xd6, 0x98, 0x71, 0x39, 0x4d, 0x46, 0x9c, 0x20, 0xe0, 0x52,
	0x1d, 0x2c, 0x8c, 0x77, 0xd8, 0xe7, 0x3e, 0x57, 0x8f, 0x24, 0x7c, 0xd2, 0xd6, 0xf2, 0x3d, 0x78,
	0x65, 0x35, 0x44, 0xb4, 0xa0, 0x6a, 0x3c, 0x91, 0x8e, 0xa4, 0x36, 0xdd, 0x6a, 0x53, 0x21, 0xd1,
	0x28, 0xec, 0xd7, 0x95, 0xd7, 0x58, 0xbd, 0x08, 0x26, 0xc0, 0x54, 0xbf, 0xdd, 0xa7, 0x0d, 0x4b,
	0xf5, 0xf2, 0x27, 0x00, 0x8b, 0x67, 0x13, 0x45, 0x93, 0x07, 0x82, 0xa2, 0x39, 0x58, 0x30, 0x99,
	0x22, 0xb4, 0xab, 0xe4, 0x7c, 0x6d, 0x18, 0x6b, 0x7c, 0x38, 0x82, 0x8e, 0x1f, 0x06, 0xdb, 0x76,
	0xde, 0x3b, 0x39, 0x00, 0x0d, 0xc3, 0xde, 0x66, 0x8b, 0xf3, 0xf5, 0x62, 0xd7, 0x04, 0x98, 0x2a,
	0xd8, 0xfa, 0x05, 0x5d, 0x85, 0x50, 0x3d, 0xac, 0x35, 0x1d, 0xd9, 0x28, 0x76, 0x2b, 0x24, 0xfd,
	0xca, 0xb2, 0xe2, 0xc8, 0x06, 0x5a, 0x80, 0x05, 0xed, 0x6e, 0x50, 0xe6, 0x37, 0x64, 0xb1, 0x47,
	0x55, 0xb3, 0xf0, 0x59, 0x25, 0xf0, 0x63, 0x15, 0x31, 0xdf, 0xb3, 0xff, 0x63, 0x3c, 0x67, 0xe7,
	0x55, 0x96, 0x36, 0x95, 0xdd, 0xb3, 0xed, 0x88, 0x88, 0x88, 0x45, 0x08, 0x4f, 0x74, 0x32, 0xcd,
	0xdc, 0xc0, 0x5a, 0x54, 0x1c, 0x8a, 0x8a, 0xf5, 0x04, 0x18, 0x51, 0xf1, 0x8a, 0xe3, 0x47, 0x24,
	0xda, 0xb1, 0xcc, 0xf2, 0x07, 0x00, 0x47, 0x52, 0x8a, 0x18, 0xd2, 0x96, 0xe1, 0x40, 0x9c, 0x34,
	0x51, 0x04, 0x13, 0xdd, 0x53, 0xf9, 0xda, 0x74, 0x5a, 0x1f, 0x4b, 0x75, 0x1a, 0x48, 0xb6, 0xce,
	0x68, 0x3d, 0x4e, 0x7f, 0x21, 0x46, 0xa5, 0x40, 0x8f, 0x12, 0xa8, 0xbb, 0x14, 0xea, 0x9b, 0x17,
	0xa2, 0xd6, 0x60, 0x12, 0xb0, 0xdf, 0x01, 0x68, 0x69, 0xd8, 0xa1, 0x2b, 0x10, 0x6d, 0x91, 0x79,
	0x4c, 0xd0, 0x75, 0x38, 0xd8, 0xa1, 0x2d, 0xc1, 0x78, 0xb0, 0x16, 0xb4, 0x37, 0x5d, 0xda, 0x52,
	0x40, 0x7a, 0xec, 0x01, 0x63, 0x5d, 0x56, 0xc6, 0x78, 0x98, 0x11, 0xb1, 0x3b, 0x11, 0xa6, 0x45,
	0x42, 0x93, 0x70, 0x60, 0x23, 0xec, 0x4d, 0xc6, 0xa5, 0xee, 0xb3, 0x0b, 0xda, 0x68, 0x94, 0xfc,
	0x0a, 0xe0, 0x68, 0x2a, 0x5c, 0xc3, 0xf3, 0x03, 0x38, 0xe4, 0x45, 0x9e, 0x0c, 0xf3, 0x39, 0xe8,
	0x25, 0x8e, 0xf9, 0x8f, 0x23, 0xba, 0x97, 0xde, 0x98, 0xc8, 0x24, 0xc4, 0x62, 0xca, 0x34, 0xfc,
	0xcd, 0x0c, 0x7f, 0x04, 0x70, 0x2c, 0x1d, 0x84, 0xa1, 0xf7, 0x39, 0xbc, 0x7c, 0x8a, 0xde, 0x68,
	0x92, 0x67, 0xd2, 0xda, 0x4d, 0x1e, 0xf3, 0x94, 0xc9, 0x46, 0x82, 0x80, 0xa1, 0x24, 0xfb, 0xff,
	0x6e, 0xaa, 0x6b, 0x9f, 0x7b, 0x61, 0xaf, 0x6a, 0x04, 0xbd, 0x05, 0x30, 0x1f, 0xbb, 0x46, 0xe8,
	0x76, 0x1a, 0xce, 0x73, 0x96, 0xa4, 0x35, 0x93, 0x2d, 0x58, 0x03, 0x28, 0xdf, 0xdd, 0xfb, 0xf2,
	0xeb, 0x75, 0x17, 0x41, 0x15, 0xa2, 0xd6, 0x7c, 0xb4, 0xe1, 0xf5, 0x7f, 0x41, 0xe2, 0xf6, 0x93,
	0x9d, 0x63, 0x2d, 0x77, 0xd1, 0x1b, 0x00, 0x0b, 0xf1, 0x9d, 0x81, 0x32, 0x55, 0x8d, 0x06, 0xc3,
	0xaa, 0x64, 0x8c, 0x36, 0x20, 0xa7, 0x15, 0xc8, 0x49, 0x74, 0xed, 0x42, 0x90, 0xe8, 0x3b, 0x80,
	0x83, 0x49, 0x05, 0x11, 0x3e, 0xbf, 0x58, 0xda, 0xfa, 0xb0, 0x48, 0xe6, 0x78, 0x03, 0x8f, 0x29,
	0x78, 0x1e, 0x72, 0x52, 0xe1, 0x9d, 0x1a, 0xbd, 0x38, 0x8d, 0xc4, 0x2c, 0x13, 0xb2, 0x93, 0x5c,
	0x49, 0xbb, 0x44, 0xdf, 0xca, 0x13, 0xbb, 0x7e, 0xdf, 0x45, 0xef, 0x01, 0x1c, 0x3a, 0x35, 0xe7,
	0x28, 0x2b, 0xde, 0x63, 0xf6, 0x67, 0xb3, 0x27, 0x98, 0x0e, 0xef, 0xab, 0x0e, 0x6b, 0x68, 0xf6,
	0x4f, 0x3b, 0x9c, 0x5f, 0xdd, 0x3f, 0x2c, 0x81, 0x83, 0xc3, 0x12, 0xf8, 0x79, 0x58, 0x02, 0xaf,
	0x8e, 0x4a, 0xb9, 0x83, 0xa3, 0x52, 0xee, 0xdb, 0x51, 0x29, 0xf7, 0x6c, 0xce, 0x67, 0xb2, 0xd1,
	0x76, 0xb1, 0xc7, 0x37, 0x89, 0xf9, 0x1c, 0xd1, 0x3f, 0x15, 0x51, 0x7f, 0x41, 0x5e, 0x92, 0xe3,
	0xcf, 0x8e, 0xd9, 0x5a, 0xc5, 0x54, 0x94, 0xdb, 0x4d, 0x2a, 0xdc, 0x4b, 0x6a, 0x1b, 0xde, 0xf9,
	0x1d, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x28, 0x91, 0xcd, 0xf9, 0x08, 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

// QueryClient is the client API for Query service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type QueryClient interface {
	// ClientState queries an IBC light client.
	ClientState(ctx context.Context, in *QueryClientStateRequest, opts ...grpc.CallOption) (*QueryClientStateResponse, error)
	// ClientStates queries all the IBC light clients of a chain.
	ClientStates(ctx context.Context, in *QueryClientStatesRequest, opts ...grpc.CallOption) (*QueryClientStatesResponse, error)
	// ConsensusState queries a consensus state associated with a client state at
	// a given height.
	ConsensusState(ctx context.Context, in *QueryConsensusStateRequest, opts ...grpc.CallOption) (*QueryConsensusStateResponse, error)
	// ConsensusStates queries all the consensus state associated with a given
	// client.
	ConsensusStates(ctx context.Context, in *QueryConsensusStatesRequest, opts ...grpc.CallOption) (*QueryConsensusStatesResponse, error)
}

type queryClient struct {
	cc grpc1.ClientConn
}

func NewQueryClient(cc grpc1.ClientConn) QueryClient {
	return &queryClient{cc}
}

func (c *queryClient) ClientState(ctx context.Context, in *QueryClientStateRequest, opts ...grpc.CallOption) (*QueryClientStateResponse, error) {
	out := new(QueryClientStateResponse)
	err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Query/ClientState", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *queryClient) ClientStates(ctx context.Context, in *QueryClientStatesRequest, opts ...grpc.CallOption) (*QueryClientStatesResponse, error) {
	out := new(QueryClientStatesResponse)
	err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Query/ClientStates", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *queryClient) ConsensusState(ctx context.Context, in *QueryConsensusStateRequest, opts ...grpc.CallOption) (*QueryConsensusStateResponse, error) {
	out := new(QueryConsensusStateResponse)
	err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Query/ConsensusState", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *queryClient) ConsensusStates(ctx context.Context, in *QueryConsensusStatesRequest, opts ...grpc.CallOption) (*QueryConsensusStatesResponse, error) {
	out := new(QueryConsensusStatesResponse)
	err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Query/ConsensusStates", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// QueryServer is the server API for Query service.
type QueryServer interface {
	// ClientState queries an IBC light client.
	ClientState(context.Context, *QueryClientStateRequest) (*QueryClientStateResponse, error)
	// ClientStates queries all the IBC light clients of a chain.
	ClientStates(context.Context, *QueryClientStatesRequest) (*QueryClientStatesResponse, error)
	// ConsensusState queries a consensus state associated with a client state at
	// a given height.
	ConsensusState(context.Context, *QueryConsensusStateRequest) (*QueryConsensusStateResponse, error)
	// ConsensusStates queries all the consensus state associated with a given
	// client.
	ConsensusStates(context.Context, *QueryConsensusStatesRequest) (*QueryConsensusStatesResponse, error)
}

// UnimplementedQueryServer can be embedded to have forward compatible implementations.
type UnimplementedQueryServer struct {
}

func (*UnimplementedQueryServer) ClientState(ctx context.Context, req *QueryClientStateRequest) (*QueryClientStateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ClientState not implemented")
}
func (*UnimplementedQueryServer) ClientStates(ctx context.Context, req *QueryClientStatesRequest) (*QueryClientStatesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ClientStates not implemented")
}
func (*UnimplementedQueryServer) ConsensusState(ctx context.Context, req *QueryConsensusStateRequest) (*QueryConsensusStateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ConsensusState not implemented")
}
func (*UnimplementedQueryServer) ConsensusStates(ctx context.Context, req *QueryConsensusStatesRequest) (*QueryConsensusStatesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ConsensusStates not implemented")
}

func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
	s.RegisterService(&_Query_serviceDesc, srv)
}

func _Query_ClientState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryClientStateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QueryServer).ClientState(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/ibc.core.client.v1.Query/ClientState",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QueryServer).ClientState(ctx, req.(*QueryClientStateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Query_ClientStates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryClientStatesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QueryServer).ClientStates(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/ibc.core.client.v1.Query/ClientStates",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QueryServer).ClientStates(ctx, req.(*QueryClientStatesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Query_ConsensusState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryConsensusStateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QueryServer).ConsensusState(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/ibc.core.client.v1.Query/ConsensusState",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QueryServer).ConsensusState(ctx, req.(*QueryConsensusStateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Query_ConsensusStates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryConsensusStatesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QueryServer).ConsensusStates(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/ibc.core.client.v1.Query/ConsensusStates",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QueryServer).ConsensusStates(ctx, req.(*QueryConsensusStatesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Query_serviceDesc = grpc.ServiceDesc{
	ServiceName: "ibc.core.client.v1.Query",
	HandlerType: (*QueryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ClientState",
			Handler:    _Query_ClientState_Handler,
		},
		{
			MethodName: "ClientStates",
			Handler:    _Query_ClientStates_Handler,
		},
		{
			MethodName: "ConsensusState",
			Handler:    _Query_ConsensusState_Handler,
		},
		{
			MethodName: "ConsensusStates",
			Handler:    _Query_ConsensusStates_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ibc/core/client/v1/query.proto",
}

func (m *QueryClientStateRequest) 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 *QueryClientStateRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryClientStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.ClientId) > 0 {
		i -= len(m.ClientId)
		copy(dAtA[i:], m.ClientId)
		i = encodeVarintQuery(dAtA, i, uint64(len(m.ClientId)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *QueryClientStateResponse) 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 *QueryClientStateResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryClientStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintQuery(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x22
	if len(m.ProofPath) > 0 {
		i -= len(m.ProofPath)
		copy(dAtA[i:], m.ProofPath)
		i = encodeVarintQuery(dAtA, i, uint64(len(m.ProofPath)))
		i--
		dAtA[i] = 0x1a
	}
	if len(m.Proof) > 0 {
		i -= len(m.Proof)
		copy(dAtA[i:], m.Proof)
		i = encodeVarintQuery(dAtA, i, uint64(len(m.Proof)))
		i--
		dAtA[i] = 0x12
	}
	if m.ClientState != nil {
		{
			size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *QueryClientStatesRequest) 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 *QueryClientStatesRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryClientStatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Pagination != nil {
		{
			size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *QueryClientStatesResponse) 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 *QueryClientStatesResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryClientStatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Pagination != nil {
		{
			size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x12
	}
	if len(m.ClientStates) > 0 {
		for iNdEx := len(m.ClientStates) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.ClientStates[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintQuery(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0xa
		}
	}
	return len(dAtA) - i, nil
}

func (m *QueryConsensusStateRequest) 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 *QueryConsensusStateRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryConsensusStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.LatestHeight {
		i--
		if m.LatestHeight {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x20
	}
	if m.VersionHeight != 0 {
		i = encodeVarintQuery(dAtA, i, uint64(m.VersionHeight))
		i--
		dAtA[i] = 0x18
	}
	if m.VersionNumber != 0 {
		i = encodeVarintQuery(dAtA, i, uint64(m.VersionNumber))
		i--
		dAtA[i] = 0x10
	}
	if len(m.ClientId) > 0 {
		i -= len(m.ClientId)
		copy(dAtA[i:], m.ClientId)
		i = encodeVarintQuery(dAtA, i, uint64(len(m.ClientId)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *QueryConsensusStateResponse) 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 *QueryConsensusStateResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryConsensusStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintQuery(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x22
	if len(m.ProofPath) > 0 {
		i -= len(m.ProofPath)
		copy(dAtA[i:], m.ProofPath)
		i = encodeVarintQuery(dAtA, i, uint64(len(m.ProofPath)))
		i--
		dAtA[i] = 0x1a
	}
	if len(m.Proof) > 0 {
		i -= len(m.Proof)
		copy(dAtA[i:], m.Proof)
		i = encodeVarintQuery(dAtA, i, uint64(len(m.Proof)))
		i--
		dAtA[i] = 0x12
	}
	if m.ConsensusState != nil {
		{
			size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *QueryConsensusStatesRequest) 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 *QueryConsensusStatesRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryConsensusStatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Pagination != nil {
		{
			size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x12
	}
	if len(m.ClientId) > 0 {
		i -= len(m.ClientId)
		copy(dAtA[i:], m.ClientId)
		i = encodeVarintQuery(dAtA, i, uint64(len(m.ClientId)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *QueryConsensusStatesResponse) 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 *QueryConsensusStatesResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *QueryConsensusStatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Pagination != nil {
		{
			size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintQuery(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x12
	}
	if len(m.ConsensusStates) > 0 {
		for iNdEx := len(m.ConsensusStates) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.ConsensusStates[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintQuery(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0xa
		}
	}
	return len(dAtA) - i, nil
}

func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
	offset -= sovQuery(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *QueryClientStateRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.ClientId)
	if l > 0 {
		n += 1 + l + sovQuery(uint64(l))
	}
	return n
}

func (m *QueryClientStateResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.ClientState != nil {
		l = m.ClientState.Size()
		n += 1 + l + sovQuery(uint64(l))
	}
	l = len(m.Proof)
	if l > 0 {
		n += 1 + l + sovQuery(uint64(l))
	}
	l = len(m.ProofPath)
	if l > 0 {
		n += 1 + l + sovQuery(uint64(l))
	}
	l = m.ProofHeight.Size()
	n += 1 + l + sovQuery(uint64(l))
	return n
}

func (m *QueryClientStatesRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Pagination != nil {
		l = m.Pagination.Size()
		n += 1 + l + sovQuery(uint64(l))
	}
	return n
}

func (m *QueryClientStatesResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if len(m.ClientStates) > 0 {
		for _, e := range m.ClientStates {
			l = e.Size()
			n += 1 + l + sovQuery(uint64(l))
		}
	}
	if m.Pagination != nil {
		l = m.Pagination.Size()
		n += 1 + l + sovQuery(uint64(l))
	}
	return n
}

func (m *QueryConsensusStateRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.ClientId)
	if l > 0 {
		n += 1 + l + sovQuery(uint64(l))
	}
	if m.VersionNumber != 0 {
		n += 1 + sovQuery(uint64(m.VersionNumber))
	}
	if m.VersionHeight != 0 {
		n += 1 + sovQuery(uint64(m.VersionHeight))
	}
	if m.LatestHeight {
		n += 2
	}
	return n
}

func (m *QueryConsensusStateResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.ConsensusState != nil {
		l = m.ConsensusState.Size()
		n += 1 + l + sovQuery(uint64(l))
	}
	l = len(m.Proof)
	if l > 0 {
		n += 1 + l + sovQuery(uint64(l))
	}
	l = len(m.ProofPath)
	if l > 0 {
		n += 1 + l + sovQuery(uint64(l))
	}
	l = m.ProofHeight.Size()
	n += 1 + l + sovQuery(uint64(l))
	return n
}

func (m *QueryConsensusStatesRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.ClientId)
	if l > 0 {
		n += 1 + l + sovQuery(uint64(l))
	}
	if m.Pagination != nil {
		l = m.Pagination.Size()
		n += 1 + l + sovQuery(uint64(l))
	}
	return n
}

func (m *QueryConsensusStatesResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if len(m.ConsensusStates) > 0 {
		for _, e := range m.ConsensusStates {
			l = e.Size()
			n += 1 + l + sovQuery(uint64(l))
		}
	}
	if m.Pagination != nil {
		l = m.Pagination.Size()
		n += 1 + l + sovQuery(uint64(l))
	}
	return n
}

func sovQuery(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozQuery(x uint64) (n int) {
	return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *QueryClientStateRequest) 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 ErrIntOverflowQuery
			}
			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: QueryClientStateRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryClientStateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ClientId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryClientStateResponse) 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 ErrIntOverflowQuery
			}
			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: QueryClientStateResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryClientStateResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.ClientState == nil {
				m.ClientState = &types.Any{}
			}
			if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + byteLen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...)
			if m.Proof == nil {
				m.Proof = []byte{}
			}
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ProofPath", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ProofPath = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryClientStatesRequest) 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 ErrIntOverflowQuery
			}
			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: QueryClientStatesRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryClientStatesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Pagination == nil {
				m.Pagination = &query.PageRequest{}
			}
			if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryClientStatesResponse) 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 ErrIntOverflowQuery
			}
			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: QueryClientStatesResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryClientStatesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ClientStates", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ClientStates = append(m.ClientStates, &IdentifiedClientState{})
			if err := m.ClientStates[len(m.ClientStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Pagination == nil {
				m.Pagination = &query.PageResponse{}
			}
			if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryConsensusStateRequest) 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 ErrIntOverflowQuery
			}
			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: QueryConsensusStateRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryConsensusStateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ClientId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field VersionNumber", wireType)
			}
			m.VersionNumber = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.VersionNumber |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field VersionHeight", wireType)
			}
			m.VersionHeight = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.VersionHeight |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field LatestHeight", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.LatestHeight = bool(v != 0)
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryConsensusStateResponse) 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 ErrIntOverflowQuery
			}
			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: QueryConsensusStateResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryConsensusStateResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.ConsensusState == nil {
				m.ConsensusState = &types.Any{}
			}
			if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + byteLen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...)
			if m.Proof == nil {
				m.Proof = []byte{}
			}
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ProofPath", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ProofPath = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryConsensusStatesRequest) 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 ErrIntOverflowQuery
			}
			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: QueryConsensusStatesRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryConsensusStatesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ClientId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Pagination == nil {
				m.Pagination = &query.PageRequest{}
			}
			if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *QueryConsensusStatesResponse) 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 ErrIntOverflowQuery
			}
			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: QueryConsensusStatesResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: QueryConsensusStatesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ConsensusStates", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ConsensusStates = append(m.ConsensusStates, ConsensusStateWithHeight{})
			if err := m.ConsensusStates[len(m.ConsensusStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthQuery
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthQuery
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Pagination == nil {
				m.Pagination = &query.PageResponse{}
			}
			if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipQuery(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthQuery
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipQuery(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	depth := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowQuery
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
		case 1:
			iNdEx += 8
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowQuery
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthQuery
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupQuery
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthQuery
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
