github.com/cosmos/cosmos-sdk@v0.50.10/x/gov/types/v1/genesis.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/gov/v1/genesis.proto 3 4 package v1 5 6 import ( 7 fmt "fmt" 8 proto "github.com/cosmos/gogoproto/proto" 9 io "io" 10 math "math" 11 math_bits "math/bits" 12 ) 13 14 // Reference imports to suppress errors if they are not otherwise used. 15 var _ = proto.Marshal 16 var _ = fmt.Errorf 17 var _ = math.Inf 18 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the proto package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // proto package needs to be updated. 23 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 24 25 // GenesisState defines the gov module's genesis state. 26 type GenesisState struct { 27 // starting_proposal_id is the ID of the starting proposal. 28 StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty"` 29 // deposits defines all the deposits present at genesis. 30 Deposits []*Deposit `protobuf:"bytes,2,rep,name=deposits,proto3" json:"deposits,omitempty"` 31 // votes defines all the votes present at genesis. 32 Votes []*Vote `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` 33 // proposals defines all the proposals present at genesis. 34 Proposals []*Proposal `protobuf:"bytes,4,rep,name=proposals,proto3" json:"proposals,omitempty"` 35 // Deprecated: Prefer to use `params` instead. 36 // deposit_params defines all the paramaters of related to deposit. 37 DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` // Deprecated: Do not use. 38 // Deprecated: Prefer to use `params` instead. 39 // voting_params defines all the paramaters of related to voting. 40 VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` // Deprecated: Do not use. 41 // Deprecated: Prefer to use `params` instead. 42 // tally_params defines all the paramaters of related to tally. 43 TallyParams *TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` // Deprecated: Do not use. 44 // params defines all the paramaters of x/gov module. 45 // 46 // Since: cosmos-sdk 0.47 47 Params *Params `protobuf:"bytes,8,opt,name=params,proto3" json:"params,omitempty"` 48 // The constitution allows builders to lay a foundation and define purpose. 49 // This is an immutable string set in genesis. 50 // There are no amendments, to go outside of scope, just fork. 51 // constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. 52 // 53 // Since: cosmos-sdk 0.50 54 Constitution string `protobuf:"bytes,9,opt,name=constitution,proto3" json:"constitution,omitempty"` 55 } 56 57 func (m *GenesisState) Reset() { *m = GenesisState{} } 58 func (m *GenesisState) String() string { return proto.CompactTextString(m) } 59 func (*GenesisState) ProtoMessage() {} 60 func (*GenesisState) Descriptor() ([]byte, []int) { 61 return fileDescriptor_ef7cfd15e3ded621, []int{0} 62 } 63 func (m *GenesisState) XXX_Unmarshal(b []byte) error { 64 return m.Unmarshal(b) 65 } 66 func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 67 if deterministic { 68 return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) 69 } else { 70 b = b[:cap(b)] 71 n, err := m.MarshalToSizedBuffer(b) 72 if err != nil { 73 return nil, err 74 } 75 return b[:n], nil 76 } 77 } 78 func (m *GenesisState) XXX_Merge(src proto.Message) { 79 xxx_messageInfo_GenesisState.Merge(m, src) 80 } 81 func (m *GenesisState) XXX_Size() int { 82 return m.Size() 83 } 84 func (m *GenesisState) XXX_DiscardUnknown() { 85 xxx_messageInfo_GenesisState.DiscardUnknown(m) 86 } 87 88 var xxx_messageInfo_GenesisState proto.InternalMessageInfo 89 90 func (m *GenesisState) GetStartingProposalId() uint64 { 91 if m != nil { 92 return m.StartingProposalId 93 } 94 return 0 95 } 96 97 func (m *GenesisState) GetDeposits() []*Deposit { 98 if m != nil { 99 return m.Deposits 100 } 101 return nil 102 } 103 104 func (m *GenesisState) GetVotes() []*Vote { 105 if m != nil { 106 return m.Votes 107 } 108 return nil 109 } 110 111 func (m *GenesisState) GetProposals() []*Proposal { 112 if m != nil { 113 return m.Proposals 114 } 115 return nil 116 } 117 118 // Deprecated: Do not use. 119 func (m *GenesisState) GetDepositParams() *DepositParams { 120 if m != nil { 121 return m.DepositParams 122 } 123 return nil 124 } 125 126 // Deprecated: Do not use. 127 func (m *GenesisState) GetVotingParams() *VotingParams { 128 if m != nil { 129 return m.VotingParams 130 } 131 return nil 132 } 133 134 // Deprecated: Do not use. 135 func (m *GenesisState) GetTallyParams() *TallyParams { 136 if m != nil { 137 return m.TallyParams 138 } 139 return nil 140 } 141 142 func (m *GenesisState) GetParams() *Params { 143 if m != nil { 144 return m.Params 145 } 146 return nil 147 } 148 149 func (m *GenesisState) GetConstitution() string { 150 if m != nil { 151 return m.Constitution 152 } 153 return "" 154 } 155 156 func init() { 157 proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1.GenesisState") 158 } 159 160 func init() { proto.RegisterFile("cosmos/gov/v1/genesis.proto", fileDescriptor_ef7cfd15e3ded621) } 161 162 var fileDescriptor_ef7cfd15e3ded621 = []byte{ 163 // 379 bytes of a gzipped FileDescriptorProto 164 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x4e, 0xfa, 0x40, 165 0x14, 0xc5, 0x19, 0xbe, 0xfe, 0x30, 0x94, 0xff, 0x62, 0xfc, 0xa0, 0x01, 0xd3, 0x34, 0xac, 0x6a, 166 0x0c, 0xad, 0x60, 0x7c, 0x00, 0x09, 0x86, 0xb8, 0x23, 0xd5, 0xb8, 0x70, 0x43, 0x0a, 0x6d, 0x6a, 167 0x23, 0xf4, 0x36, 0x9d, 0x61, 0x22, 0x6f, 0xe1, 0x63, 0xb9, 0x64, 0xe9, 0xd2, 0xc0, 0x63, 0xb8, 168 0x31, 0xcc, 0xb4, 0x02, 0xd5, 0xd5, 0x24, 0xf7, 0xfc, 0xce, 0x99, 0x93, 0x9b, 0x8b, 0x5b, 0x53, 169 0xa0, 0x73, 0xa0, 0x96, 0x0f, 0xdc, 0xe2, 0x5d, 0xcb, 0xf7, 0x42, 0x8f, 0x06, 0xd4, 0x8c, 0x62, 170 0x60, 0x40, 0xea, 0x52, 0x34, 0x7d, 0xe0, 0x26, 0xef, 0x36, 0x1b, 0x19, 0x16, 0xb8, 0xe4, 0xda, 171 0x5f, 0x05, 0xac, 0x0c, 0xa5, 0xf3, 0x9e, 0x39, 0xcc, 0x23, 0x97, 0xf8, 0x98, 0x32, 0x27, 0x66, 172 0x41, 0xe8, 0x8f, 0xa3, 0x18, 0x22, 0xa0, 0xce, 0x6c, 0x1c, 0xb8, 0x2a, 0xd2, 0x91, 0x51, 0xb4, 173 0x49, 0xaa, 0x8d, 0x12, 0xe9, 0xce, 0x25, 0x3d, 0x5c, 0x71, 0xbd, 0x08, 0x68, 0xc0, 0xa8, 0x9a, 174 0xd7, 0x0b, 0x46, 0xad, 0x77, 0x6a, 0x1e, 0xfc, 0x6e, 0x0e, 0xa4, 0x6c, 0xff, 0x70, 0xe4, 0x1c, 175 0x97, 0x38, 0x30, 0x8f, 0xaa, 0x05, 0x61, 0x38, 0xca, 0x18, 0x1e, 0x81, 0x79, 0xb6, 0x24, 0xc8, 176 0x35, 0xae, 0xa6, 0x3d, 0xa8, 0x5a, 0x14, 0x78, 0x23, 0x83, 0xa7, 0x65, 0xec, 0x1d, 0x49, 0x86, 177 0xf8, 0x7f, 0xf2, 0xdb, 0x38, 0x72, 0x62, 0x67, 0x4e, 0xd5, 0x92, 0x8e, 0x8c, 0x5a, 0xef, 0xec, 178 0xef, 0x6e, 0x23, 0xc1, 0xf4, 0xf3, 0x2a, 0xb2, 0xeb, 0xee, 0xfe, 0x88, 0x0c, 0x70, 0x9d, 0x83, 179 0x5c, 0x87, 0xcc, 0x29, 0x8b, 0x9c, 0xd6, 0xef, 0xca, 0xdb, 0xb5, 0xec, 0x62, 0x14, 0xbe, 0x37, 180 0x21, 0x37, 0x58, 0x61, 0xce, 0x6c, 0xb6, 0x4c, 0x43, 0xfe, 0x89, 0x90, 0x66, 0x26, 0xe4, 0x61, 181 0x8b, 0xec, 0x65, 0xd4, 0xd8, 0x6e, 0x40, 0x3a, 0xb8, 0x9c, 0x98, 0x2b, 0xc2, 0x7c, 0x92, 0xdd, 182 0x82, 0x10, 0xed, 0x04, 0x22, 0x6d, 0xac, 0x4c, 0x21, 0xa4, 0x2c, 0x60, 0x0b, 0x16, 0x40, 0xa8, 183 0x56, 0x75, 0x64, 0x54, 0xed, 0x83, 0x59, 0xff, 0xf6, 0x7d, 0xad, 0xa1, 0xd5, 0x5a, 0x43, 0x9f, 184 0x6b, 0x0d, 0xbd, 0x6d, 0xb4, 0xdc, 0x6a, 0xa3, 0xe5, 0x3e, 0x36, 0x5a, 0xee, 0xe9, 0xc2, 0x0f, 185 0xd8, 0xf3, 0x62, 0x62, 0x4e, 0x61, 0x6e, 0x25, 0xb7, 0x23, 0x9f, 0x0e, 0x75, 0x5f, 0xac, 0x57, 186 0x71, 0x48, 0x6c, 0x19, 0x79, 0xd4, 0xe2, 0xdd, 0x49, 0x59, 0xdc, 0xd2, 0xd5, 0x77, 0x00, 0x00, 187 0x00, 0xff, 0xff, 0x1b, 0x69, 0x07, 0x35, 0x92, 0x02, 0x00, 0x00, 188 } 189 190 func (m *GenesisState) Marshal() (dAtA []byte, err error) { 191 size := m.Size() 192 dAtA = make([]byte, size) 193 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 194 if err != nil { 195 return nil, err 196 } 197 return dAtA[:n], nil 198 } 199 200 func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { 201 size := m.Size() 202 return m.MarshalToSizedBuffer(dAtA[:size]) 203 } 204 205 func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { 206 i := len(dAtA) 207 _ = i 208 var l int 209 _ = l 210 if len(m.Constitution) > 0 { 211 i -= len(m.Constitution) 212 copy(dAtA[i:], m.Constitution) 213 i = encodeVarintGenesis(dAtA, i, uint64(len(m.Constitution))) 214 i-- 215 dAtA[i] = 0x4a 216 } 217 if m.Params != nil { 218 { 219 size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) 220 if err != nil { 221 return 0, err 222 } 223 i -= size 224 i = encodeVarintGenesis(dAtA, i, uint64(size)) 225 } 226 i-- 227 dAtA[i] = 0x42 228 } 229 if m.TallyParams != nil { 230 { 231 size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) 232 if err != nil { 233 return 0, err 234 } 235 i -= size 236 i = encodeVarintGenesis(dAtA, i, uint64(size)) 237 } 238 i-- 239 dAtA[i] = 0x3a 240 } 241 if m.VotingParams != nil { 242 { 243 size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) 244 if err != nil { 245 return 0, err 246 } 247 i -= size 248 i = encodeVarintGenesis(dAtA, i, uint64(size)) 249 } 250 i-- 251 dAtA[i] = 0x32 252 } 253 if m.DepositParams != nil { 254 { 255 size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) 256 if err != nil { 257 return 0, err 258 } 259 i -= size 260 i = encodeVarintGenesis(dAtA, i, uint64(size)) 261 } 262 i-- 263 dAtA[i] = 0x2a 264 } 265 if len(m.Proposals) > 0 { 266 for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { 267 { 268 size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 269 if err != nil { 270 return 0, err 271 } 272 i -= size 273 i = encodeVarintGenesis(dAtA, i, uint64(size)) 274 } 275 i-- 276 dAtA[i] = 0x22 277 } 278 } 279 if len(m.Votes) > 0 { 280 for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { 281 { 282 size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 283 if err != nil { 284 return 0, err 285 } 286 i -= size 287 i = encodeVarintGenesis(dAtA, i, uint64(size)) 288 } 289 i-- 290 dAtA[i] = 0x1a 291 } 292 } 293 if len(m.Deposits) > 0 { 294 for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { 295 { 296 size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 297 if err != nil { 298 return 0, err 299 } 300 i -= size 301 i = encodeVarintGenesis(dAtA, i, uint64(size)) 302 } 303 i-- 304 dAtA[i] = 0x12 305 } 306 } 307 if m.StartingProposalId != 0 { 308 i = encodeVarintGenesis(dAtA, i, uint64(m.StartingProposalId)) 309 i-- 310 dAtA[i] = 0x8 311 } 312 return len(dAtA) - i, nil 313 } 314 315 func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { 316 offset -= sovGenesis(v) 317 base := offset 318 for v >= 1<<7 { 319 dAtA[offset] = uint8(v&0x7f | 0x80) 320 v >>= 7 321 offset++ 322 } 323 dAtA[offset] = uint8(v) 324 return base 325 } 326 func (m *GenesisState) Size() (n int) { 327 if m == nil { 328 return 0 329 } 330 var l int 331 _ = l 332 if m.StartingProposalId != 0 { 333 n += 1 + sovGenesis(uint64(m.StartingProposalId)) 334 } 335 if len(m.Deposits) > 0 { 336 for _, e := range m.Deposits { 337 l = e.Size() 338 n += 1 + l + sovGenesis(uint64(l)) 339 } 340 } 341 if len(m.Votes) > 0 { 342 for _, e := range m.Votes { 343 l = e.Size() 344 n += 1 + l + sovGenesis(uint64(l)) 345 } 346 } 347 if len(m.Proposals) > 0 { 348 for _, e := range m.Proposals { 349 l = e.Size() 350 n += 1 + l + sovGenesis(uint64(l)) 351 } 352 } 353 if m.DepositParams != nil { 354 l = m.DepositParams.Size() 355 n += 1 + l + sovGenesis(uint64(l)) 356 } 357 if m.VotingParams != nil { 358 l = m.VotingParams.Size() 359 n += 1 + l + sovGenesis(uint64(l)) 360 } 361 if m.TallyParams != nil { 362 l = m.TallyParams.Size() 363 n += 1 + l + sovGenesis(uint64(l)) 364 } 365 if m.Params != nil { 366 l = m.Params.Size() 367 n += 1 + l + sovGenesis(uint64(l)) 368 } 369 l = len(m.Constitution) 370 if l > 0 { 371 n += 1 + l + sovGenesis(uint64(l)) 372 } 373 return n 374 } 375 376 func sovGenesis(x uint64) (n int) { 377 return (math_bits.Len64(x|1) + 6) / 7 378 } 379 func sozGenesis(x uint64) (n int) { 380 return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 381 } 382 func (m *GenesisState) Unmarshal(dAtA []byte) error { 383 l := len(dAtA) 384 iNdEx := 0 385 for iNdEx < l { 386 preIndex := iNdEx 387 var wire uint64 388 for shift := uint(0); ; shift += 7 { 389 if shift >= 64 { 390 return ErrIntOverflowGenesis 391 } 392 if iNdEx >= l { 393 return io.ErrUnexpectedEOF 394 } 395 b := dAtA[iNdEx] 396 iNdEx++ 397 wire |= uint64(b&0x7F) << shift 398 if b < 0x80 { 399 break 400 } 401 } 402 fieldNum := int32(wire >> 3) 403 wireType := int(wire & 0x7) 404 if wireType == 4 { 405 return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") 406 } 407 if fieldNum <= 0 { 408 return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) 409 } 410 switch fieldNum { 411 case 1: 412 if wireType != 0 { 413 return fmt.Errorf("proto: wrong wireType = %d for field StartingProposalId", wireType) 414 } 415 m.StartingProposalId = 0 416 for shift := uint(0); ; shift += 7 { 417 if shift >= 64 { 418 return ErrIntOverflowGenesis 419 } 420 if iNdEx >= l { 421 return io.ErrUnexpectedEOF 422 } 423 b := dAtA[iNdEx] 424 iNdEx++ 425 m.StartingProposalId |= uint64(b&0x7F) << shift 426 if b < 0x80 { 427 break 428 } 429 } 430 case 2: 431 if wireType != 2 { 432 return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) 433 } 434 var msglen int 435 for shift := uint(0); ; shift += 7 { 436 if shift >= 64 { 437 return ErrIntOverflowGenesis 438 } 439 if iNdEx >= l { 440 return io.ErrUnexpectedEOF 441 } 442 b := dAtA[iNdEx] 443 iNdEx++ 444 msglen |= int(b&0x7F) << shift 445 if b < 0x80 { 446 break 447 } 448 } 449 if msglen < 0 { 450 return ErrInvalidLengthGenesis 451 } 452 postIndex := iNdEx + msglen 453 if postIndex < 0 { 454 return ErrInvalidLengthGenesis 455 } 456 if postIndex > l { 457 return io.ErrUnexpectedEOF 458 } 459 m.Deposits = append(m.Deposits, &Deposit{}) 460 if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 461 return err 462 } 463 iNdEx = postIndex 464 case 3: 465 if wireType != 2 { 466 return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) 467 } 468 var msglen int 469 for shift := uint(0); ; shift += 7 { 470 if shift >= 64 { 471 return ErrIntOverflowGenesis 472 } 473 if iNdEx >= l { 474 return io.ErrUnexpectedEOF 475 } 476 b := dAtA[iNdEx] 477 iNdEx++ 478 msglen |= int(b&0x7F) << shift 479 if b < 0x80 { 480 break 481 } 482 } 483 if msglen < 0 { 484 return ErrInvalidLengthGenesis 485 } 486 postIndex := iNdEx + msglen 487 if postIndex < 0 { 488 return ErrInvalidLengthGenesis 489 } 490 if postIndex > l { 491 return io.ErrUnexpectedEOF 492 } 493 m.Votes = append(m.Votes, &Vote{}) 494 if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 495 return err 496 } 497 iNdEx = postIndex 498 case 4: 499 if wireType != 2 { 500 return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) 501 } 502 var msglen int 503 for shift := uint(0); ; shift += 7 { 504 if shift >= 64 { 505 return ErrIntOverflowGenesis 506 } 507 if iNdEx >= l { 508 return io.ErrUnexpectedEOF 509 } 510 b := dAtA[iNdEx] 511 iNdEx++ 512 msglen |= int(b&0x7F) << shift 513 if b < 0x80 { 514 break 515 } 516 } 517 if msglen < 0 { 518 return ErrInvalidLengthGenesis 519 } 520 postIndex := iNdEx + msglen 521 if postIndex < 0 { 522 return ErrInvalidLengthGenesis 523 } 524 if postIndex > l { 525 return io.ErrUnexpectedEOF 526 } 527 m.Proposals = append(m.Proposals, &Proposal{}) 528 if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 529 return err 530 } 531 iNdEx = postIndex 532 case 5: 533 if wireType != 2 { 534 return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", 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 m.DepositParams == nil { 562 m.DepositParams = &DepositParams{} 563 } 564 if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 565 return err 566 } 567 iNdEx = postIndex 568 case 6: 569 if wireType != 2 { 570 return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) 571 } 572 var msglen int 573 for shift := uint(0); ; shift += 7 { 574 if shift >= 64 { 575 return ErrIntOverflowGenesis 576 } 577 if iNdEx >= l { 578 return io.ErrUnexpectedEOF 579 } 580 b := dAtA[iNdEx] 581 iNdEx++ 582 msglen |= int(b&0x7F) << shift 583 if b < 0x80 { 584 break 585 } 586 } 587 if msglen < 0 { 588 return ErrInvalidLengthGenesis 589 } 590 postIndex := iNdEx + msglen 591 if postIndex < 0 { 592 return ErrInvalidLengthGenesis 593 } 594 if postIndex > l { 595 return io.ErrUnexpectedEOF 596 } 597 if m.VotingParams == nil { 598 m.VotingParams = &VotingParams{} 599 } 600 if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 601 return err 602 } 603 iNdEx = postIndex 604 case 7: 605 if wireType != 2 { 606 return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) 607 } 608 var msglen int 609 for shift := uint(0); ; shift += 7 { 610 if shift >= 64 { 611 return ErrIntOverflowGenesis 612 } 613 if iNdEx >= l { 614 return io.ErrUnexpectedEOF 615 } 616 b := dAtA[iNdEx] 617 iNdEx++ 618 msglen |= int(b&0x7F) << shift 619 if b < 0x80 { 620 break 621 } 622 } 623 if msglen < 0 { 624 return ErrInvalidLengthGenesis 625 } 626 postIndex := iNdEx + msglen 627 if postIndex < 0 { 628 return ErrInvalidLengthGenesis 629 } 630 if postIndex > l { 631 return io.ErrUnexpectedEOF 632 } 633 if m.TallyParams == nil { 634 m.TallyParams = &TallyParams{} 635 } 636 if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 637 return err 638 } 639 iNdEx = postIndex 640 case 8: 641 if wireType != 2 { 642 return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) 643 } 644 var msglen int 645 for shift := uint(0); ; shift += 7 { 646 if shift >= 64 { 647 return ErrIntOverflowGenesis 648 } 649 if iNdEx >= l { 650 return io.ErrUnexpectedEOF 651 } 652 b := dAtA[iNdEx] 653 iNdEx++ 654 msglen |= int(b&0x7F) << shift 655 if b < 0x80 { 656 break 657 } 658 } 659 if msglen < 0 { 660 return ErrInvalidLengthGenesis 661 } 662 postIndex := iNdEx + msglen 663 if postIndex < 0 { 664 return ErrInvalidLengthGenesis 665 } 666 if postIndex > l { 667 return io.ErrUnexpectedEOF 668 } 669 if m.Params == nil { 670 m.Params = &Params{} 671 } 672 if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 673 return err 674 } 675 iNdEx = postIndex 676 case 9: 677 if wireType != 2 { 678 return fmt.Errorf("proto: wrong wireType = %d for field Constitution", wireType) 679 } 680 var stringLen uint64 681 for shift := uint(0); ; shift += 7 { 682 if shift >= 64 { 683 return ErrIntOverflowGenesis 684 } 685 if iNdEx >= l { 686 return io.ErrUnexpectedEOF 687 } 688 b := dAtA[iNdEx] 689 iNdEx++ 690 stringLen |= uint64(b&0x7F) << shift 691 if b < 0x80 { 692 break 693 } 694 } 695 intStringLen := int(stringLen) 696 if intStringLen < 0 { 697 return ErrInvalidLengthGenesis 698 } 699 postIndex := iNdEx + intStringLen 700 if postIndex < 0 { 701 return ErrInvalidLengthGenesis 702 } 703 if postIndex > l { 704 return io.ErrUnexpectedEOF 705 } 706 m.Constitution = string(dAtA[iNdEx:postIndex]) 707 iNdEx = postIndex 708 default: 709 iNdEx = preIndex 710 skippy, err := skipGenesis(dAtA[iNdEx:]) 711 if err != nil { 712 return err 713 } 714 if (skippy < 0) || (iNdEx+skippy) < 0 { 715 return ErrInvalidLengthGenesis 716 } 717 if (iNdEx + skippy) > l { 718 return io.ErrUnexpectedEOF 719 } 720 iNdEx += skippy 721 } 722 } 723 724 if iNdEx > l { 725 return io.ErrUnexpectedEOF 726 } 727 return nil 728 } 729 func skipGenesis(dAtA []byte) (n int, err error) { 730 l := len(dAtA) 731 iNdEx := 0 732 depth := 0 733 for iNdEx < l { 734 var wire uint64 735 for shift := uint(0); ; shift += 7 { 736 if shift >= 64 { 737 return 0, ErrIntOverflowGenesis 738 } 739 if iNdEx >= l { 740 return 0, io.ErrUnexpectedEOF 741 } 742 b := dAtA[iNdEx] 743 iNdEx++ 744 wire |= (uint64(b) & 0x7F) << shift 745 if b < 0x80 { 746 break 747 } 748 } 749 wireType := int(wire & 0x7) 750 switch wireType { 751 case 0: 752 for shift := uint(0); ; shift += 7 { 753 if shift >= 64 { 754 return 0, ErrIntOverflowGenesis 755 } 756 if iNdEx >= l { 757 return 0, io.ErrUnexpectedEOF 758 } 759 iNdEx++ 760 if dAtA[iNdEx-1] < 0x80 { 761 break 762 } 763 } 764 case 1: 765 iNdEx += 8 766 case 2: 767 var length int 768 for shift := uint(0); ; shift += 7 { 769 if shift >= 64 { 770 return 0, ErrIntOverflowGenesis 771 } 772 if iNdEx >= l { 773 return 0, io.ErrUnexpectedEOF 774 } 775 b := dAtA[iNdEx] 776 iNdEx++ 777 length |= (int(b) & 0x7F) << shift 778 if b < 0x80 { 779 break 780 } 781 } 782 if length < 0 { 783 return 0, ErrInvalidLengthGenesis 784 } 785 iNdEx += length 786 case 3: 787 depth++ 788 case 4: 789 if depth == 0 { 790 return 0, ErrUnexpectedEndOfGroupGenesis 791 } 792 depth-- 793 case 5: 794 iNdEx += 4 795 default: 796 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 797 } 798 if iNdEx < 0 { 799 return 0, ErrInvalidLengthGenesis 800 } 801 if depth == 0 { 802 return iNdEx, nil 803 } 804 } 805 return 0, io.ErrUnexpectedEOF 806 } 807 808 var ( 809 ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") 810 ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") 811 ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") 812 )