github.com/cosmos/cosmos-sdk@v0.50.10/types/coin.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/base/v1beta1/coin.proto 3 4 package types 5 6 import ( 7 cosmossdk_io_math "cosmossdk.io/math" 8 fmt "fmt" 9 _ "github.com/cosmos/cosmos-proto" 10 _ "github.com/cosmos/cosmos-sdk/types/tx/amino" 11 _ "github.com/cosmos/gogoproto/gogoproto" 12 proto "github.com/cosmos/gogoproto/proto" 13 io "io" 14 math "math" 15 math_bits "math/bits" 16 ) 17 18 // Reference imports to suppress errors if they are not otherwise used. 19 var _ = proto.Marshal 20 var _ = fmt.Errorf 21 var _ = math.Inf 22 23 // This is a compile-time assertion to ensure that this generated file 24 // is compatible with the proto package it is being compiled against. 25 // A compilation error at this line likely means your copy of the 26 // proto package needs to be updated. 27 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 28 29 // Coin defines a token with a denomination and an amount. 30 // 31 // NOTE: The amount field is an Int which implements the custom method 32 // signatures required by gogoproto. 33 type Coin struct { 34 Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` 35 Amount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` 36 } 37 38 func (m *Coin) Reset() { *m = Coin{} } 39 func (*Coin) ProtoMessage() {} 40 func (*Coin) Descriptor() ([]byte, []int) { 41 return fileDescriptor_189a96714eafc2df, []int{0} 42 } 43 func (m *Coin) XXX_Unmarshal(b []byte) error { 44 return m.Unmarshal(b) 45 } 46 func (m *Coin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 47 if deterministic { 48 return xxx_messageInfo_Coin.Marshal(b, m, deterministic) 49 } else { 50 b = b[:cap(b)] 51 n, err := m.MarshalToSizedBuffer(b) 52 if err != nil { 53 return nil, err 54 } 55 return b[:n], nil 56 } 57 } 58 func (m *Coin) XXX_Merge(src proto.Message) { 59 xxx_messageInfo_Coin.Merge(m, src) 60 } 61 func (m *Coin) XXX_Size() int { 62 return m.Size() 63 } 64 func (m *Coin) XXX_DiscardUnknown() { 65 xxx_messageInfo_Coin.DiscardUnknown(m) 66 } 67 68 var xxx_messageInfo_Coin proto.InternalMessageInfo 69 70 func (m *Coin) GetDenom() string { 71 if m != nil { 72 return m.Denom 73 } 74 return "" 75 } 76 77 // DecCoin defines a token with a denomination and a decimal amount. 78 // 79 // NOTE: The amount field is an Dec which implements the custom method 80 // signatures required by gogoproto. 81 type DecCoin struct { 82 Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` 83 Amount cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"amount"` 84 } 85 86 func (m *DecCoin) Reset() { *m = DecCoin{} } 87 func (*DecCoin) ProtoMessage() {} 88 func (*DecCoin) Descriptor() ([]byte, []int) { 89 return fileDescriptor_189a96714eafc2df, []int{1} 90 } 91 func (m *DecCoin) XXX_Unmarshal(b []byte) error { 92 return m.Unmarshal(b) 93 } 94 func (m *DecCoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 95 if deterministic { 96 return xxx_messageInfo_DecCoin.Marshal(b, m, deterministic) 97 } else { 98 b = b[:cap(b)] 99 n, err := m.MarshalToSizedBuffer(b) 100 if err != nil { 101 return nil, err 102 } 103 return b[:n], nil 104 } 105 } 106 func (m *DecCoin) XXX_Merge(src proto.Message) { 107 xxx_messageInfo_DecCoin.Merge(m, src) 108 } 109 func (m *DecCoin) XXX_Size() int { 110 return m.Size() 111 } 112 func (m *DecCoin) XXX_DiscardUnknown() { 113 xxx_messageInfo_DecCoin.DiscardUnknown(m) 114 } 115 116 var xxx_messageInfo_DecCoin proto.InternalMessageInfo 117 118 func (m *DecCoin) GetDenom() string { 119 if m != nil { 120 return m.Denom 121 } 122 return "" 123 } 124 125 // IntProto defines a Protobuf wrapper around an Int object. 126 // Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. 127 type IntProto struct { 128 Int cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=int,proto3,customtype=cosmossdk.io/math.Int" json:"int"` 129 } 130 131 func (m *IntProto) Reset() { *m = IntProto{} } 132 func (*IntProto) ProtoMessage() {} 133 func (*IntProto) Descriptor() ([]byte, []int) { 134 return fileDescriptor_189a96714eafc2df, []int{2} 135 } 136 func (m *IntProto) XXX_Unmarshal(b []byte) error { 137 return m.Unmarshal(b) 138 } 139 func (m *IntProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 140 if deterministic { 141 return xxx_messageInfo_IntProto.Marshal(b, m, deterministic) 142 } else { 143 b = b[:cap(b)] 144 n, err := m.MarshalToSizedBuffer(b) 145 if err != nil { 146 return nil, err 147 } 148 return b[:n], nil 149 } 150 } 151 func (m *IntProto) XXX_Merge(src proto.Message) { 152 xxx_messageInfo_IntProto.Merge(m, src) 153 } 154 func (m *IntProto) XXX_Size() int { 155 return m.Size() 156 } 157 func (m *IntProto) XXX_DiscardUnknown() { 158 xxx_messageInfo_IntProto.DiscardUnknown(m) 159 } 160 161 var xxx_messageInfo_IntProto proto.InternalMessageInfo 162 163 // DecProto defines a Protobuf wrapper around a Dec object. 164 // Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. 165 type DecProto struct { 166 Dec cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=dec,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"dec"` 167 } 168 169 func (m *DecProto) Reset() { *m = DecProto{} } 170 func (*DecProto) ProtoMessage() {} 171 func (*DecProto) Descriptor() ([]byte, []int) { 172 return fileDescriptor_189a96714eafc2df, []int{3} 173 } 174 func (m *DecProto) XXX_Unmarshal(b []byte) error { 175 return m.Unmarshal(b) 176 } 177 func (m *DecProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 178 if deterministic { 179 return xxx_messageInfo_DecProto.Marshal(b, m, deterministic) 180 } else { 181 b = b[:cap(b)] 182 n, err := m.MarshalToSizedBuffer(b) 183 if err != nil { 184 return nil, err 185 } 186 return b[:n], nil 187 } 188 } 189 func (m *DecProto) XXX_Merge(src proto.Message) { 190 xxx_messageInfo_DecProto.Merge(m, src) 191 } 192 func (m *DecProto) XXX_Size() int { 193 return m.Size() 194 } 195 func (m *DecProto) XXX_DiscardUnknown() { 196 xxx_messageInfo_DecProto.DiscardUnknown(m) 197 } 198 199 var xxx_messageInfo_DecProto proto.InternalMessageInfo 200 201 func init() { 202 proto.RegisterType((*Coin)(nil), "cosmos.base.v1beta1.Coin") 203 proto.RegisterType((*DecCoin)(nil), "cosmos.base.v1beta1.DecCoin") 204 proto.RegisterType((*IntProto)(nil), "cosmos.base.v1beta1.IntProto") 205 proto.RegisterType((*DecProto)(nil), "cosmos.base.v1beta1.DecProto") 206 } 207 208 func init() { proto.RegisterFile("cosmos/base/v1beta1/coin.proto", fileDescriptor_189a96714eafc2df) } 209 210 var fileDescriptor_189a96714eafc2df = []byte{ 211 // 341 bytes of a gzipped FileDescriptorProto 212 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0x2f, 0xce, 213 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 214 0x4f, 0xce, 0xcf, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xeb, 0x81, 215 0xe4, 0xf5, 0xa0, 0xf2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, 216 0x54, 0x4a, 0x12, 0xa2, 0x34, 0x1e, 0x22, 0x01, 0xd5, 0x07, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 217 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x21, 0xa5, 0x1c, 0x2e, 0x16, 0xe7, 0xfc, 0xcc, 0x3c, 0x21, 0x11, 218 0x2e, 0xd6, 0x94, 0xd4, 0xbc, 0xfc, 0x5c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x08, 0x47, 219 0xc8, 0x83, 0x8b, 0x2d, 0x31, 0x37, 0xbf, 0x34, 0xaf, 0x44, 0x82, 0x09, 0x24, 0xec, 0x64, 0x70, 220 0xe2, 0x9e, 0x3c, 0xc3, 0xad, 0x7b, 0xf2, 0xa2, 0x10, 0x63, 0x8b, 0x53, 0xb2, 0xf5, 0x32, 0xf3, 221 0xf5, 0x73, 0x13, 0x4b, 0x32, 0xf4, 0x3c, 0xf3, 0x4a, 0x2e, 0x6d, 0xd1, 0xe5, 0x82, 0xda, 0xe7, 222 0x99, 0x57, 0xb2, 0xe2, 0xf9, 0x06, 0x2d, 0xc6, 0x20, 0xa8, 0x7e, 0x2b, 0x96, 0x17, 0x0b, 0xe4, 223 0x19, 0x95, 0x0a, 0xb8, 0xd8, 0x5d, 0x52, 0x93, 0xf1, 0x58, 0xe8, 0x89, 0x66, 0xa1, 0x21, 0xd4, 224 0x42, 0x69, 0x4c, 0x0b, 0x7d, 0x52, 0xd3, 0x13, 0x93, 0x2b, 0x5d, 0x52, 0x93, 0x91, 0xac, 0x75, 225 0x49, 0x4d, 0x46, 0xb3, 0xd1, 0x93, 0x8b, 0xc3, 0x33, 0xaf, 0x24, 0x00, 0x1c, 0x88, 0xb6, 0x5c, 226 0xcc, 0x99, 0x79, 0x25, 0x10, 0x0b, 0x9d, 0xb4, 0x49, 0xf0, 0x4a, 0x10, 0x48, 0x9f, 0x92, 0x3f, 227 0x17, 0x87, 0x4b, 0x6a, 0x32, 0xc4, 0x28, 0x67, 0x2e, 0xe6, 0x94, 0xd4, 0x64, 0xa8, 0x51, 0x64, 228 0x38, 0x12, 0xa4, 0xdb, 0xc9, 0xe5, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x0c, 0x27, 0x1e, 229 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 230 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 231 0x97, 0x9c, 0x9f, 0x0b, 0x8d, 0x49, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x52, 0x59, 0x90, 232 0x5a, 0x9c, 0xc4, 0x06, 0x8e, 0x48, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x0a, 0x5e, 233 0xb8, 0x43, 0x02, 0x00, 0x00, 234 } 235 236 func (this *Coin) Equal(that interface{}) bool { 237 if that == nil { 238 return this == nil 239 } 240 241 that1, ok := that.(*Coin) 242 if !ok { 243 that2, ok := that.(Coin) 244 if ok { 245 that1 = &that2 246 } else { 247 return false 248 } 249 } 250 if that1 == nil { 251 return this == nil 252 } else if this == nil { 253 return false 254 } 255 if this.Denom != that1.Denom { 256 return false 257 } 258 if !this.Amount.Equal(that1.Amount) { 259 return false 260 } 261 return true 262 } 263 func (this *DecCoin) Equal(that interface{}) bool { 264 if that == nil { 265 return this == nil 266 } 267 268 that1, ok := that.(*DecCoin) 269 if !ok { 270 that2, ok := that.(DecCoin) 271 if ok { 272 that1 = &that2 273 } else { 274 return false 275 } 276 } 277 if that1 == nil { 278 return this == nil 279 } else if this == nil { 280 return false 281 } 282 if this.Denom != that1.Denom { 283 return false 284 } 285 if !this.Amount.Equal(that1.Amount) { 286 return false 287 } 288 return true 289 } 290 func (m *Coin) Marshal() (dAtA []byte, err error) { 291 size := m.Size() 292 dAtA = make([]byte, size) 293 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 294 if err != nil { 295 return nil, err 296 } 297 return dAtA[:n], nil 298 } 299 300 func (m *Coin) MarshalTo(dAtA []byte) (int, error) { 301 size := m.Size() 302 return m.MarshalToSizedBuffer(dAtA[:size]) 303 } 304 305 func (m *Coin) MarshalToSizedBuffer(dAtA []byte) (int, error) { 306 i := len(dAtA) 307 _ = i 308 var l int 309 _ = l 310 { 311 size := m.Amount.Size() 312 i -= size 313 if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { 314 return 0, err 315 } 316 i = encodeVarintCoin(dAtA, i, uint64(size)) 317 } 318 i-- 319 dAtA[i] = 0x12 320 if len(m.Denom) > 0 { 321 i -= len(m.Denom) 322 copy(dAtA[i:], m.Denom) 323 i = encodeVarintCoin(dAtA, i, uint64(len(m.Denom))) 324 i-- 325 dAtA[i] = 0xa 326 } 327 return len(dAtA) - i, nil 328 } 329 330 func (m *DecCoin) Marshal() (dAtA []byte, err error) { 331 size := m.Size() 332 dAtA = make([]byte, size) 333 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 334 if err != nil { 335 return nil, err 336 } 337 return dAtA[:n], nil 338 } 339 340 func (m *DecCoin) MarshalTo(dAtA []byte) (int, error) { 341 size := m.Size() 342 return m.MarshalToSizedBuffer(dAtA[:size]) 343 } 344 345 func (m *DecCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { 346 i := len(dAtA) 347 _ = i 348 var l int 349 _ = l 350 { 351 size := m.Amount.Size() 352 i -= size 353 if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { 354 return 0, err 355 } 356 i = encodeVarintCoin(dAtA, i, uint64(size)) 357 } 358 i-- 359 dAtA[i] = 0x12 360 if len(m.Denom) > 0 { 361 i -= len(m.Denom) 362 copy(dAtA[i:], m.Denom) 363 i = encodeVarintCoin(dAtA, i, uint64(len(m.Denom))) 364 i-- 365 dAtA[i] = 0xa 366 } 367 return len(dAtA) - i, nil 368 } 369 370 func (m *IntProto) Marshal() (dAtA []byte, err error) { 371 size := m.Size() 372 dAtA = make([]byte, size) 373 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 374 if err != nil { 375 return nil, err 376 } 377 return dAtA[:n], nil 378 } 379 380 func (m *IntProto) MarshalTo(dAtA []byte) (int, error) { 381 size := m.Size() 382 return m.MarshalToSizedBuffer(dAtA[:size]) 383 } 384 385 func (m *IntProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { 386 i := len(dAtA) 387 _ = i 388 var l int 389 _ = l 390 { 391 size := m.Int.Size() 392 i -= size 393 if _, err := m.Int.MarshalTo(dAtA[i:]); err != nil { 394 return 0, err 395 } 396 i = encodeVarintCoin(dAtA, i, uint64(size)) 397 } 398 i-- 399 dAtA[i] = 0xa 400 return len(dAtA) - i, nil 401 } 402 403 func (m *DecProto) Marshal() (dAtA []byte, err error) { 404 size := m.Size() 405 dAtA = make([]byte, size) 406 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 407 if err != nil { 408 return nil, err 409 } 410 return dAtA[:n], nil 411 } 412 413 func (m *DecProto) MarshalTo(dAtA []byte) (int, error) { 414 size := m.Size() 415 return m.MarshalToSizedBuffer(dAtA[:size]) 416 } 417 418 func (m *DecProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { 419 i := len(dAtA) 420 _ = i 421 var l int 422 _ = l 423 { 424 size := m.Dec.Size() 425 i -= size 426 if _, err := m.Dec.MarshalTo(dAtA[i:]); err != nil { 427 return 0, err 428 } 429 i = encodeVarintCoin(dAtA, i, uint64(size)) 430 } 431 i-- 432 dAtA[i] = 0xa 433 return len(dAtA) - i, nil 434 } 435 436 func encodeVarintCoin(dAtA []byte, offset int, v uint64) int { 437 offset -= sovCoin(v) 438 base := offset 439 for v >= 1<<7 { 440 dAtA[offset] = uint8(v&0x7f | 0x80) 441 v >>= 7 442 offset++ 443 } 444 dAtA[offset] = uint8(v) 445 return base 446 } 447 func (m *Coin) Size() (n int) { 448 if m == nil { 449 return 0 450 } 451 var l int 452 _ = l 453 l = len(m.Denom) 454 if l > 0 { 455 n += 1 + l + sovCoin(uint64(l)) 456 } 457 l = m.Amount.Size() 458 n += 1 + l + sovCoin(uint64(l)) 459 return n 460 } 461 462 func (m *DecCoin) Size() (n int) { 463 if m == nil { 464 return 0 465 } 466 var l int 467 _ = l 468 l = len(m.Denom) 469 if l > 0 { 470 n += 1 + l + sovCoin(uint64(l)) 471 } 472 l = m.Amount.Size() 473 n += 1 + l + sovCoin(uint64(l)) 474 return n 475 } 476 477 func (m *IntProto) Size() (n int) { 478 if m == nil { 479 return 0 480 } 481 var l int 482 _ = l 483 l = m.Int.Size() 484 n += 1 + l + sovCoin(uint64(l)) 485 return n 486 } 487 488 func (m *DecProto) Size() (n int) { 489 if m == nil { 490 return 0 491 } 492 var l int 493 _ = l 494 l = m.Dec.Size() 495 n += 1 + l + sovCoin(uint64(l)) 496 return n 497 } 498 499 func sovCoin(x uint64) (n int) { 500 return (math_bits.Len64(x|1) + 6) / 7 501 } 502 func sozCoin(x uint64) (n int) { 503 return sovCoin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 504 } 505 func (m *Coin) Unmarshal(dAtA []byte) error { 506 l := len(dAtA) 507 iNdEx := 0 508 for iNdEx < l { 509 preIndex := iNdEx 510 var wire uint64 511 for shift := uint(0); ; shift += 7 { 512 if shift >= 64 { 513 return ErrIntOverflowCoin 514 } 515 if iNdEx >= l { 516 return io.ErrUnexpectedEOF 517 } 518 b := dAtA[iNdEx] 519 iNdEx++ 520 wire |= uint64(b&0x7F) << shift 521 if b < 0x80 { 522 break 523 } 524 } 525 fieldNum := int32(wire >> 3) 526 wireType := int(wire & 0x7) 527 if wireType == 4 { 528 return fmt.Errorf("proto: Coin: wiretype end group for non-group") 529 } 530 if fieldNum <= 0 { 531 return fmt.Errorf("proto: Coin: illegal tag %d (wire type %d)", fieldNum, wire) 532 } 533 switch fieldNum { 534 case 1: 535 if wireType != 2 { 536 return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) 537 } 538 var stringLen uint64 539 for shift := uint(0); ; shift += 7 { 540 if shift >= 64 { 541 return ErrIntOverflowCoin 542 } 543 if iNdEx >= l { 544 return io.ErrUnexpectedEOF 545 } 546 b := dAtA[iNdEx] 547 iNdEx++ 548 stringLen |= uint64(b&0x7F) << shift 549 if b < 0x80 { 550 break 551 } 552 } 553 intStringLen := int(stringLen) 554 if intStringLen < 0 { 555 return ErrInvalidLengthCoin 556 } 557 postIndex := iNdEx + intStringLen 558 if postIndex < 0 { 559 return ErrInvalidLengthCoin 560 } 561 if postIndex > l { 562 return io.ErrUnexpectedEOF 563 } 564 m.Denom = string(dAtA[iNdEx:postIndex]) 565 iNdEx = postIndex 566 case 2: 567 if wireType != 2 { 568 return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) 569 } 570 var stringLen uint64 571 for shift := uint(0); ; shift += 7 { 572 if shift >= 64 { 573 return ErrIntOverflowCoin 574 } 575 if iNdEx >= l { 576 return io.ErrUnexpectedEOF 577 } 578 b := dAtA[iNdEx] 579 iNdEx++ 580 stringLen |= uint64(b&0x7F) << shift 581 if b < 0x80 { 582 break 583 } 584 } 585 intStringLen := int(stringLen) 586 if intStringLen < 0 { 587 return ErrInvalidLengthCoin 588 } 589 postIndex := iNdEx + intStringLen 590 if postIndex < 0 { 591 return ErrInvalidLengthCoin 592 } 593 if postIndex > l { 594 return io.ErrUnexpectedEOF 595 } 596 if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 597 return err 598 } 599 iNdEx = postIndex 600 default: 601 iNdEx = preIndex 602 skippy, err := skipCoin(dAtA[iNdEx:]) 603 if err != nil { 604 return err 605 } 606 if (skippy < 0) || (iNdEx+skippy) < 0 { 607 return ErrInvalidLengthCoin 608 } 609 if (iNdEx + skippy) > l { 610 return io.ErrUnexpectedEOF 611 } 612 iNdEx += skippy 613 } 614 } 615 616 if iNdEx > l { 617 return io.ErrUnexpectedEOF 618 } 619 return nil 620 } 621 func (m *DecCoin) Unmarshal(dAtA []byte) error { 622 l := len(dAtA) 623 iNdEx := 0 624 for iNdEx < l { 625 preIndex := iNdEx 626 var wire uint64 627 for shift := uint(0); ; shift += 7 { 628 if shift >= 64 { 629 return ErrIntOverflowCoin 630 } 631 if iNdEx >= l { 632 return io.ErrUnexpectedEOF 633 } 634 b := dAtA[iNdEx] 635 iNdEx++ 636 wire |= uint64(b&0x7F) << shift 637 if b < 0x80 { 638 break 639 } 640 } 641 fieldNum := int32(wire >> 3) 642 wireType := int(wire & 0x7) 643 if wireType == 4 { 644 return fmt.Errorf("proto: DecCoin: wiretype end group for non-group") 645 } 646 if fieldNum <= 0 { 647 return fmt.Errorf("proto: DecCoin: illegal tag %d (wire type %d)", fieldNum, wire) 648 } 649 switch fieldNum { 650 case 1: 651 if wireType != 2 { 652 return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) 653 } 654 var stringLen uint64 655 for shift := uint(0); ; shift += 7 { 656 if shift >= 64 { 657 return ErrIntOverflowCoin 658 } 659 if iNdEx >= l { 660 return io.ErrUnexpectedEOF 661 } 662 b := dAtA[iNdEx] 663 iNdEx++ 664 stringLen |= uint64(b&0x7F) << shift 665 if b < 0x80 { 666 break 667 } 668 } 669 intStringLen := int(stringLen) 670 if intStringLen < 0 { 671 return ErrInvalidLengthCoin 672 } 673 postIndex := iNdEx + intStringLen 674 if postIndex < 0 { 675 return ErrInvalidLengthCoin 676 } 677 if postIndex > l { 678 return io.ErrUnexpectedEOF 679 } 680 m.Denom = string(dAtA[iNdEx:postIndex]) 681 iNdEx = postIndex 682 case 2: 683 if wireType != 2 { 684 return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) 685 } 686 var stringLen uint64 687 for shift := uint(0); ; shift += 7 { 688 if shift >= 64 { 689 return ErrIntOverflowCoin 690 } 691 if iNdEx >= l { 692 return io.ErrUnexpectedEOF 693 } 694 b := dAtA[iNdEx] 695 iNdEx++ 696 stringLen |= uint64(b&0x7F) << shift 697 if b < 0x80 { 698 break 699 } 700 } 701 intStringLen := int(stringLen) 702 if intStringLen < 0 { 703 return ErrInvalidLengthCoin 704 } 705 postIndex := iNdEx + intStringLen 706 if postIndex < 0 { 707 return ErrInvalidLengthCoin 708 } 709 if postIndex > l { 710 return io.ErrUnexpectedEOF 711 } 712 if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 713 return err 714 } 715 iNdEx = postIndex 716 default: 717 iNdEx = preIndex 718 skippy, err := skipCoin(dAtA[iNdEx:]) 719 if err != nil { 720 return err 721 } 722 if (skippy < 0) || (iNdEx+skippy) < 0 { 723 return ErrInvalidLengthCoin 724 } 725 if (iNdEx + skippy) > l { 726 return io.ErrUnexpectedEOF 727 } 728 iNdEx += skippy 729 } 730 } 731 732 if iNdEx > l { 733 return io.ErrUnexpectedEOF 734 } 735 return nil 736 } 737 func (m *IntProto) Unmarshal(dAtA []byte) error { 738 l := len(dAtA) 739 iNdEx := 0 740 for iNdEx < l { 741 preIndex := iNdEx 742 var wire uint64 743 for shift := uint(0); ; shift += 7 { 744 if shift >= 64 { 745 return ErrIntOverflowCoin 746 } 747 if iNdEx >= l { 748 return io.ErrUnexpectedEOF 749 } 750 b := dAtA[iNdEx] 751 iNdEx++ 752 wire |= uint64(b&0x7F) << shift 753 if b < 0x80 { 754 break 755 } 756 } 757 fieldNum := int32(wire >> 3) 758 wireType := int(wire & 0x7) 759 if wireType == 4 { 760 return fmt.Errorf("proto: IntProto: wiretype end group for non-group") 761 } 762 if fieldNum <= 0 { 763 return fmt.Errorf("proto: IntProto: illegal tag %d (wire type %d)", fieldNum, wire) 764 } 765 switch fieldNum { 766 case 1: 767 if wireType != 2 { 768 return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) 769 } 770 var stringLen uint64 771 for shift := uint(0); ; shift += 7 { 772 if shift >= 64 { 773 return ErrIntOverflowCoin 774 } 775 if iNdEx >= l { 776 return io.ErrUnexpectedEOF 777 } 778 b := dAtA[iNdEx] 779 iNdEx++ 780 stringLen |= uint64(b&0x7F) << shift 781 if b < 0x80 { 782 break 783 } 784 } 785 intStringLen := int(stringLen) 786 if intStringLen < 0 { 787 return ErrInvalidLengthCoin 788 } 789 postIndex := iNdEx + intStringLen 790 if postIndex < 0 { 791 return ErrInvalidLengthCoin 792 } 793 if postIndex > l { 794 return io.ErrUnexpectedEOF 795 } 796 if err := m.Int.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 797 return err 798 } 799 iNdEx = postIndex 800 default: 801 iNdEx = preIndex 802 skippy, err := skipCoin(dAtA[iNdEx:]) 803 if err != nil { 804 return err 805 } 806 if (skippy < 0) || (iNdEx+skippy) < 0 { 807 return ErrInvalidLengthCoin 808 } 809 if (iNdEx + skippy) > l { 810 return io.ErrUnexpectedEOF 811 } 812 iNdEx += skippy 813 } 814 } 815 816 if iNdEx > l { 817 return io.ErrUnexpectedEOF 818 } 819 return nil 820 } 821 func (m *DecProto) Unmarshal(dAtA []byte) error { 822 l := len(dAtA) 823 iNdEx := 0 824 for iNdEx < l { 825 preIndex := iNdEx 826 var wire uint64 827 for shift := uint(0); ; shift += 7 { 828 if shift >= 64 { 829 return ErrIntOverflowCoin 830 } 831 if iNdEx >= l { 832 return io.ErrUnexpectedEOF 833 } 834 b := dAtA[iNdEx] 835 iNdEx++ 836 wire |= uint64(b&0x7F) << shift 837 if b < 0x80 { 838 break 839 } 840 } 841 fieldNum := int32(wire >> 3) 842 wireType := int(wire & 0x7) 843 if wireType == 4 { 844 return fmt.Errorf("proto: DecProto: wiretype end group for non-group") 845 } 846 if fieldNum <= 0 { 847 return fmt.Errorf("proto: DecProto: illegal tag %d (wire type %d)", fieldNum, wire) 848 } 849 switch fieldNum { 850 case 1: 851 if wireType != 2 { 852 return fmt.Errorf("proto: wrong wireType = %d for field Dec", wireType) 853 } 854 var stringLen uint64 855 for shift := uint(0); ; shift += 7 { 856 if shift >= 64 { 857 return ErrIntOverflowCoin 858 } 859 if iNdEx >= l { 860 return io.ErrUnexpectedEOF 861 } 862 b := dAtA[iNdEx] 863 iNdEx++ 864 stringLen |= uint64(b&0x7F) << shift 865 if b < 0x80 { 866 break 867 } 868 } 869 intStringLen := int(stringLen) 870 if intStringLen < 0 { 871 return ErrInvalidLengthCoin 872 } 873 postIndex := iNdEx + intStringLen 874 if postIndex < 0 { 875 return ErrInvalidLengthCoin 876 } 877 if postIndex > l { 878 return io.ErrUnexpectedEOF 879 } 880 if err := m.Dec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 881 return err 882 } 883 iNdEx = postIndex 884 default: 885 iNdEx = preIndex 886 skippy, err := skipCoin(dAtA[iNdEx:]) 887 if err != nil { 888 return err 889 } 890 if (skippy < 0) || (iNdEx+skippy) < 0 { 891 return ErrInvalidLengthCoin 892 } 893 if (iNdEx + skippy) > l { 894 return io.ErrUnexpectedEOF 895 } 896 iNdEx += skippy 897 } 898 } 899 900 if iNdEx > l { 901 return io.ErrUnexpectedEOF 902 } 903 return nil 904 } 905 func skipCoin(dAtA []byte) (n int, err error) { 906 l := len(dAtA) 907 iNdEx := 0 908 depth := 0 909 for iNdEx < l { 910 var wire uint64 911 for shift := uint(0); ; shift += 7 { 912 if shift >= 64 { 913 return 0, ErrIntOverflowCoin 914 } 915 if iNdEx >= l { 916 return 0, io.ErrUnexpectedEOF 917 } 918 b := dAtA[iNdEx] 919 iNdEx++ 920 wire |= (uint64(b) & 0x7F) << shift 921 if b < 0x80 { 922 break 923 } 924 } 925 wireType := int(wire & 0x7) 926 switch wireType { 927 case 0: 928 for shift := uint(0); ; shift += 7 { 929 if shift >= 64 { 930 return 0, ErrIntOverflowCoin 931 } 932 if iNdEx >= l { 933 return 0, io.ErrUnexpectedEOF 934 } 935 iNdEx++ 936 if dAtA[iNdEx-1] < 0x80 { 937 break 938 } 939 } 940 case 1: 941 iNdEx += 8 942 case 2: 943 var length int 944 for shift := uint(0); ; shift += 7 { 945 if shift >= 64 { 946 return 0, ErrIntOverflowCoin 947 } 948 if iNdEx >= l { 949 return 0, io.ErrUnexpectedEOF 950 } 951 b := dAtA[iNdEx] 952 iNdEx++ 953 length |= (int(b) & 0x7F) << shift 954 if b < 0x80 { 955 break 956 } 957 } 958 if length < 0 { 959 return 0, ErrInvalidLengthCoin 960 } 961 iNdEx += length 962 case 3: 963 depth++ 964 case 4: 965 if depth == 0 { 966 return 0, ErrUnexpectedEndOfGroupCoin 967 } 968 depth-- 969 case 5: 970 iNdEx += 4 971 default: 972 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 973 } 974 if iNdEx < 0 { 975 return 0, ErrInvalidLengthCoin 976 } 977 if depth == 0 { 978 return iNdEx, nil 979 } 980 } 981 return 0, io.ErrUnexpectedEOF 982 } 983 984 var ( 985 ErrInvalidLengthCoin = fmt.Errorf("proto: negative length found during unmarshaling") 986 ErrIntOverflowCoin = fmt.Errorf("proto: integer overflow") 987 ErrUnexpectedEndOfGroupCoin = fmt.Errorf("proto: unexpected end of group") 988 )