github.com/cosmos/cosmos-sdk@v0.50.10/x/gov/types/v1beta1/genesis.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: cosmos/gov/v1beta1/genesis.proto
     3  
     4  package v1beta1
     5  
     6  import (
     7  	fmt "fmt"
     8  	_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
     9  	_ "github.com/cosmos/gogoproto/gogoproto"
    10  	proto "github.com/cosmos/gogoproto/proto"
    11  	io "io"
    12  	math "math"
    13  	math_bits "math/bits"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    26  
    27  // GenesisState defines the gov module's genesis state.
    28  type GenesisState struct {
    29  	// starting_proposal_id is the ID of the starting proposal.
    30  	StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty"`
    31  	// deposits defines all the deposits present at genesis.
    32  	Deposits Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"`
    33  	// votes defines all the votes present at genesis.
    34  	Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"`
    35  	// proposals defines all the proposals present at genesis.
    36  	Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"`
    37  	// deposit_params defines all the parameters related to deposit.
    38  	DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"`
    39  	// voting_params defines all the parameters related to voting.
    40  	VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"`
    41  	// tally_params defines all the parameters related to tally.
    42  	TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"`
    43  }
    44  
    45  func (m *GenesisState) Reset()         { *m = GenesisState{} }
    46  func (m *GenesisState) String() string { return proto.CompactTextString(m) }
    47  func (*GenesisState) ProtoMessage()    {}
    48  func (*GenesisState) Descriptor() ([]byte, []int) {
    49  	return fileDescriptor_43cd825e0fa7a627, []int{0}
    50  }
    51  func (m *GenesisState) XXX_Unmarshal(b []byte) error {
    52  	return m.Unmarshal(b)
    53  }
    54  func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    55  	if deterministic {
    56  		return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic)
    57  	} else {
    58  		b = b[:cap(b)]
    59  		n, err := m.MarshalToSizedBuffer(b)
    60  		if err != nil {
    61  			return nil, err
    62  		}
    63  		return b[:n], nil
    64  	}
    65  }
    66  func (m *GenesisState) XXX_Merge(src proto.Message) {
    67  	xxx_messageInfo_GenesisState.Merge(m, src)
    68  }
    69  func (m *GenesisState) XXX_Size() int {
    70  	return m.Size()
    71  }
    72  func (m *GenesisState) XXX_DiscardUnknown() {
    73  	xxx_messageInfo_GenesisState.DiscardUnknown(m)
    74  }
    75  
    76  var xxx_messageInfo_GenesisState proto.InternalMessageInfo
    77  
    78  func (m *GenesisState) GetStartingProposalId() uint64 {
    79  	if m != nil {
    80  		return m.StartingProposalId
    81  	}
    82  	return 0
    83  }
    84  
    85  func (m *GenesisState) GetDeposits() Deposits {
    86  	if m != nil {
    87  		return m.Deposits
    88  	}
    89  	return nil
    90  }
    91  
    92  func (m *GenesisState) GetVotes() Votes {
    93  	if m != nil {
    94  		return m.Votes
    95  	}
    96  	return nil
    97  }
    98  
    99  func (m *GenesisState) GetProposals() Proposals {
   100  	if m != nil {
   101  		return m.Proposals
   102  	}
   103  	return nil
   104  }
   105  
   106  func (m *GenesisState) GetDepositParams() DepositParams {
   107  	if m != nil {
   108  		return m.DepositParams
   109  	}
   110  	return DepositParams{}
   111  }
   112  
   113  func (m *GenesisState) GetVotingParams() VotingParams {
   114  	if m != nil {
   115  		return m.VotingParams
   116  	}
   117  	return VotingParams{}
   118  }
   119  
   120  func (m *GenesisState) GetTallyParams() TallyParams {
   121  	if m != nil {
   122  		return m.TallyParams
   123  	}
   124  	return TallyParams{}
   125  }
   126  
   127  func init() {
   128  	proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1beta1.GenesisState")
   129  }
   130  
   131  func init() { proto.RegisterFile("cosmos/gov/v1beta1/genesis.proto", fileDescriptor_43cd825e0fa7a627) }
   132  
   133  var fileDescriptor_43cd825e0fa7a627 = []byte{
   134  	// 409 bytes of a gzipped FileDescriptorProto
   135  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0xd2, 0x4d, 0x6e, 0xda, 0x40,
   136  	0x14, 0x07, 0x70, 0xbb, 0x7c, 0x14, 0x06, 0xa8, 0xd4, 0x11, 0xad, 0x2c, 0x8a, 0x8c, 0xdb, 0x15,
   137  	0xaa, 0x54, 0x1b, 0xe8, 0x0d, 0xac, 0x4a, 0x55, 0x2b, 0x25, 0x42, 0x10, 0x65, 0x91, 0x0d, 0x1a,
   138  	0xf0, 0xc8, 0xb1, 0x82, 0x79, 0x96, 0x67, 0x62, 0x85, 0x5b, 0xe4, 0x04, 0x59, 0x47, 0x59, 0xe5,
   139  	0x18, 0x2c, 0x59, 0x66, 0x95, 0x44, 0xb0, 0xc8, 0x35, 0x22, 0xcf, 0x8c, 0x13, 0x24, 0x9c, 0x6c,
   140  	0xfc, 0xf1, 0xde, 0xdf, 0x3f, 0xcf, 0x8c, 0x1e, 0xb2, 0x66, 0xc0, 0x42, 0x60, 0x8e, 0x0f, 0x89,
   141  	0x93, 0xf4, 0xa7, 0x94, 0x93, 0xbe, 0xe3, 0xd3, 0x05, 0x65, 0x01, 0xb3, 0xa3, 0x18, 0x38, 0x60,
   142  	0x2c, 0x13, 0xb6, 0x0f, 0x89, 0xad, 0x12, 0xad, 0xa6, 0x0f, 0x3e, 0x88, 0xb6, 0x93, 0x3e, 0xc9,
   143  	0x64, 0xab, 0x9d, 0x67, 0x41, 0xa2, 0xba, 0x9f, 0x49, 0x18, 0x2c, 0xc0, 0x11, 0x57, 0x59, 0xfa,
   144  	0x71, 0x55, 0x44, 0xf5, 0xbf, 0xf2, 0x67, 0x63, 0x4e, 0x38, 0xc5, 0x3d, 0xd4, 0x64, 0x9c, 0xc4,
   145  	0x3c, 0x58, 0xf8, 0x93, 0x28, 0x86, 0x08, 0x18, 0x99, 0x4f, 0x02, 0xcf, 0xd0, 0x2d, 0xbd, 0x5b,
   146  	0x1c, 0xe1, 0xac, 0x37, 0x54, 0xad, 0x7f, 0x1e, 0x3e, 0x44, 0x15, 0x8f, 0x46, 0xc0, 0x02, 0xce,
   147  	0x8c, 0x0f, 0x56, 0xa1, 0x5b, 0x1b, 0x7c, 0xb3, 0xf7, 0x17, 0x6c, 0xff, 0x91, 0x19, 0xf7, 0xcb,
   148  	0xea, 0xbe, 0xa3, 0xdd, 0x3c, 0x74, 0x2a, 0xaa, 0xc0, 0xae, 0x9f, 0x6e, 0x7f, 0xea, 0xa3, 0x17,
   149  	0x03, 0xbb, 0xa8, 0x94, 0x00, 0xa7, 0xcc, 0x28, 0x08, 0xcc, 0xc8, 0xc3, 0x8e, 0x81, 0x53, 0x17,
   150  	0x2b, 0xa9, 0x94, 0xbe, 0x29, 0x46, 0x7e, 0x8a, 0x47, 0xa8, 0x9a, 0x2d, 0x9e, 0x19, 0x45, 0xe1,
   151  	0xb4, 0xf3, 0x9c, 0x6c, 0x1b, 0xee, 0x57, 0x65, 0x55, 0xb3, 0x8a, 0xf2, 0x5e, 0x19, 0x3c, 0x46,
   152  	0x9f, 0xd4, 0x1a, 0x27, 0x11, 0x89, 0x49, 0xc8, 0x8c, 0x92, 0xa5, 0x77, 0x6b, 0x83, 0xef, 0xef,
   153  	0xec, 0x76, 0x28, 0x82, 0x6e, 0x35, 0xd5, 0x25, 0xd8, 0xf0, 0x76, 0x3b, 0x78, 0x88, 0x1a, 0x09,
   154  	0xc8, 0xc3, 0x96, 0x66, 0x59, 0x98, 0xd6, 0x1b, 0x9b, 0x4e, 0x4f, 0x7e, 0x8f, 0xac, 0x27, 0x3b,
   155  	0x0d, 0x7c, 0x80, 0xea, 0x9c, 0xcc, 0xe7, 0xcb, 0x0c, 0xfc, 0x28, 0xc0, 0x4e, 0x1e, 0x78, 0x94,
   156  	0xe6, 0xf6, 0xbd, 0x1a, 0xdf, 0xa9, 0xff, 0x5f, 0x6d, 0x4c, 0x7d, 0xbd, 0x31, 0xf5, 0xc7, 0x8d,
   157  	0xa9, 0x5f, 0x6e, 0x4d, 0x6d, 0xbd, 0x35, 0xb5, 0xbb, 0xad, 0xa9, 0x9d, 0xf4, 0xfc, 0x80, 0x9f,
   158  	0x9e, 0x4f, 0xed, 0x19, 0x84, 0x8e, 0x1a, 0x3b, 0x79, 0xfb, 0xc5, 0xbc, 0x33, 0xe7, 0x42, 0xcc,
   159  	0x20, 0x5f, 0x46, 0x94, 0x65, 0x93, 0x38, 0x2d, 0x8b, 0x99, 0xfb, 0xfd, 0x1c, 0x00, 0x00, 0xff,
   160  	0xff, 0xcb, 0x8b, 0x44, 0x6f, 0xf2, 0x02, 0x00, 0x00,
   161  }
   162  
   163  func (m *GenesisState) Marshal() (dAtA []byte, err error) {
   164  	size := m.Size()
   165  	dAtA = make([]byte, size)
   166  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   167  	if err != nil {
   168  		return nil, err
   169  	}
   170  	return dAtA[:n], nil
   171  }
   172  
   173  func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) {
   174  	size := m.Size()
   175  	return m.MarshalToSizedBuffer(dAtA[:size])
   176  }
   177  
   178  func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   179  	i := len(dAtA)
   180  	_ = i
   181  	var l int
   182  	_ = l
   183  	{
   184  		size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i])
   185  		if err != nil {
   186  			return 0, err
   187  		}
   188  		i -= size
   189  		i = encodeVarintGenesis(dAtA, i, uint64(size))
   190  	}
   191  	i--
   192  	dAtA[i] = 0x3a
   193  	{
   194  		size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i])
   195  		if err != nil {
   196  			return 0, err
   197  		}
   198  		i -= size
   199  		i = encodeVarintGenesis(dAtA, i, uint64(size))
   200  	}
   201  	i--
   202  	dAtA[i] = 0x32
   203  	{
   204  		size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i])
   205  		if err != nil {
   206  			return 0, err
   207  		}
   208  		i -= size
   209  		i = encodeVarintGenesis(dAtA, i, uint64(size))
   210  	}
   211  	i--
   212  	dAtA[i] = 0x2a
   213  	if len(m.Proposals) > 0 {
   214  		for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- {
   215  			{
   216  				size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   217  				if err != nil {
   218  					return 0, err
   219  				}
   220  				i -= size
   221  				i = encodeVarintGenesis(dAtA, i, uint64(size))
   222  			}
   223  			i--
   224  			dAtA[i] = 0x22
   225  		}
   226  	}
   227  	if len(m.Votes) > 0 {
   228  		for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- {
   229  			{
   230  				size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   231  				if err != nil {
   232  					return 0, err
   233  				}
   234  				i -= size
   235  				i = encodeVarintGenesis(dAtA, i, uint64(size))
   236  			}
   237  			i--
   238  			dAtA[i] = 0x1a
   239  		}
   240  	}
   241  	if len(m.Deposits) > 0 {
   242  		for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- {
   243  			{
   244  				size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   245  				if err != nil {
   246  					return 0, err
   247  				}
   248  				i -= size
   249  				i = encodeVarintGenesis(dAtA, i, uint64(size))
   250  			}
   251  			i--
   252  			dAtA[i] = 0x12
   253  		}
   254  	}
   255  	if m.StartingProposalId != 0 {
   256  		i = encodeVarintGenesis(dAtA, i, uint64(m.StartingProposalId))
   257  		i--
   258  		dAtA[i] = 0x8
   259  	}
   260  	return len(dAtA) - i, nil
   261  }
   262  
   263  func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
   264  	offset -= sovGenesis(v)
   265  	base := offset
   266  	for v >= 1<<7 {
   267  		dAtA[offset] = uint8(v&0x7f | 0x80)
   268  		v >>= 7
   269  		offset++
   270  	}
   271  	dAtA[offset] = uint8(v)
   272  	return base
   273  }
   274  func (m *GenesisState) Size() (n int) {
   275  	if m == nil {
   276  		return 0
   277  	}
   278  	var l int
   279  	_ = l
   280  	if m.StartingProposalId != 0 {
   281  		n += 1 + sovGenesis(uint64(m.StartingProposalId))
   282  	}
   283  	if len(m.Deposits) > 0 {
   284  		for _, e := range m.Deposits {
   285  			l = e.Size()
   286  			n += 1 + l + sovGenesis(uint64(l))
   287  		}
   288  	}
   289  	if len(m.Votes) > 0 {
   290  		for _, e := range m.Votes {
   291  			l = e.Size()
   292  			n += 1 + l + sovGenesis(uint64(l))
   293  		}
   294  	}
   295  	if len(m.Proposals) > 0 {
   296  		for _, e := range m.Proposals {
   297  			l = e.Size()
   298  			n += 1 + l + sovGenesis(uint64(l))
   299  		}
   300  	}
   301  	l = m.DepositParams.Size()
   302  	n += 1 + l + sovGenesis(uint64(l))
   303  	l = m.VotingParams.Size()
   304  	n += 1 + l + sovGenesis(uint64(l))
   305  	l = m.TallyParams.Size()
   306  	n += 1 + l + sovGenesis(uint64(l))
   307  	return n
   308  }
   309  
   310  func sovGenesis(x uint64) (n int) {
   311  	return (math_bits.Len64(x|1) + 6) / 7
   312  }
   313  func sozGenesis(x uint64) (n int) {
   314  	return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   315  }
   316  func (m *GenesisState) Unmarshal(dAtA []byte) error {
   317  	l := len(dAtA)
   318  	iNdEx := 0
   319  	for iNdEx < l {
   320  		preIndex := iNdEx
   321  		var wire uint64
   322  		for shift := uint(0); ; shift += 7 {
   323  			if shift >= 64 {
   324  				return ErrIntOverflowGenesis
   325  			}
   326  			if iNdEx >= l {
   327  				return io.ErrUnexpectedEOF
   328  			}
   329  			b := dAtA[iNdEx]
   330  			iNdEx++
   331  			wire |= uint64(b&0x7F) << shift
   332  			if b < 0x80 {
   333  				break
   334  			}
   335  		}
   336  		fieldNum := int32(wire >> 3)
   337  		wireType := int(wire & 0x7)
   338  		if wireType == 4 {
   339  			return fmt.Errorf("proto: GenesisState: wiretype end group for non-group")
   340  		}
   341  		if fieldNum <= 0 {
   342  			return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
   343  		}
   344  		switch fieldNum {
   345  		case 1:
   346  			if wireType != 0 {
   347  				return fmt.Errorf("proto: wrong wireType = %d for field StartingProposalId", wireType)
   348  			}
   349  			m.StartingProposalId = 0
   350  			for shift := uint(0); ; shift += 7 {
   351  				if shift >= 64 {
   352  					return ErrIntOverflowGenesis
   353  				}
   354  				if iNdEx >= l {
   355  					return io.ErrUnexpectedEOF
   356  				}
   357  				b := dAtA[iNdEx]
   358  				iNdEx++
   359  				m.StartingProposalId |= uint64(b&0x7F) << shift
   360  				if b < 0x80 {
   361  					break
   362  				}
   363  			}
   364  		case 2:
   365  			if wireType != 2 {
   366  				return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType)
   367  			}
   368  			var msglen int
   369  			for shift := uint(0); ; shift += 7 {
   370  				if shift >= 64 {
   371  					return ErrIntOverflowGenesis
   372  				}
   373  				if iNdEx >= l {
   374  					return io.ErrUnexpectedEOF
   375  				}
   376  				b := dAtA[iNdEx]
   377  				iNdEx++
   378  				msglen |= int(b&0x7F) << shift
   379  				if b < 0x80 {
   380  					break
   381  				}
   382  			}
   383  			if msglen < 0 {
   384  				return ErrInvalidLengthGenesis
   385  			}
   386  			postIndex := iNdEx + msglen
   387  			if postIndex < 0 {
   388  				return ErrInvalidLengthGenesis
   389  			}
   390  			if postIndex > l {
   391  				return io.ErrUnexpectedEOF
   392  			}
   393  			m.Deposits = append(m.Deposits, Deposit{})
   394  			if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   395  				return err
   396  			}
   397  			iNdEx = postIndex
   398  		case 3:
   399  			if wireType != 2 {
   400  				return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType)
   401  			}
   402  			var msglen int
   403  			for shift := uint(0); ; shift += 7 {
   404  				if shift >= 64 {
   405  					return ErrIntOverflowGenesis
   406  				}
   407  				if iNdEx >= l {
   408  					return io.ErrUnexpectedEOF
   409  				}
   410  				b := dAtA[iNdEx]
   411  				iNdEx++
   412  				msglen |= int(b&0x7F) << shift
   413  				if b < 0x80 {
   414  					break
   415  				}
   416  			}
   417  			if msglen < 0 {
   418  				return ErrInvalidLengthGenesis
   419  			}
   420  			postIndex := iNdEx + msglen
   421  			if postIndex < 0 {
   422  				return ErrInvalidLengthGenesis
   423  			}
   424  			if postIndex > l {
   425  				return io.ErrUnexpectedEOF
   426  			}
   427  			m.Votes = append(m.Votes, Vote{})
   428  			if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   429  				return err
   430  			}
   431  			iNdEx = postIndex
   432  		case 4:
   433  			if wireType != 2 {
   434  				return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType)
   435  			}
   436  			var msglen int
   437  			for shift := uint(0); ; shift += 7 {
   438  				if shift >= 64 {
   439  					return ErrIntOverflowGenesis
   440  				}
   441  				if iNdEx >= l {
   442  					return io.ErrUnexpectedEOF
   443  				}
   444  				b := dAtA[iNdEx]
   445  				iNdEx++
   446  				msglen |= int(b&0x7F) << shift
   447  				if b < 0x80 {
   448  					break
   449  				}
   450  			}
   451  			if msglen < 0 {
   452  				return ErrInvalidLengthGenesis
   453  			}
   454  			postIndex := iNdEx + msglen
   455  			if postIndex < 0 {
   456  				return ErrInvalidLengthGenesis
   457  			}
   458  			if postIndex > l {
   459  				return io.ErrUnexpectedEOF
   460  			}
   461  			m.Proposals = append(m.Proposals, Proposal{})
   462  			if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   463  				return err
   464  			}
   465  			iNdEx = postIndex
   466  		case 5:
   467  			if wireType != 2 {
   468  				return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType)
   469  			}
   470  			var msglen int
   471  			for shift := uint(0); ; shift += 7 {
   472  				if shift >= 64 {
   473  					return ErrIntOverflowGenesis
   474  				}
   475  				if iNdEx >= l {
   476  					return io.ErrUnexpectedEOF
   477  				}
   478  				b := dAtA[iNdEx]
   479  				iNdEx++
   480  				msglen |= int(b&0x7F) << shift
   481  				if b < 0x80 {
   482  					break
   483  				}
   484  			}
   485  			if msglen < 0 {
   486  				return ErrInvalidLengthGenesis
   487  			}
   488  			postIndex := iNdEx + msglen
   489  			if postIndex < 0 {
   490  				return ErrInvalidLengthGenesis
   491  			}
   492  			if postIndex > l {
   493  				return io.ErrUnexpectedEOF
   494  			}
   495  			if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   496  				return err
   497  			}
   498  			iNdEx = postIndex
   499  		case 6:
   500  			if wireType != 2 {
   501  				return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType)
   502  			}
   503  			var msglen int
   504  			for shift := uint(0); ; shift += 7 {
   505  				if shift >= 64 {
   506  					return ErrIntOverflowGenesis
   507  				}
   508  				if iNdEx >= l {
   509  					return io.ErrUnexpectedEOF
   510  				}
   511  				b := dAtA[iNdEx]
   512  				iNdEx++
   513  				msglen |= int(b&0x7F) << shift
   514  				if b < 0x80 {
   515  					break
   516  				}
   517  			}
   518  			if msglen < 0 {
   519  				return ErrInvalidLengthGenesis
   520  			}
   521  			postIndex := iNdEx + msglen
   522  			if postIndex < 0 {
   523  				return ErrInvalidLengthGenesis
   524  			}
   525  			if postIndex > l {
   526  				return io.ErrUnexpectedEOF
   527  			}
   528  			if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   529  				return err
   530  			}
   531  			iNdEx = postIndex
   532  		case 7:
   533  			if wireType != 2 {
   534  				return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType)
   535  			}
   536  			var msglen int
   537  			for shift := uint(0); ; shift += 7 {
   538  				if shift >= 64 {
   539  					return ErrIntOverflowGenesis
   540  				}
   541  				if iNdEx >= l {
   542  					return io.ErrUnexpectedEOF
   543  				}
   544  				b := dAtA[iNdEx]
   545  				iNdEx++
   546  				msglen |= int(b&0x7F) << shift
   547  				if b < 0x80 {
   548  					break
   549  				}
   550  			}
   551  			if msglen < 0 {
   552  				return ErrInvalidLengthGenesis
   553  			}
   554  			postIndex := iNdEx + msglen
   555  			if postIndex < 0 {
   556  				return ErrInvalidLengthGenesis
   557  			}
   558  			if postIndex > l {
   559  				return io.ErrUnexpectedEOF
   560  			}
   561  			if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   562  				return err
   563  			}
   564  			iNdEx = postIndex
   565  		default:
   566  			iNdEx = preIndex
   567  			skippy, err := skipGenesis(dAtA[iNdEx:])
   568  			if err != nil {
   569  				return err
   570  			}
   571  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   572  				return ErrInvalidLengthGenesis
   573  			}
   574  			if (iNdEx + skippy) > l {
   575  				return io.ErrUnexpectedEOF
   576  			}
   577  			iNdEx += skippy
   578  		}
   579  	}
   580  
   581  	if iNdEx > l {
   582  		return io.ErrUnexpectedEOF
   583  	}
   584  	return nil
   585  }
   586  func skipGenesis(dAtA []byte) (n int, err error) {
   587  	l := len(dAtA)
   588  	iNdEx := 0
   589  	depth := 0
   590  	for iNdEx < l {
   591  		var wire uint64
   592  		for shift := uint(0); ; shift += 7 {
   593  			if shift >= 64 {
   594  				return 0, ErrIntOverflowGenesis
   595  			}
   596  			if iNdEx >= l {
   597  				return 0, io.ErrUnexpectedEOF
   598  			}
   599  			b := dAtA[iNdEx]
   600  			iNdEx++
   601  			wire |= (uint64(b) & 0x7F) << shift
   602  			if b < 0x80 {
   603  				break
   604  			}
   605  		}
   606  		wireType := int(wire & 0x7)
   607  		switch wireType {
   608  		case 0:
   609  			for shift := uint(0); ; shift += 7 {
   610  				if shift >= 64 {
   611  					return 0, ErrIntOverflowGenesis
   612  				}
   613  				if iNdEx >= l {
   614  					return 0, io.ErrUnexpectedEOF
   615  				}
   616  				iNdEx++
   617  				if dAtA[iNdEx-1] < 0x80 {
   618  					break
   619  				}
   620  			}
   621  		case 1:
   622  			iNdEx += 8
   623  		case 2:
   624  			var length int
   625  			for shift := uint(0); ; shift += 7 {
   626  				if shift >= 64 {
   627  					return 0, ErrIntOverflowGenesis
   628  				}
   629  				if iNdEx >= l {
   630  					return 0, io.ErrUnexpectedEOF
   631  				}
   632  				b := dAtA[iNdEx]
   633  				iNdEx++
   634  				length |= (int(b) & 0x7F) << shift
   635  				if b < 0x80 {
   636  					break
   637  				}
   638  			}
   639  			if length < 0 {
   640  				return 0, ErrInvalidLengthGenesis
   641  			}
   642  			iNdEx += length
   643  		case 3:
   644  			depth++
   645  		case 4:
   646  			if depth == 0 {
   647  				return 0, ErrUnexpectedEndOfGroupGenesis
   648  			}
   649  			depth--
   650  		case 5:
   651  			iNdEx += 4
   652  		default:
   653  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   654  		}
   655  		if iNdEx < 0 {
   656  			return 0, ErrInvalidLengthGenesis
   657  		}
   658  		if depth == 0 {
   659  			return iNdEx, nil
   660  		}
   661  	}
   662  	return 0, io.ErrUnexpectedEOF
   663  }
   664  
   665  var (
   666  	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
   667  	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
   668  	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
   669  )