github.com/Finschia/finschia-sdk@v0.48.1/x/bank/types/genesis.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/bank/v1beta1/genesis.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 github_com_Finschia_finschia_sdk_types "github.com/Finschia/finschia-sdk/types" 9 types "github.com/Finschia/finschia-sdk/types" 10 _ "github.com/gogo/protobuf/gogoproto" 11 proto "github.com/gogo/protobuf/proto" 12 io "io" 13 math "math" 14 math_bits "math/bits" 15 ) 16 17 // Reference imports to suppress errors if they are not otherwise used. 18 var _ = proto.Marshal 19 var _ = fmt.Errorf 20 var _ = math.Inf 21 22 // This is a compile-time assertion to ensure that this generated file 23 // is compatible with the proto package it is being compiled against. 24 // A compilation error at this line likely means your copy of the 25 // proto package needs to be updated. 26 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 27 28 // GenesisState defines the bank module's genesis state. 29 type GenesisState struct { 30 // params defines all the paramaters of the module. 31 Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` 32 // balances is an array containing the balances of all the accounts. 33 Balances []Balance `protobuf:"bytes,2,rep,name=balances,proto3" json:"balances"` 34 // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided 35 // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. 36 Supply github_com_Finschia_finschia_sdk_types.Coins `protobuf:"bytes,3,rep,name=supply,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coins" json:"supply"` 37 // denom_metadata defines the metadata of the differents coins. 38 DenomMetadata []Metadata `protobuf:"bytes,4,rep,name=denom_metadata,json=denomMetadata,proto3" json:"denom_metadata" yaml:"denom_metadata"` 39 } 40 41 func (m *GenesisState) Reset() { *m = GenesisState{} } 42 func (m *GenesisState) String() string { return proto.CompactTextString(m) } 43 func (*GenesisState) ProtoMessage() {} 44 func (*GenesisState) Descriptor() ([]byte, []int) { 45 return fileDescriptor_8f007de11b420c6e, []int{0} 46 } 47 func (m *GenesisState) XXX_Unmarshal(b []byte) error { 48 return m.Unmarshal(b) 49 } 50 func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 51 if deterministic { 52 return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) 53 } else { 54 b = b[:cap(b)] 55 n, err := m.MarshalToSizedBuffer(b) 56 if err != nil { 57 return nil, err 58 } 59 return b[:n], nil 60 } 61 } 62 func (m *GenesisState) XXX_Merge(src proto.Message) { 63 xxx_messageInfo_GenesisState.Merge(m, src) 64 } 65 func (m *GenesisState) XXX_Size() int { 66 return m.Size() 67 } 68 func (m *GenesisState) XXX_DiscardUnknown() { 69 xxx_messageInfo_GenesisState.DiscardUnknown(m) 70 } 71 72 var xxx_messageInfo_GenesisState proto.InternalMessageInfo 73 74 func (m *GenesisState) GetParams() Params { 75 if m != nil { 76 return m.Params 77 } 78 return Params{} 79 } 80 81 func (m *GenesisState) GetBalances() []Balance { 82 if m != nil { 83 return m.Balances 84 } 85 return nil 86 } 87 88 func (m *GenesisState) GetSupply() github_com_Finschia_finschia_sdk_types.Coins { 89 if m != nil { 90 return m.Supply 91 } 92 return nil 93 } 94 95 func (m *GenesisState) GetDenomMetadata() []Metadata { 96 if m != nil { 97 return m.DenomMetadata 98 } 99 return nil 100 } 101 102 // Balance defines an account address and balance pair used in the bank module's 103 // genesis state. 104 type Balance struct { 105 // address is the address of the balance holder. 106 Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` 107 // coins defines the different coins this balance holds. 108 Coins github_com_Finschia_finschia_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coins" json:"coins"` 109 } 110 111 func (m *Balance) Reset() { *m = Balance{} } 112 func (m *Balance) String() string { return proto.CompactTextString(m) } 113 func (*Balance) ProtoMessage() {} 114 func (*Balance) Descriptor() ([]byte, []int) { 115 return fileDescriptor_8f007de11b420c6e, []int{1} 116 } 117 func (m *Balance) XXX_Unmarshal(b []byte) error { 118 return m.Unmarshal(b) 119 } 120 func (m *Balance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 121 if deterministic { 122 return xxx_messageInfo_Balance.Marshal(b, m, deterministic) 123 } else { 124 b = b[:cap(b)] 125 n, err := m.MarshalToSizedBuffer(b) 126 if err != nil { 127 return nil, err 128 } 129 return b[:n], nil 130 } 131 } 132 func (m *Balance) XXX_Merge(src proto.Message) { 133 xxx_messageInfo_Balance.Merge(m, src) 134 } 135 func (m *Balance) XXX_Size() int { 136 return m.Size() 137 } 138 func (m *Balance) XXX_DiscardUnknown() { 139 xxx_messageInfo_Balance.DiscardUnknown(m) 140 } 141 142 var xxx_messageInfo_Balance proto.InternalMessageInfo 143 144 func init() { 145 proto.RegisterType((*GenesisState)(nil), "cosmos.bank.v1beta1.GenesisState") 146 proto.RegisterType((*Balance)(nil), "cosmos.bank.v1beta1.Balance") 147 } 148 149 func init() { proto.RegisterFile("cosmos/bank/v1beta1/genesis.proto", fileDescriptor_8f007de11b420c6e) } 150 151 var fileDescriptor_8f007de11b420c6e = []byte{ 152 // 391 bytes of a gzipped FileDescriptorProto 153 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x3f, 0x4f, 0xc2, 0x40, 154 0x18, 0x87, 0x5b, 0x40, 0xc0, 0x43, 0x1d, 0xaa, 0x26, 0x15, 0xa5, 0xc5, 0x4e, 0x0c, 0xd2, 0x06, 155 0x74, 0x91, 0xc1, 0xa1, 0x26, 0x32, 0x99, 0x98, 0xba, 0xb9, 0x98, 0x6b, 0x7b, 0x96, 0x06, 0xda, 156 0x6b, 0xb8, 0xc3, 0xc8, 0x37, 0x70, 0x74, 0xf0, 0x03, 0x30, 0xfb, 0x49, 0x18, 0xd9, 0x74, 0x42, 157 0x03, 0x8b, 0xb3, 0x9f, 0xc0, 0xf4, 0x7a, 0x54, 0x8d, 0x24, 0x2e, 0x6e, 0xd7, 0xbe, 0xbf, 0xe7, 158 0x79, 0xef, 0xcf, 0x0b, 0xf6, 0x1d, 0x4c, 0x02, 0x4c, 0x0c, 0x1b, 0x86, 0x5d, 0xe3, 0xb6, 0x61, 159 0x23, 0x0a, 0x1b, 0x86, 0x87, 0x42, 0x44, 0x7c, 0xa2, 0x47, 0x7d, 0x4c, 0xb1, 0xb4, 0x99, 0x44, 160 0xf4, 0x38, 0xa2, 0xf3, 0x48, 0x79, 0xcb, 0xc3, 0x1e, 0x66, 0x75, 0x23, 0x5e, 0x25, 0xd1, 0xb2, 161 0x92, 0xda, 0x08, 0x4a, 0x6d, 0x0e, 0xf6, 0xc3, 0x5f, 0xf5, 0x6f, 0xdd, 0x98, 0x97, 0xd5, 0xb5, 162 0xe7, 0x0c, 0x58, 0x6b, 0x27, 0xcd, 0x2f, 0x29, 0xa4, 0x48, 0x3a, 0x06, 0xf9, 0x08, 0xf6, 0x61, 163 0x40, 0x64, 0xb1, 0x2a, 0xd6, 0x4a, 0xcd, 0x5d, 0x7d, 0xc9, 0x66, 0xf4, 0x0b, 0x16, 0x31, 0x73, 164 0xe3, 0xa9, 0x2a, 0x58, 0x1c, 0x90, 0x4e, 0x40, 0xd1, 0x86, 0x3d, 0x18, 0x3a, 0x88, 0xc8, 0x99, 165 0x6a, 0xb6, 0x56, 0x6a, 0xee, 0x2d, 0x85, 0xcd, 0x24, 0xc4, 0xe9, 0x94, 0x91, 0x3c, 0x90, 0x27, 166 0x83, 0x28, 0xea, 0x0d, 0xe5, 0x2c, 0xa3, 0x77, 0xbe, 0x68, 0x82, 0x52, 0xfa, 0x14, 0xfb, 0xa1, 167 0x79, 0x14, 0xa3, 0x4f, 0xaf, 0xea, 0x81, 0xe7, 0xd3, 0xce, 0xc0, 0xd6, 0x1d, 0x1c, 0x18, 0x67, 168 0x7e, 0x48, 0x9c, 0x8e, 0x0f, 0x8d, 0x1b, 0xbe, 0xa8, 0x13, 0xb7, 0x6b, 0xd0, 0x61, 0x84, 0x08, 169 0x83, 0x88, 0xc5, 0xf5, 0x92, 0x03, 0x36, 0x5c, 0x14, 0xe2, 0xe0, 0x3a, 0x40, 0x14, 0xba, 0x90, 170 0x42, 0x39, 0xc7, 0x1a, 0x56, 0x96, 0x6e, 0xf7, 0x9c, 0x87, 0xcc, 0x4a, 0xdc, 0xf4, 0x63, 0xaa, 171 0x6e, 0x0f, 0x61, 0xd0, 0x6b, 0x69, 0x3f, 0x15, 0x9a, 0xb5, 0xce, 0x7e, 0x2c, 0xd2, 0xda, 0xa3, 172 0x08, 0x0a, 0xfc, 0xa4, 0x92, 0x0c, 0x0a, 0xd0, 0x75, 0xfb, 0x88, 0x24, 0xb7, 0xba, 0x6a, 0x2d, 173 0x3e, 0x25, 0x04, 0x56, 0xe2, 0xd7, 0x5a, 0x5c, 0xd8, 0xbf, 0x1f, 0x39, 0xb1, 0xb7, 0x8a, 0xf7, 174 0x23, 0x55, 0x78, 0x1f, 0xa9, 0x82, 0xd9, 0x1e, 0xcf, 0x14, 0x71, 0x32, 0x53, 0xc4, 0xb7, 0x99, 175 0x22, 0x3e, 0xcc, 0x15, 0x61, 0x32, 0x57, 0x84, 0x97, 0xb9, 0x22, 0x5c, 0xd5, 0xff, 0x14, 0xdf, 176 0x25, 0x63, 0xc4, 0xfc, 0x76, 0x9e, 0x0d, 0xd0, 0xe1, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 177 0xe6, 0xc6, 0x8e, 0xd0, 0x02, 0x00, 0x00, 178 } 179 180 func (m *GenesisState) Marshal() (dAtA []byte, err error) { 181 size := m.Size() 182 dAtA = make([]byte, size) 183 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 184 if err != nil { 185 return nil, err 186 } 187 return dAtA[:n], nil 188 } 189 190 func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { 191 size := m.Size() 192 return m.MarshalToSizedBuffer(dAtA[:size]) 193 } 194 195 func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { 196 i := len(dAtA) 197 _ = i 198 var l int 199 _ = l 200 if len(m.DenomMetadata) > 0 { 201 for iNdEx := len(m.DenomMetadata) - 1; iNdEx >= 0; iNdEx-- { 202 { 203 size, err := m.DenomMetadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 204 if err != nil { 205 return 0, err 206 } 207 i -= size 208 i = encodeVarintGenesis(dAtA, i, uint64(size)) 209 } 210 i-- 211 dAtA[i] = 0x22 212 } 213 } 214 if len(m.Supply) > 0 { 215 for iNdEx := len(m.Supply) - 1; iNdEx >= 0; iNdEx-- { 216 { 217 size, err := m.Supply[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 218 if err != nil { 219 return 0, err 220 } 221 i -= size 222 i = encodeVarintGenesis(dAtA, i, uint64(size)) 223 } 224 i-- 225 dAtA[i] = 0x1a 226 } 227 } 228 if len(m.Balances) > 0 { 229 for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { 230 { 231 size, err := m.Balances[iNdEx].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] = 0x12 240 } 241 } 242 { 243 size, err := m.Params.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] = 0xa 252 return len(dAtA) - i, nil 253 } 254 255 func (m *Balance) Marshal() (dAtA []byte, err error) { 256 size := m.Size() 257 dAtA = make([]byte, size) 258 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 259 if err != nil { 260 return nil, err 261 } 262 return dAtA[:n], nil 263 } 264 265 func (m *Balance) MarshalTo(dAtA []byte) (int, error) { 266 size := m.Size() 267 return m.MarshalToSizedBuffer(dAtA[:size]) 268 } 269 270 func (m *Balance) MarshalToSizedBuffer(dAtA []byte) (int, error) { 271 i := len(dAtA) 272 _ = i 273 var l int 274 _ = l 275 if len(m.Coins) > 0 { 276 for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { 277 { 278 size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 279 if err != nil { 280 return 0, err 281 } 282 i -= size 283 i = encodeVarintGenesis(dAtA, i, uint64(size)) 284 } 285 i-- 286 dAtA[i] = 0x12 287 } 288 } 289 if len(m.Address) > 0 { 290 i -= len(m.Address) 291 copy(dAtA[i:], m.Address) 292 i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) 293 i-- 294 dAtA[i] = 0xa 295 } 296 return len(dAtA) - i, nil 297 } 298 299 func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { 300 offset -= sovGenesis(v) 301 base := offset 302 for v >= 1<<7 { 303 dAtA[offset] = uint8(v&0x7f | 0x80) 304 v >>= 7 305 offset++ 306 } 307 dAtA[offset] = uint8(v) 308 return base 309 } 310 func (m *GenesisState) Size() (n int) { 311 if m == nil { 312 return 0 313 } 314 var l int 315 _ = l 316 l = m.Params.Size() 317 n += 1 + l + sovGenesis(uint64(l)) 318 if len(m.Balances) > 0 { 319 for _, e := range m.Balances { 320 l = e.Size() 321 n += 1 + l + sovGenesis(uint64(l)) 322 } 323 } 324 if len(m.Supply) > 0 { 325 for _, e := range m.Supply { 326 l = e.Size() 327 n += 1 + l + sovGenesis(uint64(l)) 328 } 329 } 330 if len(m.DenomMetadata) > 0 { 331 for _, e := range m.DenomMetadata { 332 l = e.Size() 333 n += 1 + l + sovGenesis(uint64(l)) 334 } 335 } 336 return n 337 } 338 339 func (m *Balance) Size() (n int) { 340 if m == nil { 341 return 0 342 } 343 var l int 344 _ = l 345 l = len(m.Address) 346 if l > 0 { 347 n += 1 + l + sovGenesis(uint64(l)) 348 } 349 if len(m.Coins) > 0 { 350 for _, e := range m.Coins { 351 l = e.Size() 352 n += 1 + l + sovGenesis(uint64(l)) 353 } 354 } 355 return n 356 } 357 358 func sovGenesis(x uint64) (n int) { 359 return (math_bits.Len64(x|1) + 6) / 7 360 } 361 func sozGenesis(x uint64) (n int) { 362 return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 363 } 364 func (m *GenesisState) Unmarshal(dAtA []byte) error { 365 l := len(dAtA) 366 iNdEx := 0 367 for iNdEx < l { 368 preIndex := iNdEx 369 var wire uint64 370 for shift := uint(0); ; shift += 7 { 371 if shift >= 64 { 372 return ErrIntOverflowGenesis 373 } 374 if iNdEx >= l { 375 return io.ErrUnexpectedEOF 376 } 377 b := dAtA[iNdEx] 378 iNdEx++ 379 wire |= uint64(b&0x7F) << shift 380 if b < 0x80 { 381 break 382 } 383 } 384 fieldNum := int32(wire >> 3) 385 wireType := int(wire & 0x7) 386 if wireType == 4 { 387 return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") 388 } 389 if fieldNum <= 0 { 390 return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) 391 } 392 switch fieldNum { 393 case 1: 394 if wireType != 2 { 395 return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) 396 } 397 var msglen int 398 for shift := uint(0); ; shift += 7 { 399 if shift >= 64 { 400 return ErrIntOverflowGenesis 401 } 402 if iNdEx >= l { 403 return io.ErrUnexpectedEOF 404 } 405 b := dAtA[iNdEx] 406 iNdEx++ 407 msglen |= int(b&0x7F) << shift 408 if b < 0x80 { 409 break 410 } 411 } 412 if msglen < 0 { 413 return ErrInvalidLengthGenesis 414 } 415 postIndex := iNdEx + msglen 416 if postIndex < 0 { 417 return ErrInvalidLengthGenesis 418 } 419 if postIndex > l { 420 return io.ErrUnexpectedEOF 421 } 422 if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 423 return err 424 } 425 iNdEx = postIndex 426 case 2: 427 if wireType != 2 { 428 return fmt.Errorf("proto: wrong wireType = %d for field Balances", wireType) 429 } 430 var msglen int 431 for shift := uint(0); ; shift += 7 { 432 if shift >= 64 { 433 return ErrIntOverflowGenesis 434 } 435 if iNdEx >= l { 436 return io.ErrUnexpectedEOF 437 } 438 b := dAtA[iNdEx] 439 iNdEx++ 440 msglen |= int(b&0x7F) << shift 441 if b < 0x80 { 442 break 443 } 444 } 445 if msglen < 0 { 446 return ErrInvalidLengthGenesis 447 } 448 postIndex := iNdEx + msglen 449 if postIndex < 0 { 450 return ErrInvalidLengthGenesis 451 } 452 if postIndex > l { 453 return io.ErrUnexpectedEOF 454 } 455 m.Balances = append(m.Balances, Balance{}) 456 if err := m.Balances[len(m.Balances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 457 return err 458 } 459 iNdEx = postIndex 460 case 3: 461 if wireType != 2 { 462 return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) 463 } 464 var msglen int 465 for shift := uint(0); ; shift += 7 { 466 if shift >= 64 { 467 return ErrIntOverflowGenesis 468 } 469 if iNdEx >= l { 470 return io.ErrUnexpectedEOF 471 } 472 b := dAtA[iNdEx] 473 iNdEx++ 474 msglen |= int(b&0x7F) << shift 475 if b < 0x80 { 476 break 477 } 478 } 479 if msglen < 0 { 480 return ErrInvalidLengthGenesis 481 } 482 postIndex := iNdEx + msglen 483 if postIndex < 0 { 484 return ErrInvalidLengthGenesis 485 } 486 if postIndex > l { 487 return io.ErrUnexpectedEOF 488 } 489 m.Supply = append(m.Supply, types.Coin{}) 490 if err := m.Supply[len(m.Supply)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 491 return err 492 } 493 iNdEx = postIndex 494 case 4: 495 if wireType != 2 { 496 return fmt.Errorf("proto: wrong wireType = %d for field DenomMetadata", wireType) 497 } 498 var msglen int 499 for shift := uint(0); ; shift += 7 { 500 if shift >= 64 { 501 return ErrIntOverflowGenesis 502 } 503 if iNdEx >= l { 504 return io.ErrUnexpectedEOF 505 } 506 b := dAtA[iNdEx] 507 iNdEx++ 508 msglen |= int(b&0x7F) << shift 509 if b < 0x80 { 510 break 511 } 512 } 513 if msglen < 0 { 514 return ErrInvalidLengthGenesis 515 } 516 postIndex := iNdEx + msglen 517 if postIndex < 0 { 518 return ErrInvalidLengthGenesis 519 } 520 if postIndex > l { 521 return io.ErrUnexpectedEOF 522 } 523 m.DenomMetadata = append(m.DenomMetadata, Metadata{}) 524 if err := m.DenomMetadata[len(m.DenomMetadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 525 return err 526 } 527 iNdEx = postIndex 528 default: 529 iNdEx = preIndex 530 skippy, err := skipGenesis(dAtA[iNdEx:]) 531 if err != nil { 532 return err 533 } 534 if (skippy < 0) || (iNdEx+skippy) < 0 { 535 return ErrInvalidLengthGenesis 536 } 537 if (iNdEx + skippy) > l { 538 return io.ErrUnexpectedEOF 539 } 540 iNdEx += skippy 541 } 542 } 543 544 if iNdEx > l { 545 return io.ErrUnexpectedEOF 546 } 547 return nil 548 } 549 func (m *Balance) Unmarshal(dAtA []byte) error { 550 l := len(dAtA) 551 iNdEx := 0 552 for iNdEx < l { 553 preIndex := iNdEx 554 var wire uint64 555 for shift := uint(0); ; shift += 7 { 556 if shift >= 64 { 557 return ErrIntOverflowGenesis 558 } 559 if iNdEx >= l { 560 return io.ErrUnexpectedEOF 561 } 562 b := dAtA[iNdEx] 563 iNdEx++ 564 wire |= uint64(b&0x7F) << shift 565 if b < 0x80 { 566 break 567 } 568 } 569 fieldNum := int32(wire >> 3) 570 wireType := int(wire & 0x7) 571 if wireType == 4 { 572 return fmt.Errorf("proto: Balance: wiretype end group for non-group") 573 } 574 if fieldNum <= 0 { 575 return fmt.Errorf("proto: Balance: illegal tag %d (wire type %d)", fieldNum, wire) 576 } 577 switch fieldNum { 578 case 1: 579 if wireType != 2 { 580 return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) 581 } 582 var stringLen uint64 583 for shift := uint(0); ; shift += 7 { 584 if shift >= 64 { 585 return ErrIntOverflowGenesis 586 } 587 if iNdEx >= l { 588 return io.ErrUnexpectedEOF 589 } 590 b := dAtA[iNdEx] 591 iNdEx++ 592 stringLen |= uint64(b&0x7F) << shift 593 if b < 0x80 { 594 break 595 } 596 } 597 intStringLen := int(stringLen) 598 if intStringLen < 0 { 599 return ErrInvalidLengthGenesis 600 } 601 postIndex := iNdEx + intStringLen 602 if postIndex < 0 { 603 return ErrInvalidLengthGenesis 604 } 605 if postIndex > l { 606 return io.ErrUnexpectedEOF 607 } 608 m.Address = string(dAtA[iNdEx:postIndex]) 609 iNdEx = postIndex 610 case 2: 611 if wireType != 2 { 612 return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) 613 } 614 var msglen int 615 for shift := uint(0); ; shift += 7 { 616 if shift >= 64 { 617 return ErrIntOverflowGenesis 618 } 619 if iNdEx >= l { 620 return io.ErrUnexpectedEOF 621 } 622 b := dAtA[iNdEx] 623 iNdEx++ 624 msglen |= int(b&0x7F) << shift 625 if b < 0x80 { 626 break 627 } 628 } 629 if msglen < 0 { 630 return ErrInvalidLengthGenesis 631 } 632 postIndex := iNdEx + msglen 633 if postIndex < 0 { 634 return ErrInvalidLengthGenesis 635 } 636 if postIndex > l { 637 return io.ErrUnexpectedEOF 638 } 639 m.Coins = append(m.Coins, types.Coin{}) 640 if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 641 return err 642 } 643 iNdEx = postIndex 644 default: 645 iNdEx = preIndex 646 skippy, err := skipGenesis(dAtA[iNdEx:]) 647 if err != nil { 648 return err 649 } 650 if (skippy < 0) || (iNdEx+skippy) < 0 { 651 return ErrInvalidLengthGenesis 652 } 653 if (iNdEx + skippy) > l { 654 return io.ErrUnexpectedEOF 655 } 656 iNdEx += skippy 657 } 658 } 659 660 if iNdEx > l { 661 return io.ErrUnexpectedEOF 662 } 663 return nil 664 } 665 func skipGenesis(dAtA []byte) (n int, err error) { 666 l := len(dAtA) 667 iNdEx := 0 668 depth := 0 669 for iNdEx < l { 670 var wire uint64 671 for shift := uint(0); ; shift += 7 { 672 if shift >= 64 { 673 return 0, ErrIntOverflowGenesis 674 } 675 if iNdEx >= l { 676 return 0, io.ErrUnexpectedEOF 677 } 678 b := dAtA[iNdEx] 679 iNdEx++ 680 wire |= (uint64(b) & 0x7F) << shift 681 if b < 0x80 { 682 break 683 } 684 } 685 wireType := int(wire & 0x7) 686 switch wireType { 687 case 0: 688 for shift := uint(0); ; shift += 7 { 689 if shift >= 64 { 690 return 0, ErrIntOverflowGenesis 691 } 692 if iNdEx >= l { 693 return 0, io.ErrUnexpectedEOF 694 } 695 iNdEx++ 696 if dAtA[iNdEx-1] < 0x80 { 697 break 698 } 699 } 700 case 1: 701 iNdEx += 8 702 case 2: 703 var length int 704 for shift := uint(0); ; shift += 7 { 705 if shift >= 64 { 706 return 0, ErrIntOverflowGenesis 707 } 708 if iNdEx >= l { 709 return 0, io.ErrUnexpectedEOF 710 } 711 b := dAtA[iNdEx] 712 iNdEx++ 713 length |= (int(b) & 0x7F) << shift 714 if b < 0x80 { 715 break 716 } 717 } 718 if length < 0 { 719 return 0, ErrInvalidLengthGenesis 720 } 721 iNdEx += length 722 case 3: 723 depth++ 724 case 4: 725 if depth == 0 { 726 return 0, ErrUnexpectedEndOfGroupGenesis 727 } 728 depth-- 729 case 5: 730 iNdEx += 4 731 default: 732 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 733 } 734 if iNdEx < 0 { 735 return 0, ErrInvalidLengthGenesis 736 } 737 if depth == 0 { 738 return iNdEx, nil 739 } 740 } 741 return 0, io.ErrUnexpectedEOF 742 } 743 744 var ( 745 ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") 746 ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") 747 ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") 748 )