github.com/Finschia/finschia-sdk@v0.49.1/x/fswap/types/fswap.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: lbm/fswap/v1/fswap.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 type Swap struct { 29 FromDenom string `protobuf:"bytes,1,opt,name=from_denom,json=fromDenom,proto3" json:"from_denom,omitempty"` 30 ToDenom string `protobuf:"bytes,2,opt,name=to_denom,json=toDenom,proto3" json:"to_denom,omitempty"` 31 AmountCapForToDenom github_com_Finschia_finschia_sdk_types.Int `protobuf:"bytes,3,opt,name=amount_cap_for_to_denom,json=amountCapForToDenom,proto3,customtype=github.com/Finschia/finschia-sdk/types.Int" json:"amount_cap_for_to_denom"` 32 SwapRate github_com_Finschia_finschia_sdk_types.Dec `protobuf:"bytes,4,opt,name=swap_rate,json=swapRate,proto3,customtype=github.com/Finschia/finschia-sdk/types.Dec" json:"swap_rate"` 33 } 34 35 func (m *Swap) Reset() { *m = Swap{} } 36 func (m *Swap) String() string { return proto.CompactTextString(m) } 37 func (*Swap) ProtoMessage() {} 38 func (*Swap) Descriptor() ([]byte, []int) { 39 return fileDescriptor_42ca60eaf37a2b67, []int{0} 40 } 41 func (m *Swap) XXX_Unmarshal(b []byte) error { 42 return m.Unmarshal(b) 43 } 44 func (m *Swap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 45 if deterministic { 46 return xxx_messageInfo_Swap.Marshal(b, m, deterministic) 47 } else { 48 b = b[:cap(b)] 49 n, err := m.MarshalToSizedBuffer(b) 50 if err != nil { 51 return nil, err 52 } 53 return b[:n], nil 54 } 55 } 56 func (m *Swap) XXX_Merge(src proto.Message) { 57 xxx_messageInfo_Swap.Merge(m, src) 58 } 59 func (m *Swap) XXX_Size() int { 60 return m.Size() 61 } 62 func (m *Swap) XXX_DiscardUnknown() { 63 xxx_messageInfo_Swap.DiscardUnknown(m) 64 } 65 66 var xxx_messageInfo_Swap proto.InternalMessageInfo 67 68 func (m *Swap) GetFromDenom() string { 69 if m != nil { 70 return m.FromDenom 71 } 72 return "" 73 } 74 75 func (m *Swap) GetToDenom() string { 76 if m != nil { 77 return m.ToDenom 78 } 79 return "" 80 } 81 82 type SwapStats struct { 83 SwapCount int32 `protobuf:"varint,1,opt,name=swap_count,json=swapCount,proto3" json:"swap_count,omitempty"` 84 } 85 86 func (m *SwapStats) Reset() { *m = SwapStats{} } 87 func (m *SwapStats) String() string { return proto.CompactTextString(m) } 88 func (*SwapStats) ProtoMessage() {} 89 func (*SwapStats) Descriptor() ([]byte, []int) { 90 return fileDescriptor_42ca60eaf37a2b67, []int{1} 91 } 92 func (m *SwapStats) XXX_Unmarshal(b []byte) error { 93 return m.Unmarshal(b) 94 } 95 func (m *SwapStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 96 if deterministic { 97 return xxx_messageInfo_SwapStats.Marshal(b, m, deterministic) 98 } else { 99 b = b[:cap(b)] 100 n, err := m.MarshalToSizedBuffer(b) 101 if err != nil { 102 return nil, err 103 } 104 return b[:n], nil 105 } 106 } 107 func (m *SwapStats) XXX_Merge(src proto.Message) { 108 xxx_messageInfo_SwapStats.Merge(m, src) 109 } 110 func (m *SwapStats) XXX_Size() int { 111 return m.Size() 112 } 113 func (m *SwapStats) XXX_DiscardUnknown() { 114 xxx_messageInfo_SwapStats.DiscardUnknown(m) 115 } 116 117 var xxx_messageInfo_SwapStats proto.InternalMessageInfo 118 119 func (m *SwapStats) GetSwapCount() int32 { 120 if m != nil { 121 return m.SwapCount 122 } 123 return 0 124 } 125 126 type Swapped struct { 127 FromCoinAmount types.Coin `protobuf:"bytes,1,opt,name=from_coin_amount,json=fromCoinAmount,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coin" json:"from_coin_amount"` 128 ToCoinAmount types.Coin `protobuf:"bytes,2,opt,name=to_coin_amount,json=toCoinAmount,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coin" json:"to_coin_amount"` 129 } 130 131 func (m *Swapped) Reset() { *m = Swapped{} } 132 func (m *Swapped) String() string { return proto.CompactTextString(m) } 133 func (*Swapped) ProtoMessage() {} 134 func (*Swapped) Descriptor() ([]byte, []int) { 135 return fileDescriptor_42ca60eaf37a2b67, []int{2} 136 } 137 func (m *Swapped) XXX_Unmarshal(b []byte) error { 138 return m.Unmarshal(b) 139 } 140 func (m *Swapped) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 141 if deterministic { 142 return xxx_messageInfo_Swapped.Marshal(b, m, deterministic) 143 } else { 144 b = b[:cap(b)] 145 n, err := m.MarshalToSizedBuffer(b) 146 if err != nil { 147 return nil, err 148 } 149 return b[:n], nil 150 } 151 } 152 func (m *Swapped) XXX_Merge(src proto.Message) { 153 xxx_messageInfo_Swapped.Merge(m, src) 154 } 155 func (m *Swapped) XXX_Size() int { 156 return m.Size() 157 } 158 func (m *Swapped) XXX_DiscardUnknown() { 159 xxx_messageInfo_Swapped.DiscardUnknown(m) 160 } 161 162 var xxx_messageInfo_Swapped proto.InternalMessageInfo 163 164 func (m *Swapped) GetFromCoinAmount() types.Coin { 165 if m != nil { 166 return m.FromCoinAmount 167 } 168 return types.Coin{} 169 } 170 171 func (m *Swapped) GetToCoinAmount() types.Coin { 172 if m != nil { 173 return m.ToCoinAmount 174 } 175 return types.Coin{} 176 } 177 178 func init() { 179 proto.RegisterType((*Swap)(nil), "lbm.fswap.v1.Swap") 180 proto.RegisterType((*SwapStats)(nil), "lbm.fswap.v1.SwapStats") 181 proto.RegisterType((*Swapped)(nil), "lbm.fswap.v1.Swapped") 182 } 183 184 func init() { proto.RegisterFile("lbm/fswap/v1/fswap.proto", fileDescriptor_42ca60eaf37a2b67) } 185 186 var fileDescriptor_42ca60eaf37a2b67 = []byte{ 187 // 397 bytes of a gzipped FileDescriptorProto 188 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x92, 0xcf, 0xae, 0xd2, 0x40, 189 0x14, 0xc6, 0x5b, 0x44, 0xa1, 0x23, 0x21, 0xa6, 0x9a, 0x08, 0x24, 0x16, 0xc3, 0xca, 0x60, 0x9c, 190 0x49, 0xe1, 0x09, 0x04, 0x42, 0x74, 0x65, 0x52, 0x5c, 0xb9, 0x69, 0xa6, 0x65, 0x0a, 0x8d, 0xb4, 191 0xa7, 0xe9, 0x0c, 0x7f, 0x7c, 0x0b, 0x9f, 0xc3, 0x27, 0x61, 0xc9, 0xd2, 0xb8, 0x40, 0x03, 0x4f, 192 0x61, 0xdc, 0x98, 0x33, 0xd3, 0x68, 0x5c, 0x79, 0x73, 0x93, 0xbb, 0x3b, 0x39, 0xdf, 0x99, 0xef, 193 0x77, 0xe6, 0xcb, 0x21, 0x9d, 0x4d, 0x94, 0xb1, 0x44, 0xee, 0x79, 0xc1, 0x76, 0xbe, 0x29, 0x68, 194 0x51, 0x82, 0x02, 0xb7, 0xb5, 0x89, 0x32, 0x6a, 0x1a, 0x3b, 0xbf, 0xf7, 0x64, 0x05, 0x2b, 0xd0, 195 0x02, 0xc3, 0xca, 0xcc, 0xf4, 0xbc, 0x18, 0x64, 0x06, 0x92, 0x45, 0x5c, 0x0a, 0xb6, 0xf3, 0x23, 196 0xa1, 0xb8, 0xcf, 0x62, 0x48, 0x73, 0xa3, 0x0f, 0x7e, 0xd9, 0xa4, 0xbe, 0xd8, 0xf3, 0xc2, 0x7d, 197 0x46, 0x48, 0x52, 0x42, 0x16, 0x2e, 0x45, 0x0e, 0x59, 0xc7, 0x7e, 0x6e, 0xbf, 0x70, 0x02, 0x07, 198 0x3b, 0x33, 0x6c, 0xb8, 0x5d, 0xd2, 0x54, 0x50, 0x89, 0x35, 0x2d, 0x36, 0x14, 0x18, 0x69, 0x4d, 199 0x9e, 0xf2, 0x0c, 0xb6, 0xb9, 0x0a, 0x63, 0x5e, 0x84, 0x09, 0x94, 0xe1, 0x9f, 0xc9, 0x7b, 0x38, 200 0x39, 0x19, 0x1d, 0xcf, 0x7d, 0xeb, 0xdb, 0xb9, 0x3f, 0x5c, 0xa5, 0x6a, 0xbd, 0x8d, 0x68, 0x0c, 201 0x19, 0x9b, 0xa7, 0xb9, 0x8c, 0xd7, 0x29, 0x67, 0x49, 0x55, 0xbc, 0x92, 0xcb, 0x8f, 0x4c, 0x7d, 202 0x2a, 0x84, 0xa4, 0x6f, 0x73, 0x15, 0x3c, 0x36, 0x96, 0x53, 0x5e, 0xcc, 0xa1, 0x7c, 0x5f, 0x91, 203 0xde, 0x11, 0x07, 0x7f, 0x1b, 0x96, 0x5c, 0x89, 0x4e, 0xfd, 0x56, 0xde, 0x33, 0x11, 0x07, 0x4d, 204 0x34, 0x09, 0xb8, 0x12, 0x83, 0x21, 0x71, 0xf0, 0xf3, 0x0b, 0xc5, 0x95, 0xc4, 0x04, 0xb4, 0x7b, 205 0x8c, 0x60, 0x9d, 0xc0, 0xfd, 0x40, 0xf3, 0xa6, 0xd8, 0x18, 0xfc, 0xb4, 0x49, 0x03, 0x87, 0x0b, 206 0xb1, 0x74, 0x0f, 0xe4, 0x91, 0x0e, 0x0b, 0x83, 0x0c, 0xcd, 0xa6, 0xfa, 0xc1, 0xc3, 0x51, 0x97, 207 0x9a, 0xc0, 0x29, 0x06, 0x4e, 0xab, 0xc0, 0xe9, 0x14, 0xd2, 0x7c, 0x32, 0xc6, 0x55, 0xbf, 0x7c, 208 0xef, 0xbf, 0xbc, 0xe1, 0xaa, 0xf8, 0x28, 0x68, 0x23, 0x07, 0xab, 0xd7, 0x9a, 0xe2, 0x2a, 0xd2, 209 0x56, 0xf0, 0x0f, 0xb7, 0x76, 0x27, 0xdc, 0x96, 0x82, 0xbf, 0xd4, 0xc9, 0x9b, 0xe3, 0xc5, 0xb3, 210 0x4f, 0x17, 0xcf, 0xfe, 0x71, 0xf1, 0xec, 0xcf, 0x57, 0xcf, 0x3a, 0x5d, 0x3d, 0xeb, 0xeb, 0xd5, 211 0xb3, 0x3e, 0xd0, 0xff, 0x9a, 0x1e, 0xaa, 0xe3, 0xd5, 0xe6, 0xd1, 0x03, 0x7d, 0x76, 0xe3, 0xdf, 212 0x01, 0x00, 0x00, 0xff, 0xff, 0x53, 0x35, 0xf1, 0x71, 0xd6, 0x02, 0x00, 0x00, 213 } 214 215 func (m *Swap) Marshal() (dAtA []byte, err error) { 216 size := m.Size() 217 dAtA = make([]byte, size) 218 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 219 if err != nil { 220 return nil, err 221 } 222 return dAtA[:n], nil 223 } 224 225 func (m *Swap) MarshalTo(dAtA []byte) (int, error) { 226 size := m.Size() 227 return m.MarshalToSizedBuffer(dAtA[:size]) 228 } 229 230 func (m *Swap) MarshalToSizedBuffer(dAtA []byte) (int, error) { 231 i := len(dAtA) 232 _ = i 233 var l int 234 _ = l 235 { 236 size := m.SwapRate.Size() 237 i -= size 238 if _, err := m.SwapRate.MarshalTo(dAtA[i:]); err != nil { 239 return 0, err 240 } 241 i = encodeVarintFswap(dAtA, i, uint64(size)) 242 } 243 i-- 244 dAtA[i] = 0x22 245 { 246 size := m.AmountCapForToDenom.Size() 247 i -= size 248 if _, err := m.AmountCapForToDenom.MarshalTo(dAtA[i:]); err != nil { 249 return 0, err 250 } 251 i = encodeVarintFswap(dAtA, i, uint64(size)) 252 } 253 i-- 254 dAtA[i] = 0x1a 255 if len(m.ToDenom) > 0 { 256 i -= len(m.ToDenom) 257 copy(dAtA[i:], m.ToDenom) 258 i = encodeVarintFswap(dAtA, i, uint64(len(m.ToDenom))) 259 i-- 260 dAtA[i] = 0x12 261 } 262 if len(m.FromDenom) > 0 { 263 i -= len(m.FromDenom) 264 copy(dAtA[i:], m.FromDenom) 265 i = encodeVarintFswap(dAtA, i, uint64(len(m.FromDenom))) 266 i-- 267 dAtA[i] = 0xa 268 } 269 return len(dAtA) - i, nil 270 } 271 272 func (m *SwapStats) Marshal() (dAtA []byte, err error) { 273 size := m.Size() 274 dAtA = make([]byte, size) 275 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 276 if err != nil { 277 return nil, err 278 } 279 return dAtA[:n], nil 280 } 281 282 func (m *SwapStats) MarshalTo(dAtA []byte) (int, error) { 283 size := m.Size() 284 return m.MarshalToSizedBuffer(dAtA[:size]) 285 } 286 287 func (m *SwapStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { 288 i := len(dAtA) 289 _ = i 290 var l int 291 _ = l 292 if m.SwapCount != 0 { 293 i = encodeVarintFswap(dAtA, i, uint64(m.SwapCount)) 294 i-- 295 dAtA[i] = 0x8 296 } 297 return len(dAtA) - i, nil 298 } 299 300 func (m *Swapped) Marshal() (dAtA []byte, err error) { 301 size := m.Size() 302 dAtA = make([]byte, size) 303 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 304 if err != nil { 305 return nil, err 306 } 307 return dAtA[:n], nil 308 } 309 310 func (m *Swapped) MarshalTo(dAtA []byte) (int, error) { 311 size := m.Size() 312 return m.MarshalToSizedBuffer(dAtA[:size]) 313 } 314 315 func (m *Swapped) MarshalToSizedBuffer(dAtA []byte) (int, error) { 316 i := len(dAtA) 317 _ = i 318 var l int 319 _ = l 320 { 321 size, err := m.ToCoinAmount.MarshalToSizedBuffer(dAtA[:i]) 322 if err != nil { 323 return 0, err 324 } 325 i -= size 326 i = encodeVarintFswap(dAtA, i, uint64(size)) 327 } 328 i-- 329 dAtA[i] = 0x12 330 { 331 size, err := m.FromCoinAmount.MarshalToSizedBuffer(dAtA[:i]) 332 if err != nil { 333 return 0, err 334 } 335 i -= size 336 i = encodeVarintFswap(dAtA, i, uint64(size)) 337 } 338 i-- 339 dAtA[i] = 0xa 340 return len(dAtA) - i, nil 341 } 342 343 func encodeVarintFswap(dAtA []byte, offset int, v uint64) int { 344 offset -= sovFswap(v) 345 base := offset 346 for v >= 1<<7 { 347 dAtA[offset] = uint8(v&0x7f | 0x80) 348 v >>= 7 349 offset++ 350 } 351 dAtA[offset] = uint8(v) 352 return base 353 } 354 func (m *Swap) Size() (n int) { 355 if m == nil { 356 return 0 357 } 358 var l int 359 _ = l 360 l = len(m.FromDenom) 361 if l > 0 { 362 n += 1 + l + sovFswap(uint64(l)) 363 } 364 l = len(m.ToDenom) 365 if l > 0 { 366 n += 1 + l + sovFswap(uint64(l)) 367 } 368 l = m.AmountCapForToDenom.Size() 369 n += 1 + l + sovFswap(uint64(l)) 370 l = m.SwapRate.Size() 371 n += 1 + l + sovFswap(uint64(l)) 372 return n 373 } 374 375 func (m *SwapStats) Size() (n int) { 376 if m == nil { 377 return 0 378 } 379 var l int 380 _ = l 381 if m.SwapCount != 0 { 382 n += 1 + sovFswap(uint64(m.SwapCount)) 383 } 384 return n 385 } 386 387 func (m *Swapped) Size() (n int) { 388 if m == nil { 389 return 0 390 } 391 var l int 392 _ = l 393 l = m.FromCoinAmount.Size() 394 n += 1 + l + sovFswap(uint64(l)) 395 l = m.ToCoinAmount.Size() 396 n += 1 + l + sovFswap(uint64(l)) 397 return n 398 } 399 400 func sovFswap(x uint64) (n int) { 401 return (math_bits.Len64(x|1) + 6) / 7 402 } 403 func sozFswap(x uint64) (n int) { 404 return sovFswap(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 405 } 406 func (m *Swap) Unmarshal(dAtA []byte) error { 407 l := len(dAtA) 408 iNdEx := 0 409 for iNdEx < l { 410 preIndex := iNdEx 411 var wire uint64 412 for shift := uint(0); ; shift += 7 { 413 if shift >= 64 { 414 return ErrIntOverflowFswap 415 } 416 if iNdEx >= l { 417 return io.ErrUnexpectedEOF 418 } 419 b := dAtA[iNdEx] 420 iNdEx++ 421 wire |= uint64(b&0x7F) << shift 422 if b < 0x80 { 423 break 424 } 425 } 426 fieldNum := int32(wire >> 3) 427 wireType := int(wire & 0x7) 428 if wireType == 4 { 429 return fmt.Errorf("proto: Swap: wiretype end group for non-group") 430 } 431 if fieldNum <= 0 { 432 return fmt.Errorf("proto: Swap: illegal tag %d (wire type %d)", fieldNum, wire) 433 } 434 switch fieldNum { 435 case 1: 436 if wireType != 2 { 437 return fmt.Errorf("proto: wrong wireType = %d for field FromDenom", wireType) 438 } 439 var stringLen uint64 440 for shift := uint(0); ; shift += 7 { 441 if shift >= 64 { 442 return ErrIntOverflowFswap 443 } 444 if iNdEx >= l { 445 return io.ErrUnexpectedEOF 446 } 447 b := dAtA[iNdEx] 448 iNdEx++ 449 stringLen |= uint64(b&0x7F) << shift 450 if b < 0x80 { 451 break 452 } 453 } 454 intStringLen := int(stringLen) 455 if intStringLen < 0 { 456 return ErrInvalidLengthFswap 457 } 458 postIndex := iNdEx + intStringLen 459 if postIndex < 0 { 460 return ErrInvalidLengthFswap 461 } 462 if postIndex > l { 463 return io.ErrUnexpectedEOF 464 } 465 m.FromDenom = string(dAtA[iNdEx:postIndex]) 466 iNdEx = postIndex 467 case 2: 468 if wireType != 2 { 469 return fmt.Errorf("proto: wrong wireType = %d for field ToDenom", wireType) 470 } 471 var stringLen uint64 472 for shift := uint(0); ; shift += 7 { 473 if shift >= 64 { 474 return ErrIntOverflowFswap 475 } 476 if iNdEx >= l { 477 return io.ErrUnexpectedEOF 478 } 479 b := dAtA[iNdEx] 480 iNdEx++ 481 stringLen |= uint64(b&0x7F) << shift 482 if b < 0x80 { 483 break 484 } 485 } 486 intStringLen := int(stringLen) 487 if intStringLen < 0 { 488 return ErrInvalidLengthFswap 489 } 490 postIndex := iNdEx + intStringLen 491 if postIndex < 0 { 492 return ErrInvalidLengthFswap 493 } 494 if postIndex > l { 495 return io.ErrUnexpectedEOF 496 } 497 m.ToDenom = string(dAtA[iNdEx:postIndex]) 498 iNdEx = postIndex 499 case 3: 500 if wireType != 2 { 501 return fmt.Errorf("proto: wrong wireType = %d for field AmountCapForToDenom", wireType) 502 } 503 var stringLen uint64 504 for shift := uint(0); ; shift += 7 { 505 if shift >= 64 { 506 return ErrIntOverflowFswap 507 } 508 if iNdEx >= l { 509 return io.ErrUnexpectedEOF 510 } 511 b := dAtA[iNdEx] 512 iNdEx++ 513 stringLen |= uint64(b&0x7F) << shift 514 if b < 0x80 { 515 break 516 } 517 } 518 intStringLen := int(stringLen) 519 if intStringLen < 0 { 520 return ErrInvalidLengthFswap 521 } 522 postIndex := iNdEx + intStringLen 523 if postIndex < 0 { 524 return ErrInvalidLengthFswap 525 } 526 if postIndex > l { 527 return io.ErrUnexpectedEOF 528 } 529 if err := m.AmountCapForToDenom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 530 return err 531 } 532 iNdEx = postIndex 533 case 4: 534 if wireType != 2 { 535 return fmt.Errorf("proto: wrong wireType = %d for field SwapRate", wireType) 536 } 537 var stringLen uint64 538 for shift := uint(0); ; shift += 7 { 539 if shift >= 64 { 540 return ErrIntOverflowFswap 541 } 542 if iNdEx >= l { 543 return io.ErrUnexpectedEOF 544 } 545 b := dAtA[iNdEx] 546 iNdEx++ 547 stringLen |= uint64(b&0x7F) << shift 548 if b < 0x80 { 549 break 550 } 551 } 552 intStringLen := int(stringLen) 553 if intStringLen < 0 { 554 return ErrInvalidLengthFswap 555 } 556 postIndex := iNdEx + intStringLen 557 if postIndex < 0 { 558 return ErrInvalidLengthFswap 559 } 560 if postIndex > l { 561 return io.ErrUnexpectedEOF 562 } 563 if err := m.SwapRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 564 return err 565 } 566 iNdEx = postIndex 567 default: 568 iNdEx = preIndex 569 skippy, err := skipFswap(dAtA[iNdEx:]) 570 if err != nil { 571 return err 572 } 573 if (skippy < 0) || (iNdEx+skippy) < 0 { 574 return ErrInvalidLengthFswap 575 } 576 if (iNdEx + skippy) > l { 577 return io.ErrUnexpectedEOF 578 } 579 iNdEx += skippy 580 } 581 } 582 583 if iNdEx > l { 584 return io.ErrUnexpectedEOF 585 } 586 return nil 587 } 588 func (m *SwapStats) Unmarshal(dAtA []byte) error { 589 l := len(dAtA) 590 iNdEx := 0 591 for iNdEx < l { 592 preIndex := iNdEx 593 var wire uint64 594 for shift := uint(0); ; shift += 7 { 595 if shift >= 64 { 596 return ErrIntOverflowFswap 597 } 598 if iNdEx >= l { 599 return io.ErrUnexpectedEOF 600 } 601 b := dAtA[iNdEx] 602 iNdEx++ 603 wire |= uint64(b&0x7F) << shift 604 if b < 0x80 { 605 break 606 } 607 } 608 fieldNum := int32(wire >> 3) 609 wireType := int(wire & 0x7) 610 if wireType == 4 { 611 return fmt.Errorf("proto: SwapStats: wiretype end group for non-group") 612 } 613 if fieldNum <= 0 { 614 return fmt.Errorf("proto: SwapStats: illegal tag %d (wire type %d)", fieldNum, wire) 615 } 616 switch fieldNum { 617 case 1: 618 if wireType != 0 { 619 return fmt.Errorf("proto: wrong wireType = %d for field SwapCount", wireType) 620 } 621 m.SwapCount = 0 622 for shift := uint(0); ; shift += 7 { 623 if shift >= 64 { 624 return ErrIntOverflowFswap 625 } 626 if iNdEx >= l { 627 return io.ErrUnexpectedEOF 628 } 629 b := dAtA[iNdEx] 630 iNdEx++ 631 m.SwapCount |= int32(b&0x7F) << shift 632 if b < 0x80 { 633 break 634 } 635 } 636 default: 637 iNdEx = preIndex 638 skippy, err := skipFswap(dAtA[iNdEx:]) 639 if err != nil { 640 return err 641 } 642 if (skippy < 0) || (iNdEx+skippy) < 0 { 643 return ErrInvalidLengthFswap 644 } 645 if (iNdEx + skippy) > l { 646 return io.ErrUnexpectedEOF 647 } 648 iNdEx += skippy 649 } 650 } 651 652 if iNdEx > l { 653 return io.ErrUnexpectedEOF 654 } 655 return nil 656 } 657 func (m *Swapped) Unmarshal(dAtA []byte) error { 658 l := len(dAtA) 659 iNdEx := 0 660 for iNdEx < l { 661 preIndex := iNdEx 662 var wire uint64 663 for shift := uint(0); ; shift += 7 { 664 if shift >= 64 { 665 return ErrIntOverflowFswap 666 } 667 if iNdEx >= l { 668 return io.ErrUnexpectedEOF 669 } 670 b := dAtA[iNdEx] 671 iNdEx++ 672 wire |= uint64(b&0x7F) << shift 673 if b < 0x80 { 674 break 675 } 676 } 677 fieldNum := int32(wire >> 3) 678 wireType := int(wire & 0x7) 679 if wireType == 4 { 680 return fmt.Errorf("proto: Swapped: wiretype end group for non-group") 681 } 682 if fieldNum <= 0 { 683 return fmt.Errorf("proto: Swapped: illegal tag %d (wire type %d)", fieldNum, wire) 684 } 685 switch fieldNum { 686 case 1: 687 if wireType != 2 { 688 return fmt.Errorf("proto: wrong wireType = %d for field FromCoinAmount", wireType) 689 } 690 var msglen int 691 for shift := uint(0); ; shift += 7 { 692 if shift >= 64 { 693 return ErrIntOverflowFswap 694 } 695 if iNdEx >= l { 696 return io.ErrUnexpectedEOF 697 } 698 b := dAtA[iNdEx] 699 iNdEx++ 700 msglen |= int(b&0x7F) << shift 701 if b < 0x80 { 702 break 703 } 704 } 705 if msglen < 0 { 706 return ErrInvalidLengthFswap 707 } 708 postIndex := iNdEx + msglen 709 if postIndex < 0 { 710 return ErrInvalidLengthFswap 711 } 712 if postIndex > l { 713 return io.ErrUnexpectedEOF 714 } 715 if err := m.FromCoinAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 716 return err 717 } 718 iNdEx = postIndex 719 case 2: 720 if wireType != 2 { 721 return fmt.Errorf("proto: wrong wireType = %d for field ToCoinAmount", wireType) 722 } 723 var msglen int 724 for shift := uint(0); ; shift += 7 { 725 if shift >= 64 { 726 return ErrIntOverflowFswap 727 } 728 if iNdEx >= l { 729 return io.ErrUnexpectedEOF 730 } 731 b := dAtA[iNdEx] 732 iNdEx++ 733 msglen |= int(b&0x7F) << shift 734 if b < 0x80 { 735 break 736 } 737 } 738 if msglen < 0 { 739 return ErrInvalidLengthFswap 740 } 741 postIndex := iNdEx + msglen 742 if postIndex < 0 { 743 return ErrInvalidLengthFswap 744 } 745 if postIndex > l { 746 return io.ErrUnexpectedEOF 747 } 748 if err := m.ToCoinAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 749 return err 750 } 751 iNdEx = postIndex 752 default: 753 iNdEx = preIndex 754 skippy, err := skipFswap(dAtA[iNdEx:]) 755 if err != nil { 756 return err 757 } 758 if (skippy < 0) || (iNdEx+skippy) < 0 { 759 return ErrInvalidLengthFswap 760 } 761 if (iNdEx + skippy) > l { 762 return io.ErrUnexpectedEOF 763 } 764 iNdEx += skippy 765 } 766 } 767 768 if iNdEx > l { 769 return io.ErrUnexpectedEOF 770 } 771 return nil 772 } 773 func skipFswap(dAtA []byte) (n int, err error) { 774 l := len(dAtA) 775 iNdEx := 0 776 depth := 0 777 for iNdEx < l { 778 var wire uint64 779 for shift := uint(0); ; shift += 7 { 780 if shift >= 64 { 781 return 0, ErrIntOverflowFswap 782 } 783 if iNdEx >= l { 784 return 0, io.ErrUnexpectedEOF 785 } 786 b := dAtA[iNdEx] 787 iNdEx++ 788 wire |= (uint64(b) & 0x7F) << shift 789 if b < 0x80 { 790 break 791 } 792 } 793 wireType := int(wire & 0x7) 794 switch wireType { 795 case 0: 796 for shift := uint(0); ; shift += 7 { 797 if shift >= 64 { 798 return 0, ErrIntOverflowFswap 799 } 800 if iNdEx >= l { 801 return 0, io.ErrUnexpectedEOF 802 } 803 iNdEx++ 804 if dAtA[iNdEx-1] < 0x80 { 805 break 806 } 807 } 808 case 1: 809 iNdEx += 8 810 case 2: 811 var length int 812 for shift := uint(0); ; shift += 7 { 813 if shift >= 64 { 814 return 0, ErrIntOverflowFswap 815 } 816 if iNdEx >= l { 817 return 0, io.ErrUnexpectedEOF 818 } 819 b := dAtA[iNdEx] 820 iNdEx++ 821 length |= (int(b) & 0x7F) << shift 822 if b < 0x80 { 823 break 824 } 825 } 826 if length < 0 { 827 return 0, ErrInvalidLengthFswap 828 } 829 iNdEx += length 830 case 3: 831 depth++ 832 case 4: 833 if depth == 0 { 834 return 0, ErrUnexpectedEndOfGroupFswap 835 } 836 depth-- 837 case 5: 838 iNdEx += 4 839 default: 840 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 841 } 842 if iNdEx < 0 { 843 return 0, ErrInvalidLengthFswap 844 } 845 if depth == 0 { 846 return iNdEx, nil 847 } 848 } 849 return 0, io.ErrUnexpectedEOF 850 } 851 852 var ( 853 ErrInvalidLengthFswap = fmt.Errorf("proto: negative length found during unmarshaling") 854 ErrIntOverflowFswap = fmt.Errorf("proto: integer overflow") 855 ErrUnexpectedEndOfGroupFswap = fmt.Errorf("proto: unexpected end of group") 856 )