github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/codec/types/any.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: google/protobuf/any.proto 3 4 package types 5 6 import ( 7 bytes "bytes" 8 fmt "fmt" 9 _ "github.com/gogo/protobuf/gogoproto" 10 proto "github.com/gogo/protobuf/proto" 11 io "io" 12 math "math" 13 math_bits "math/bits" 14 reflect "reflect" 15 strings "strings" 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 func (m *Any) Reset() { *m = Any{} } 30 func (*Any) ProtoMessage() {} 31 func (*Any) Descriptor() ([]byte, []int) { 32 return fileDescriptor_b53526c13ae22eb4, []int{0} 33 } 34 func (*Any) XXX_WellKnownType() string { return "Any" } 35 func (m *Any) XXX_Unmarshal(b []byte) error { 36 return m.Unmarshal(b) 37 } 38 func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 39 if deterministic { 40 return xxx_messageInfo_Any.Marshal(b, m, deterministic) 41 } else { 42 b = b[:cap(b)] 43 n, err := m.MarshalToSizedBuffer(b) 44 if err != nil { 45 return nil, err 46 } 47 return b[:n], nil 48 } 49 } 50 func (m *Any) XXX_Merge(src proto.Message) { 51 xxx_messageInfo_Any.Merge(m, src) 52 } 53 func (m *Any) XXX_Size() int { 54 return m.Size() 55 } 56 func (m *Any) XXX_DiscardUnknown() { 57 xxx_messageInfo_Any.DiscardUnknown(m) 58 } 59 60 var xxx_messageInfo_Any proto.InternalMessageInfo 61 62 func (m *Any) GetTypeUrl() string { 63 if m != nil { 64 return m.TypeUrl 65 } 66 return "" 67 } 68 69 func (m *Any) GetValue() []byte { 70 if m != nil { 71 return m.Value 72 } 73 return nil 74 } 75 76 func (*Any) XXX_MessageName() string { 77 return "google.protobuf.Any" 78 } 79 func init() { 80 } 81 82 func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) } 83 84 var fileDescriptor_b53526c13ae22eb4 = []byte{ 85 // 235 bytes of a gzipped FileDescriptorProto 86 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, 87 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4, 88 0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x30, 89 0x4f, 0x1f, 0xc4, 0x82, 0x48, 0x28, 0xd9, 0x70, 0x31, 0x3b, 0xe6, 0x55, 0x0a, 0x49, 0x72, 0x71, 90 0x94, 0x54, 0x16, 0xa4, 0xc6, 0x97, 0x16, 0xe5, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xb1, 91 0x83, 0xf8, 0xa1, 0x45, 0x39, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c, 92 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x10, 0x8e, 0x15, 0xcb, 0x87, 0x85, 0xf2, 0x0c, 0x4e, 0xcd, 0x8c, 93 0x37, 0x1e, 0xca, 0x31, 0x7c, 0x78, 0x28, 0xc7, 0xf8, 0xe3, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 94 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 95 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x80, 0xc4, 0x1f, 0xcb, 0x31, 0x1e, 0x78, 0x2c, 0xc7, 96 0x70, 0xe2, 0xb1, 0x1c, 0x23, 0x97, 0x70, 0x72, 0x7e, 0xae, 0x1e, 0x9a, 0xfb, 0x9c, 0x38, 0x1c, 97 0xf3, 0x2a, 0x03, 0x40, 0x9c, 0x00, 0xc6, 0x28, 0x56, 0x90, 0xe5, 0xc5, 0x8b, 0x98, 0x98, 0xdd, 98 0x03, 0x9c, 0x56, 0x31, 0xc9, 0xb9, 0x43, 0x94, 0x06, 0x40, 0x95, 0xea, 0x85, 0xa7, 0xe6, 0xe4, 99 0x78, 0xe7, 0xe5, 0x97, 0xe7, 0x85, 0x80, 0x94, 0x25, 0xb1, 0x81, 0xcd, 0x30, 0x06, 0x04, 0x00, 100 0x00, 0xff, 0xff, 0xe6, 0xfb, 0xa0, 0x21, 0x0e, 0x01, 0x00, 0x00, 101 } 102 103 func (this *Any) Compare(that interface{}) int { 104 if that == nil { 105 if this == nil { 106 return 0 107 } 108 return 1 109 } 110 111 that1, ok := that.(*Any) 112 if !ok { 113 that2, ok := that.(Any) 114 if ok { 115 that1 = &that2 116 } else { 117 return 1 118 } 119 } 120 if that1 == nil { 121 if this == nil { 122 return 0 123 } 124 return 1 125 } else if this == nil { 126 return -1 127 } 128 if this.TypeUrl != that1.TypeUrl { 129 if this.TypeUrl < that1.TypeUrl { 130 return -1 131 } 132 return 1 133 } 134 if c := bytes.Compare(this.Value, that1.Value); c != 0 { 135 return c 136 } 137 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 138 return c 139 } 140 return 0 141 } 142 func (this *Any) Equal(that interface{}) bool { 143 if that == nil { 144 return this == nil 145 } 146 147 that1, ok := that.(*Any) 148 if !ok { 149 that2, ok := that.(Any) 150 if ok { 151 that1 = &that2 152 } else { 153 return false 154 } 155 } 156 if that1 == nil { 157 return this == nil 158 } else if this == nil { 159 return false 160 } 161 if this.TypeUrl != that1.TypeUrl { 162 return false 163 } 164 if !bytes.Equal(this.Value, that1.Value) { 165 return false 166 } 167 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 168 return false 169 } 170 return true 171 } 172 func (this *Any) GoString() string { 173 if this == nil { 174 return "nil" 175 } 176 s := make([]string, 0, 6) 177 s = append(s, "&types.Any{") 178 s = append(s, "TypeUrl: "+fmt.Sprintf("%#v", this.TypeUrl)+",\n") 179 s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") 180 if this.XXX_unrecognized != nil { 181 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 182 } 183 s = append(s, "}") 184 return strings.Join(s, "") 185 } 186 func valueToGoStringAny(v interface{}, typ string) string { 187 rv := reflect.ValueOf(v) 188 if rv.IsNil() { 189 return "nil" 190 } 191 pv := reflect.Indirect(rv).Interface() 192 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 193 } 194 func (m *Any) Marshal() (dAtA []byte, err error) { 195 size := m.Size() 196 dAtA = make([]byte, size) 197 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 198 if err != nil { 199 return nil, err 200 } 201 return dAtA[:n], nil 202 } 203 204 func (m *Any) MarshalTo(dAtA []byte) (int, error) { 205 size := m.Size() 206 return m.MarshalToSizedBuffer(dAtA[:size]) 207 } 208 209 func (m *Any) MarshalToSizedBuffer(dAtA []byte) (int, error) { 210 i := len(dAtA) 211 _ = i 212 var l int 213 _ = l 214 if m.XXX_unrecognized != nil { 215 i -= len(m.XXX_unrecognized) 216 copy(dAtA[i:], m.XXX_unrecognized) 217 } 218 if len(m.Value) > 0 { 219 i -= len(m.Value) 220 copy(dAtA[i:], m.Value) 221 i = encodeVarintAny(dAtA, i, uint64(len(m.Value))) 222 i-- 223 dAtA[i] = 0x12 224 } 225 if len(m.TypeUrl) > 0 { 226 i -= len(m.TypeUrl) 227 copy(dAtA[i:], m.TypeUrl) 228 i = encodeVarintAny(dAtA, i, uint64(len(m.TypeUrl))) 229 i-- 230 dAtA[i] = 0xa 231 } 232 return len(dAtA) - i, nil 233 } 234 235 func encodeVarintAny(dAtA []byte, offset int, v uint64) int { 236 offset -= sovAny(v) 237 base := offset 238 for v >= 1<<7 { 239 dAtA[offset] = uint8(v&0x7f | 0x80) 240 v >>= 7 241 offset++ 242 } 243 dAtA[offset] = uint8(v) 244 return base 245 } 246 func NewPopulatedAny(r randyAny, easy bool) *Any { 247 this := &Any{} 248 this.TypeUrl = string(randStringAny(r)) 249 v1 := r.Intn(100) 250 this.Value = make([]byte, v1) 251 for i := 0; i < v1; i++ { 252 this.Value[i] = byte(r.Intn(256)) 253 } 254 if !easy && r.Intn(10) != 0 { 255 this.XXX_unrecognized = randUnrecognizedAny(r, 3) 256 } 257 return this 258 } 259 260 type randyAny interface { 261 Float32() float32 262 Float64() float64 263 Int63() int64 264 Int31() int32 265 Uint32() uint32 266 Intn(n int) int 267 } 268 269 func randUTF8RuneAny(r randyAny) rune { 270 ru := r.Intn(62) 271 if ru < 10 { 272 return rune(ru + 48) 273 } else if ru < 36 { 274 return rune(ru + 55) 275 } 276 return rune(ru + 61) 277 } 278 func randStringAny(r randyAny) string { 279 v2 := r.Intn(100) 280 tmps := make([]rune, v2) 281 for i := 0; i < v2; i++ { 282 tmps[i] = randUTF8RuneAny(r) 283 } 284 return string(tmps) 285 } 286 func randUnrecognizedAny(r randyAny, maxFieldNumber int) (dAtA []byte) { 287 l := r.Intn(5) 288 for i := 0; i < l; i++ { 289 wire := r.Intn(4) 290 if wire == 3 { 291 wire = 5 292 } 293 fieldNumber := maxFieldNumber + r.Intn(100) 294 dAtA = randFieldAny(dAtA, r, fieldNumber, wire) 295 } 296 return dAtA 297 } 298 func randFieldAny(dAtA []byte, r randyAny, fieldNumber int, wire int) []byte { 299 key := uint32(fieldNumber)<<3 | uint32(wire) 300 switch wire { 301 case 0: 302 dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) 303 v3 := r.Int63() 304 if r.Intn(2) == 0 { 305 v3 *= -1 306 } 307 dAtA = encodeVarintPopulateAny(dAtA, uint64(v3)) 308 case 1: 309 dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) 310 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 311 case 2: 312 dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) 313 ll := r.Intn(100) 314 dAtA = encodeVarintPopulateAny(dAtA, uint64(ll)) 315 for j := 0; j < ll; j++ { 316 dAtA = append(dAtA, byte(r.Intn(256))) 317 } 318 default: 319 dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) 320 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 321 } 322 return dAtA 323 } 324 func encodeVarintPopulateAny(dAtA []byte, v uint64) []byte { 325 for v >= 1<<7 { 326 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) 327 v >>= 7 328 } 329 dAtA = append(dAtA, uint8(v)) 330 return dAtA 331 } 332 func (m *Any) Size() (n int) { 333 if m == nil { 334 return 0 335 } 336 var l int 337 _ = l 338 l = len(m.TypeUrl) 339 if l > 0 { 340 n += 1 + l + sovAny(uint64(l)) 341 } 342 l = len(m.Value) 343 if l > 0 { 344 n += 1 + l + sovAny(uint64(l)) 345 } 346 if m.XXX_unrecognized != nil { 347 n += len(m.XXX_unrecognized) 348 } 349 return n 350 } 351 352 func sovAny(x uint64) (n int) { 353 return (math_bits.Len64(x|1) + 6) / 7 354 } 355 func sozAny(x uint64) (n int) { 356 return sovAny(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 357 } 358 func (this *Any) String() string { 359 if this == nil { 360 return "nil" 361 } 362 s := strings.Join([]string{`&Any{`, 363 `TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`, 364 `Value:` + fmt.Sprintf("%v", this.Value) + `,`, 365 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 366 `}`, 367 }, "") 368 return s 369 } 370 func valueToStringAny(v interface{}) string { 371 rv := reflect.ValueOf(v) 372 if rv.IsNil() { 373 return "nil" 374 } 375 pv := reflect.Indirect(rv).Interface() 376 return fmt.Sprintf("*%v", pv) 377 } 378 func (m *Any) Unmarshal(dAtA []byte) error { 379 l := len(dAtA) 380 iNdEx := 0 381 for iNdEx < l { 382 preIndex := iNdEx 383 var wire uint64 384 for shift := uint(0); ; shift += 7 { 385 if shift >= 64 { 386 return ErrIntOverflowAny 387 } 388 if iNdEx >= l { 389 return io.ErrUnexpectedEOF 390 } 391 b := dAtA[iNdEx] 392 iNdEx++ 393 wire |= uint64(b&0x7F) << shift 394 if b < 0x80 { 395 break 396 } 397 } 398 fieldNum := int32(wire >> 3) 399 wireType := int(wire & 0x7) 400 if wireType == 4 { 401 return fmt.Errorf("proto: Any: wiretype end group for non-group") 402 } 403 if fieldNum <= 0 { 404 return fmt.Errorf("proto: Any: illegal tag %d (wire type %d)", fieldNum, wire) 405 } 406 switch fieldNum { 407 case 1: 408 if wireType != 2 { 409 return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) 410 } 411 var stringLen uint64 412 for shift := uint(0); ; shift += 7 { 413 if shift >= 64 { 414 return ErrIntOverflowAny 415 } 416 if iNdEx >= l { 417 return io.ErrUnexpectedEOF 418 } 419 b := dAtA[iNdEx] 420 iNdEx++ 421 stringLen |= uint64(b&0x7F) << shift 422 if b < 0x80 { 423 break 424 } 425 } 426 intStringLen := int(stringLen) 427 if intStringLen < 0 { 428 return ErrInvalidLengthAny 429 } 430 postIndex := iNdEx + intStringLen 431 if postIndex < 0 { 432 return ErrInvalidLengthAny 433 } 434 if postIndex > l { 435 return io.ErrUnexpectedEOF 436 } 437 m.TypeUrl = string(dAtA[iNdEx:postIndex]) 438 iNdEx = postIndex 439 case 2: 440 if wireType != 2 { 441 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 442 } 443 var byteLen int 444 for shift := uint(0); ; shift += 7 { 445 if shift >= 64 { 446 return ErrIntOverflowAny 447 } 448 if iNdEx >= l { 449 return io.ErrUnexpectedEOF 450 } 451 b := dAtA[iNdEx] 452 iNdEx++ 453 byteLen |= int(b&0x7F) << shift 454 if b < 0x80 { 455 break 456 } 457 } 458 if byteLen < 0 { 459 return ErrInvalidLengthAny 460 } 461 postIndex := iNdEx + byteLen 462 if postIndex < 0 { 463 return ErrInvalidLengthAny 464 } 465 if postIndex > l { 466 return io.ErrUnexpectedEOF 467 } 468 m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) 469 if m.Value == nil { 470 m.Value = []byte{} 471 } 472 iNdEx = postIndex 473 default: 474 iNdEx = preIndex 475 skippy, err := skipAny(dAtA[iNdEx:]) 476 if err != nil { 477 return err 478 } 479 if skippy < 0 { 480 return ErrInvalidLengthAny 481 } 482 if (iNdEx + skippy) < 0 { 483 return ErrInvalidLengthAny 484 } 485 if (iNdEx + skippy) > l { 486 return io.ErrUnexpectedEOF 487 } 488 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 489 iNdEx += skippy 490 } 491 } 492 493 if iNdEx > l { 494 return io.ErrUnexpectedEOF 495 } 496 return nil 497 } 498 func skipAny(dAtA []byte) (n int, err error) { 499 l := len(dAtA) 500 iNdEx := 0 501 depth := 0 502 for iNdEx < l { 503 var wire uint64 504 for shift := uint(0); ; shift += 7 { 505 if shift >= 64 { 506 return 0, ErrIntOverflowAny 507 } 508 if iNdEx >= l { 509 return 0, io.ErrUnexpectedEOF 510 } 511 b := dAtA[iNdEx] 512 iNdEx++ 513 wire |= (uint64(b) & 0x7F) << shift 514 if b < 0x80 { 515 break 516 } 517 } 518 wireType := int(wire & 0x7) 519 switch wireType { 520 case 0: 521 for shift := uint(0); ; shift += 7 { 522 if shift >= 64 { 523 return 0, ErrIntOverflowAny 524 } 525 if iNdEx >= l { 526 return 0, io.ErrUnexpectedEOF 527 } 528 iNdEx++ 529 if dAtA[iNdEx-1] < 0x80 { 530 break 531 } 532 } 533 case 1: 534 iNdEx += 8 535 case 2: 536 var length int 537 for shift := uint(0); ; shift += 7 { 538 if shift >= 64 { 539 return 0, ErrIntOverflowAny 540 } 541 if iNdEx >= l { 542 return 0, io.ErrUnexpectedEOF 543 } 544 b := dAtA[iNdEx] 545 iNdEx++ 546 length |= (int(b) & 0x7F) << shift 547 if b < 0x80 { 548 break 549 } 550 } 551 if length < 0 { 552 return 0, ErrInvalidLengthAny 553 } 554 iNdEx += length 555 case 3: 556 depth++ 557 case 4: 558 if depth == 0 { 559 return 0, ErrUnexpectedEndOfGroupAny 560 } 561 depth-- 562 case 5: 563 iNdEx += 4 564 default: 565 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 566 } 567 if iNdEx < 0 { 568 return 0, ErrInvalidLengthAny 569 } 570 if depth == 0 { 571 return iNdEx, nil 572 } 573 } 574 return 0, io.ErrUnexpectedEOF 575 } 576 577 var ( 578 ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling") 579 ErrIntOverflowAny = fmt.Errorf("proto: integer overflow") 580 ErrUnexpectedEndOfGroupAny = fmt.Errorf("proto: unexpected end of group") 581 )