// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: cosmos/staking/v1beta1/genesis.proto package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/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 // GenesisState defines the staking module's genesis state. type GenesisState struct { // params defines all the paramaters of related to deposit. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. LastTotalPower github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=last_total_power,json=lastTotalPower,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"last_total_power"` // last_validator_powers is a special index that provides a historical list // of the last-block's bonded validators. LastValidatorPowers []LastValidatorPower `protobuf:"bytes,3,rep,name=last_validator_powers,json=lastValidatorPowers,proto3" json:"last_validator_powers"` // delegations defines the validator set at genesis. Validators []Validator `protobuf:"bytes,4,rep,name=validators,proto3" json:"validators"` // delegations defines the delegations active at genesis. Delegations []Delegation `protobuf:"bytes,5,rep,name=delegations,proto3" json:"delegations"` // unbonding_delegations defines the unbonding delegations active at genesis. UnbondingDelegations []UnbondingDelegation `protobuf:"bytes,6,rep,name=unbonding_delegations,json=unbondingDelegations,proto3" json:"unbonding_delegations"` // redelegations defines the redelegations active at genesis. Redelegations []Redelegation `protobuf:"bytes,7,rep,name=redelegations,proto3" json:"redelegations"` Exported bool `protobuf:"varint,8,opt,name=exported,proto3" json:"exported,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { return fileDescriptor_9b3dec8894f2831b, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { xxx_messageInfo_GenesisState.Merge(m, src) } func (m *GenesisState) XXX_Size() int { return m.Size() } func (m *GenesisState) XXX_DiscardUnknown() { xxx_messageInfo_GenesisState.DiscardUnknown(m) } var xxx_messageInfo_GenesisState proto.InternalMessageInfo func (m *GenesisState) GetParams() Params { if m != nil { return m.Params } return Params{} } func (m *GenesisState) GetLastValidatorPowers() []LastValidatorPower { if m != nil { return m.LastValidatorPowers } return nil } func (m *GenesisState) GetValidators() []Validator { if m != nil { return m.Validators } return nil } func (m *GenesisState) GetDelegations() []Delegation { if m != nil { return m.Delegations } return nil } func (m *GenesisState) GetUnbondingDelegations() []UnbondingDelegation { if m != nil { return m.UnbondingDelegations } return nil } func (m *GenesisState) GetRedelegations() []Redelegation { if m != nil { return m.Redelegations } return nil } func (m *GenesisState) GetExported() bool { if m != nil { return m.Exported } return false } // LastValidatorPower required for validator set update logic. type LastValidatorPower struct { // address is the address of the validator. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // power defines the power of the validator. Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` } func (m *LastValidatorPower) Reset() { *m = LastValidatorPower{} } func (m *LastValidatorPower) String() string { return proto.CompactTextString(m) } func (*LastValidatorPower) ProtoMessage() {} func (*LastValidatorPower) Descriptor() ([]byte, []int) { return fileDescriptor_9b3dec8894f2831b, []int{1} } func (m *LastValidatorPower) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *LastValidatorPower) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LastValidatorPower.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 *LastValidatorPower) XXX_Merge(src proto.Message) { xxx_messageInfo_LastValidatorPower.Merge(m, src) } func (m *LastValidatorPower) XXX_Size() int { return m.Size() } func (m *LastValidatorPower) XXX_DiscardUnknown() { xxx_messageInfo_LastValidatorPower.DiscardUnknown(m) } var xxx_messageInfo_LastValidatorPower proto.InternalMessageInfo func init() { proto.RegisterType((*GenesisState)(nil), "cosmos.staking.v1beta1.GenesisState") proto.RegisterType((*LastValidatorPower)(nil), "cosmos.staking.v1beta1.LastValidatorPower") } func init() { proto.RegisterFile("cosmos/staking/v1beta1/genesis.proto", fileDescriptor_9b3dec8894f2831b) } var fileDescriptor_9b3dec8894f2831b = []byte{ // 483 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x41, 0x6e, 0xd3, 0x40, 0x14, 0x86, 0x6d, 0x92, 0xa6, 0x61, 0x52, 0x10, 0x1a, 0x52, 0x64, 0xb2, 0x70, 0x42, 0x54, 0xa1, 0x08, 0xa8, 0xad, 0x86, 0x1d, 0x62, 0x43, 0x84, 0xa8, 0x40, 0x2c, 0x22, 0x17, 0x10, 0x62, 0x13, 0x4d, 0xea, 0xc1, 0xb5, 0xea, 0x78, 0xac, 0x79, 0x2f, 0xa5, 0xdc, 0x80, 0x25, 0x47, 0xe8, 0x21, 0x38, 0x44, 0x97, 0x15, 0x2b, 0xc4, 0xa2, 0x42, 0xc9, 0x86, 0x1b, 0xb0, 0x45, 0x9e, 0x99, 0x18, 0xa3, 0x60, 0x56, 0xc9, 0xe8, 0x7d, 0xff, 0x37, 0xbf, 0xe4, 0x37, 0x64, 0xe7, 0x50, 0xc0,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56, 0x6a, 0x2d, 0xa7, 0x0d, 0xf5, 0x64, 0x1e, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x73, 0xbd, 0x93, 0xb3, 0xc9, 0x03, 0x00, 0x00, } func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Exported { i-- if m.Exported { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x40 } if len(m.Redelegations) > 0 { for iNdEx := len(m.Redelegations) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Redelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a } } if len(m.UnbondingDelegations) > 0 { for iNdEx := len(m.UnbondingDelegations) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.UnbondingDelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x32 } } if len(m.Delegations) > 0 { for iNdEx := len(m.Delegations) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Delegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } } if len(m.Validators) > 0 { for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } } if len(m.LastValidatorPowers) > 0 { for iNdEx := len(m.LastValidatorPowers) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.LastValidatorPowers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } { size := m.LastTotalPower.Size() i -= size if _, err := m.LastTotalPower.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa return len(dAtA) - i, nil } func (m *LastValidatorPower) 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 *LastValidatorPower) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *LastValidatorPower) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Power != 0 { i = encodeVarintGenesis(dAtA, i, uint64(m.Power)) i-- dAtA[i] = 0x10 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *GenesisState) Size() (n int) { if m == nil { return 0 } var l int _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) l = m.LastTotalPower.Size() n += 1 + l + sovGenesis(uint64(l)) if len(m.LastValidatorPowers) > 0 { for _, e := range m.LastValidatorPowers { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } if len(m.Validators) > 0 { for _, e := range m.Validators { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } if len(m.Delegations) > 0 { for _, e := range m.Delegations { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } if len(m.UnbondingDelegations) > 0 { for _, e := range m.UnbondingDelegations { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } if len(m.Redelegations) > 0 { for _, e := range m.Redelegations { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } if m.Exported { n += 2 } return n } func (m *LastValidatorPower) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Address) if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } if m.Power != 0 { n += 1 + sovGenesis(uint64(m.Power)) } return n } func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozGenesis(x uint64) (n int) { return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *GenesisState) 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 ErrIntOverflowGenesis } 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: GenesisState: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenesis } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastTotalPower", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthGenesis } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } if err := m.LastTotalPower.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastValidatorPowers", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenesis } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } m.LastValidatorPowers = append(m.LastValidatorPowers, LastValidatorPower{}) if err := m.LastValidatorPowers[len(m.LastValidatorPowers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenesis } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } m.Validators = append(m.Validators, Validator{}) if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Delegations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenesis } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } m.Delegations = append(m.Delegations, Delegation{}) if err := m.Delegations[len(m.Delegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UnbondingDelegations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenesis } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } m.UnbondingDelegations = append(m.UnbondingDelegations, UnbondingDelegation{}) if err := m.UnbondingDelegations[len(m.UnbondingDelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Redelegations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenesis } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } m.Redelegations = append(m.Redelegations, Redelegation{}) if err := m.Redelegations[len(m.Redelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Exported", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Exported = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LastValidatorPower) 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 ErrIntOverflowGenesis } 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: LastValidatorPower: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LastValidatorPower: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } 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 ErrInvalidLengthGenesis } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) } m.Power = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Power |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipGenesis(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, ErrIntOverflowGenesis } 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, ErrIntOverflowGenesis } 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, ErrIntOverflowGenesis } 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, ErrInvalidLengthGenesis } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupGenesis } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthGenesis } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )