// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: greenfield/challenge/types.proto

package types

import (
	fmt "fmt"
	_ "github.com/cosmos/cosmos-proto"
	_ "github.com/cosmos/gogoproto/gogoproto"
	proto "github.com/cosmos/gogoproto/proto"
	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

// VoteResult defines the result attestation for a challenge.
type VoteResult int32

const (
	// The challenge failed.
	CHALLENGE_FAILED VoteResult = 0
	// The challenge succeed.
	CHALLENGE_SUCCEED VoteResult = 1
)

var VoteResult_name = map[int32]string{
	0: "CHALLENGE_FAILED",
	1: "CHALLENGE_SUCCEED",
}

var VoteResult_value = map[string]int32{
	"CHALLENGE_FAILED":  0,
	"CHALLENGE_SUCCEED": 1,
}

func (x VoteResult) String() string {
	return proto.EnumName(VoteResult_name, int32(x))
}

func (VoteResult) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_9c297f0764c47d40, []int{0}
}

// Slash records the storage provider slashes, which will be pruned periodically.
type Slash struct {
	// The slashed storage provider.
	SpId uint32 `protobuf:"varint,1,opt,name=sp_id,json=spId,proto3" json:"sp_id,omitempty"`
	// The slashed object info.
	ObjectId Uint `protobuf:"bytes,2,opt,name=object_id,json=objectId,proto3,customtype=Uint" json:"object_id"`
	// The height when the slash happened, which is used for prune purpose.
	Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
}

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

var xxx_messageInfo_Slash proto.InternalMessageInfo

func (m *Slash) GetSpId() uint32 {
	if m != nil {
		return m.SpId
	}
	return 0
}

func (m *Slash) GetHeight() uint64 {
	if m != nil {
		return m.Height
	}
	return 0
}

// Challenge records the challenge which are not expired yet.
type Challenge struct {
	// The id of the challenge.
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// The height at which the challenge will be expired.
	ExpiredHeight uint64 `protobuf:"varint,2,opt,name=expired_height,json=expiredHeight,proto3" json:"expired_height,omitempty"`
}

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

var xxx_messageInfo_Challenge proto.InternalMessageInfo

func (m *Challenge) GetId() uint64 {
	if m != nil {
		return m.Id
	}
	return 0
}

func (m *Challenge) GetExpiredHeight() uint64 {
	if m != nil {
		return m.ExpiredHeight
	}
	return 0
}

// AttestedChallenge records the challenge which are attested.
type AttestedChallenge struct {
	// The id of the challenge.
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// The attestation result of the challenge.
	Result VoteResult `protobuf:"varint,2,opt,name=result,proto3,enum=greenfield.challenge.VoteResult" json:"result,omitempty"`
}

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

var xxx_messageInfo_AttestedChallenge proto.InternalMessageInfo

func (m *AttestedChallenge) GetId() uint64 {
	if m != nil {
		return m.Id
	}
	return 0
}

func (m *AttestedChallenge) GetResult() VoteResult {
	if m != nil {
		return m.Result
	}
	return CHALLENGE_FAILED
}

// AttestedChallengeIds stored fixed number of the latest attested challenge ids.
// To use the storage more efficiently, a circular queue will be constructed using these fields.
type AttestedChallengeIds struct {
	// The fixed number of challenge ids to save.
	Size_ uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
	// The latest attested challenges.
	Challenges []*AttestedChallenge `protobuf:"bytes,2,rep,name=challenges,proto3" json:"challenges,omitempty"`
	// The cursor to retrieve data from the ids field.
	Cursor int64 `protobuf:"varint,3,opt,name=cursor,proto3" json:"cursor,omitempty"`
}

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

var xxx_messageInfo_AttestedChallengeIds proto.InternalMessageInfo

func (m *AttestedChallengeIds) GetSize_() uint64 {
	if m != nil {
		return m.Size_
	}
	return 0
}

func (m *AttestedChallengeIds) GetChallenges() []*AttestedChallenge {
	if m != nil {
		return m.Challenges
	}
	return nil
}

func (m *AttestedChallengeIds) GetCursor() int64 {
	if m != nil {
		return m.Cursor
	}
	return 0
}

func init() {
	proto.RegisterEnum("greenfield.challenge.VoteResult", VoteResult_name, VoteResult_value)
	proto.RegisterType((*Slash)(nil), "greenfield.challenge.Slash")
	proto.RegisterType((*Challenge)(nil), "greenfield.challenge.Challenge")
	proto.RegisterType((*AttestedChallenge)(nil), "greenfield.challenge.AttestedChallenge")
	proto.RegisterType((*AttestedChallengeIds)(nil), "greenfield.challenge.AttestedChallengeIds")
}

func init() { proto.RegisterFile("greenfield/challenge/types.proto", fileDescriptor_9c297f0764c47d40) }

var fileDescriptor_9c297f0764c47d40 = []byte{
	// 436 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x6a, 0xdb, 0x40,
	0x10, 0xd5, 0xca, 0x8a, 0xa9, 0x27, 0xc4, 0x38, 0x5b, 0xb7, 0xb8, 0x2e, 0x28, 0xc2, 0x50, 0x6a,
	0x0a, 0x91, 0x68, 0x7a, 0xc9, 0xad, 0xd8, 0x8e, 0x9a, 0x98, 0x9a, 0x1e, 0x36, 0xa4, 0x87, 0x42,
	0x11, 0x96, 0x76, 0x2b, 0x6d, 0x51, 0xb4, 0x42, 0xbb, 0x86, 0xb4, 0x5f, 0x50, 0xe8, 0xa5, 0xff,
	0xd0, 0x5f, 0xe8, 0x47, 0xe4, 0x18, 0x7a, 0x2a, 0x3d, 0x84, 0x62, 0xff, 0x48, 0x91, 0xb4, 0x8d,
	0x43, 0x93, 0xdc, 0xe6, 0xbd, 0x79, 0xf3, 0xde, 0x30, 0x0c, 0x38, 0x71, 0xc1, 0x58, 0xf6, 0x81,
	0xb3, 0x94, 0x7a, 0x51, 0x32, 0x4f, 0x53, 0x96, 0xc5, 0xcc, 0x53, 0x9f, 0x72, 0x26, 0xdd, 0xbc,
	0x10, 0x4a, 0xe0, 0xee, 0x5a, 0xe1, 0x5e, 0x29, 0xfa, 0x8f, 0x22, 0x21, 0x4f, 0x85, 0x0c, 0x2a,
	0x8d, 0x57, 0x83, 0x7a, 0xa0, 0xdf, 0x8d, 0x45, 0x2c, 0x6a, 0xbe, 0xac, 0x6a, 0x76, 0x90, 0xc1,
	0xc6, 0x71, 0x3a, 0x97, 0x09, 0xbe, 0x0f, 0x1b, 0x32, 0x0f, 0x38, 0xed, 0x21, 0x07, 0x0d, 0xb7,
	0x88, 0x25, 0xf3, 0x29, 0xc5, 0xfb, 0xd0, 0x12, 0xe1, 0x47, 0x16, 0xa9, 0xb2, 0x61, 0x3a, 0x68,
	0xd8, 0x1a, 0x3f, 0x3e, 0xbf, 0xdc, 0x31, 0x7e, 0x5f, 0xee, 0x58, 0x27, 0x3c, 0x53, 0x3f, 0x7f,
	0xec, 0x6e, 0xea, 0x90, 0x12, 0x92, 0x7b, 0xb5, 0x7a, 0x4a, 0xf1, 0x43, 0x68, 0x26, 0x8c, 0xc7,
	0x89, 0xea, 0x35, 0x1c, 0x34, 0xb4, 0x88, 0x46, 0x83, 0x31, 0xb4, 0x26, 0xff, 0xb6, 0xc5, 0x6d,
	0x30, 0x75, 0xa0, 0x45, 0x4c, 0x4e, 0xf1, 0x13, 0x68, 0xb3, 0xb3, 0x9c, 0x17, 0x8c, 0x06, 0x7a,
	0xd8, 0xac, 0x7a, 0x5b, 0x9a, 0x3d, 0xaa, 0x3d, 0xde, 0xc3, 0xf6, 0x48, 0x29, 0x26, 0x15, 0xa3,
	0x77, 0x7b, 0xed, 0x43, 0xb3, 0x60, 0x72, 0x91, 0xd6, 0x1e, 0xed, 0x3d, 0xc7, 0xbd, 0xed, 0x60,
	0xee, 0x5b, 0xa1, 0x18, 0xa9, 0x74, 0x44, 0xeb, 0x07, 0x5f, 0x11, 0x74, 0x6f, 0xf8, 0x4f, 0xa9,
	0xc4, 0x18, 0x2c, 0xc9, 0x3f, 0x33, 0x1d, 0x52, 0xd5, 0xf8, 0x10, 0xe0, 0xca, 0x4c, 0xf6, 0x4c,
	0xa7, 0x31, 0xdc, 0xdc, 0x7b, 0x7a, 0x7b, 0xd4, 0x0d, 0x4f, 0x72, 0x6d, 0xb4, 0x3c, 0x58, 0xb4,
	0x28, 0xa4, 0x28, 0xaa, 0x83, 0x35, 0x88, 0x46, 0xcf, 0x5e, 0x02, 0xac, 0x77, 0xc4, 0x5d, 0xe8,
	0x4c, 0x8e, 0x46, 0xb3, 0x99, 0xff, 0xe6, 0xd0, 0x0f, 0x5e, 0x8d, 0xa6, 0x33, 0xff, 0xa0, 0x63,
	0xe0, 0x07, 0xb0, 0xbd, 0x66, 0x8f, 0x4f, 0x26, 0x13, 0xdf, 0x3f, 0xe8, 0xa0, 0xbe, 0xf5, 0xe5,
	0xbb, 0x6d, 0x8c, 0x5f, 0x9f, 0x2f, 0x6d, 0x74, 0xb1, 0xb4, 0xd1, 0x9f, 0xa5, 0x8d, 0xbe, 0xad,
	0x6c, 0xe3, 0x62, 0x65, 0x1b, 0xbf, 0x56, 0xb6, 0xf1, 0xee, 0x79, 0xcc, 0x55, 0xb2, 0x08, 0xdd,
	0x48, 0x9c, 0x7a, 0x61, 0x16, 0xee, 0x46, 0xc9, 0x9c, 0x67, 0xde, 0xb5, 0xcf, 0x3b, 0xfb, 0xff,
	0xf7, 0xc2, 0x66, 0xf5, 0x35, 0x2f, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x68, 0xaf, 0x39, 0x21,
	0xa0, 0x02, 0x00, 0x00,
}

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

func (m *Slash) 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] = 0x18
	}
	{
		size := m.ObjectId.Size()
		i -= size
		if _, err := m.ObjectId.MarshalTo(dAtA[i:]); err != nil {
			return 0, err
		}
		i = encodeVarintTypes(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x12
	if m.SpId != 0 {
		i = encodeVarintTypes(dAtA, i, uint64(m.SpId))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

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

func (m *Challenge) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.ExpiredHeight != 0 {
		i = encodeVarintTypes(dAtA, i, uint64(m.ExpiredHeight))
		i--
		dAtA[i] = 0x10
	}
	if m.Id != 0 {
		i = encodeVarintTypes(dAtA, i, uint64(m.Id))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

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

func (m *AttestedChallenge) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Result != 0 {
		i = encodeVarintTypes(dAtA, i, uint64(m.Result))
		i--
		dAtA[i] = 0x10
	}
	if m.Id != 0 {
		i = encodeVarintTypes(dAtA, i, uint64(m.Id))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

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

func (m *AttestedChallengeIds) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Cursor != 0 {
		i = encodeVarintTypes(dAtA, i, uint64(m.Cursor))
		i--
		dAtA[i] = 0x18
	}
	if len(m.Challenges) > 0 {
		for iNdEx := len(m.Challenges) - 1; iNdEx >= 0; iNdEx-- {
			{
				size, err := m.Challenges[iNdEx].MarshalToSizedBuffer(dAtA[:i])
				if err != nil {
					return 0, err
				}
				i -= size
				i = encodeVarintTypes(dAtA, i, uint64(size))
			}
			i--
			dAtA[i] = 0x12
		}
	}
	if m.Size_ != 0 {
		i = encodeVarintTypes(dAtA, i, uint64(m.Size_))
		i--
		dAtA[i] = 0x8
	}
	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 *Slash) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.SpId != 0 {
		n += 1 + sovTypes(uint64(m.SpId))
	}
	l = m.ObjectId.Size()
	n += 1 + l + sovTypes(uint64(l))
	if m.Height != 0 {
		n += 1 + sovTypes(uint64(m.Height))
	}
	return n
}

func (m *Challenge) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Id != 0 {
		n += 1 + sovTypes(uint64(m.Id))
	}
	if m.ExpiredHeight != 0 {
		n += 1 + sovTypes(uint64(m.ExpiredHeight))
	}
	return n
}

func (m *AttestedChallenge) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Id != 0 {
		n += 1 + sovTypes(uint64(m.Id))
	}
	if m.Result != 0 {
		n += 1 + sovTypes(uint64(m.Result))
	}
	return n
}

func (m *AttestedChallengeIds) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Size_ != 0 {
		n += 1 + sovTypes(uint64(m.Size_))
	}
	if len(m.Challenges) > 0 {
		for _, e := range m.Challenges {
			l = e.Size()
			n += 1 + l + sovTypes(uint64(l))
		}
	}
	if m.Cursor != 0 {
		n += 1 + sovTypes(uint64(m.Cursor))
	}
	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 *Slash) 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: Slash: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Slash: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SpId", wireType)
			}
			m.SpId = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTypes
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.SpId |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ObjectId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTypes
				}
				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 ErrInvalidLengthTypes
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthTypes
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.ObjectId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			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 |= uint64(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 *Challenge) 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: Challenge: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Challenge: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
			}
			m.Id = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTypes
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Id |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ExpiredHeight", wireType)
			}
			m.ExpiredHeight = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTypes
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ExpiredHeight |= uint64(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 *AttestedChallenge) 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: AttestedChallenge: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: AttestedChallenge: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
			}
			m.Id = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTypes
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Id |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType)
			}
			m.Result = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTypes
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Result |= VoteResult(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 *AttestedChallengeIds) 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: AttestedChallengeIds: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: AttestedChallengeIds: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
			}
			m.Size_ = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTypes
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Size_ |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Challenges", 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
			}
			m.Challenges = append(m.Challenges, &AttestedChallenge{})
			if err := m.Challenges[len(m.Challenges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Cursor", wireType)
			}
			m.Cursor = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTypes
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Cursor |= 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 skipTypes(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, ErrIntOverflowTypes
			}
			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, ErrIntOverflowTypes
				}
				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, ErrIntOverflowTypes
				}
				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, ErrInvalidLengthTypes
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupTypes
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthTypes
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
