github.com/Finschia/finschia-sdk@v0.48.1/store/types/commit_info.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/base/store/v1beta1/commit_info.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 _ "github.com/gogo/protobuf/gogoproto" 9 proto "github.com/gogo/protobuf/proto" 10 io "io" 11 math "math" 12 math_bits "math/bits" 13 ) 14 15 // Reference imports to suppress errors if they are not otherwise used. 16 var _ = proto.Marshal 17 var _ = fmt.Errorf 18 var _ = math.Inf 19 20 // This is a compile-time assertion to ensure that this generated file 21 // is compatible with the proto package it is being compiled against. 22 // A compilation error at this line likely means your copy of the 23 // proto package needs to be updated. 24 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 25 26 // CommitInfo defines commit information used by the multi-store when committing 27 // a version/height. 28 type CommitInfo struct { 29 Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` 30 StoreInfos []StoreInfo `protobuf:"bytes,2,rep,name=store_infos,json=storeInfos,proto3" json:"store_infos"` 31 } 32 33 func (m *CommitInfo) Reset() { *m = CommitInfo{} } 34 func (m *CommitInfo) String() string { return proto.CompactTextString(m) } 35 func (*CommitInfo) ProtoMessage() {} 36 func (*CommitInfo) Descriptor() ([]byte, []int) { 37 return fileDescriptor_83f4097f6265b52f, []int{0} 38 } 39 func (m *CommitInfo) XXX_Unmarshal(b []byte) error { 40 return m.Unmarshal(b) 41 } 42 func (m *CommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 43 if deterministic { 44 return xxx_messageInfo_CommitInfo.Marshal(b, m, deterministic) 45 } else { 46 b = b[:cap(b)] 47 n, err := m.MarshalToSizedBuffer(b) 48 if err != nil { 49 return nil, err 50 } 51 return b[:n], nil 52 } 53 } 54 func (m *CommitInfo) XXX_Merge(src proto.Message) { 55 xxx_messageInfo_CommitInfo.Merge(m, src) 56 } 57 func (m *CommitInfo) XXX_Size() int { 58 return m.Size() 59 } 60 func (m *CommitInfo) XXX_DiscardUnknown() { 61 xxx_messageInfo_CommitInfo.DiscardUnknown(m) 62 } 63 64 var xxx_messageInfo_CommitInfo proto.InternalMessageInfo 65 66 func (m *CommitInfo) GetVersion() int64 { 67 if m != nil { 68 return m.Version 69 } 70 return 0 71 } 72 73 func (m *CommitInfo) GetStoreInfos() []StoreInfo { 74 if m != nil { 75 return m.StoreInfos 76 } 77 return nil 78 } 79 80 // StoreInfo defines store-specific commit information. It contains a reference 81 // between a store name and the commit ID. 82 type StoreInfo struct { 83 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 84 CommitId CommitID `protobuf:"bytes,2,opt,name=commit_id,json=commitId,proto3" json:"commit_id"` 85 } 86 87 func (m *StoreInfo) Reset() { *m = StoreInfo{} } 88 func (m *StoreInfo) String() string { return proto.CompactTextString(m) } 89 func (*StoreInfo) ProtoMessage() {} 90 func (*StoreInfo) Descriptor() ([]byte, []int) { 91 return fileDescriptor_83f4097f6265b52f, []int{1} 92 } 93 func (m *StoreInfo) XXX_Unmarshal(b []byte) error { 94 return m.Unmarshal(b) 95 } 96 func (m *StoreInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 97 if deterministic { 98 return xxx_messageInfo_StoreInfo.Marshal(b, m, deterministic) 99 } else { 100 b = b[:cap(b)] 101 n, err := m.MarshalToSizedBuffer(b) 102 if err != nil { 103 return nil, err 104 } 105 return b[:n], nil 106 } 107 } 108 func (m *StoreInfo) XXX_Merge(src proto.Message) { 109 xxx_messageInfo_StoreInfo.Merge(m, src) 110 } 111 func (m *StoreInfo) XXX_Size() int { 112 return m.Size() 113 } 114 func (m *StoreInfo) XXX_DiscardUnknown() { 115 xxx_messageInfo_StoreInfo.DiscardUnknown(m) 116 } 117 118 var xxx_messageInfo_StoreInfo proto.InternalMessageInfo 119 120 func (m *StoreInfo) GetName() string { 121 if m != nil { 122 return m.Name 123 } 124 return "" 125 } 126 127 func (m *StoreInfo) GetCommitId() CommitID { 128 if m != nil { 129 return m.CommitId 130 } 131 return CommitID{} 132 } 133 134 // CommitID defines the committment information when a specific store is 135 // committed. 136 type CommitID struct { 137 Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` 138 Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` 139 } 140 141 func (m *CommitID) Reset() { *m = CommitID{} } 142 func (*CommitID) ProtoMessage() {} 143 func (*CommitID) Descriptor() ([]byte, []int) { 144 return fileDescriptor_83f4097f6265b52f, []int{2} 145 } 146 func (m *CommitID) XXX_Unmarshal(b []byte) error { 147 return m.Unmarshal(b) 148 } 149 func (m *CommitID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 150 if deterministic { 151 return xxx_messageInfo_CommitID.Marshal(b, m, deterministic) 152 } else { 153 b = b[:cap(b)] 154 n, err := m.MarshalToSizedBuffer(b) 155 if err != nil { 156 return nil, err 157 } 158 return b[:n], nil 159 } 160 } 161 func (m *CommitID) XXX_Merge(src proto.Message) { 162 xxx_messageInfo_CommitID.Merge(m, src) 163 } 164 func (m *CommitID) XXX_Size() int { 165 return m.Size() 166 } 167 func (m *CommitID) XXX_DiscardUnknown() { 168 xxx_messageInfo_CommitID.DiscardUnknown(m) 169 } 170 171 var xxx_messageInfo_CommitID proto.InternalMessageInfo 172 173 func (m *CommitID) GetVersion() int64 { 174 if m != nil { 175 return m.Version 176 } 177 return 0 178 } 179 180 func (m *CommitID) GetHash() []byte { 181 if m != nil { 182 return m.Hash 183 } 184 return nil 185 } 186 187 func init() { 188 proto.RegisterType((*CommitInfo)(nil), "cosmos.base.store.v1beta1.CommitInfo") 189 proto.RegisterType((*StoreInfo)(nil), "cosmos.base.store.v1beta1.StoreInfo") 190 proto.RegisterType((*CommitID)(nil), "cosmos.base.store.v1beta1.CommitID") 191 } 192 193 func init() { 194 proto.RegisterFile("cosmos/base/store/v1beta1/commit_info.proto", fileDescriptor_83f4097f6265b52f) 195 } 196 197 var fileDescriptor_83f4097f6265b52f = []byte{ 198 // 306 bytes of a gzipped FileDescriptorProto 199 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x31, 0x4f, 0xc3, 0x30, 200 0x10, 0x85, 0xe3, 0x36, 0x82, 0xd6, 0x65, 0xb2, 0x18, 0x02, 0x83, 0x5b, 0x15, 0x86, 0x4a, 0x80, 201 0xad, 0x96, 0x8d, 0x81, 0xa1, 0xa0, 0x4a, 0x15, 0x5b, 0xd8, 0x58, 0x50, 0x92, 0xba, 0x89, 0x85, 202 0x92, 0xab, 0x7a, 0xa6, 0x12, 0xff, 0x82, 0x91, 0x91, 0x9f, 0xd3, 0xb1, 0x23, 0x13, 0x42, 0xc9, 203 0x1f, 0x41, 0x71, 0x12, 0x36, 0xba, 0xbd, 0xcb, 0xbd, 0x7b, 0x9f, 0x5e, 0x4c, 0x2f, 0x22, 0xc0, 204 0x14, 0x50, 0x86, 0x01, 0x2a, 0x89, 0x06, 0xd6, 0x4a, 0x6e, 0xc6, 0xa1, 0x32, 0xc1, 0x58, 0x46, 205 0x90, 0xa6, 0xda, 0x3c, 0xeb, 0x6c, 0x09, 0x62, 0xb5, 0x06, 0x03, 0xec, 0xa4, 0x32, 0x8b, 0xd2, 206 0x2c, 0xac, 0x59, 0xd4, 0xe6, 0xd3, 0xe3, 0x18, 0x62, 0xb0, 0x2e, 0x59, 0xaa, 0xea, 0x60, 0x88, 207 0x94, 0xde, 0xd9, 0x94, 0x79, 0xb6, 0x04, 0xe6, 0xd1, 0xc3, 0x8d, 0x5a, 0xa3, 0x86, 0xcc, 0x23, 208 0x03, 0x32, 0x6a, 0xfb, 0xcd, 0xc8, 0x1e, 0x68, 0xcf, 0xc6, 0x59, 0x18, 0x7a, 0xad, 0x41, 0x7b, 209 0xd4, 0x9b, 0x9c, 0x8b, 0x7f, 0x71, 0xe2, 0xb1, 0x9c, 0xca, 0xd0, 0xa9, 0xbb, 0xfd, 0xee, 0x3b, 210 0x3e, 0xc5, 0xe6, 0x03, 0x0e, 0x63, 0xda, 0xfd, 0x5b, 0x33, 0x46, 0xdd, 0x2c, 0x48, 0x95, 0x05, 211 0x76, 0x7d, 0xab, 0xd9, 0x8c, 0x76, 0x9b, 0x6e, 0x0b, 0xaf, 0x35, 0x20, 0xa3, 0xde, 0xe4, 0x6c, 212 0x0f, 0xab, 0x6e, 0x70, 0x5f, 0xa3, 0x3a, 0xd5, 0xed, 0x7c, 0x31, 0xbc, 0xa5, 0x9d, 0x66, 0xb7, 213 0xa7, 0x1b, 0xa3, 0x6e, 0x12, 0x60, 0x62, 0x41, 0x47, 0xbe, 0xd5, 0x37, 0xee, 0xc7, 0x67, 0xdf, 214 0x99, 0xce, 0xb6, 0x39, 0x27, 0xbb, 0x9c, 0x93, 0x9f, 0x9c, 0x93, 0xf7, 0x82, 0x3b, 0xbb, 0x82, 215 0x3b, 0x5f, 0x05, 0x77, 0x9e, 0x2e, 0x63, 0x6d, 0x92, 0xd7, 0x50, 0x44, 0x90, 0xca, 0x99, 0xce, 216 0x30, 0x4a, 0x74, 0x20, 0x97, 0xb5, 0xb8, 0xc2, 0xc5, 0x4b, 0xfd, 0x54, 0xe6, 0x6d, 0xa5, 0x30, 217 0x3c, 0xb0, 0x3f, 0xfb, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x69, 0x85, 0x32, 0xcc, 0x01, 218 0x00, 0x00, 219 } 220 221 func (m *CommitInfo) Marshal() (dAtA []byte, err error) { 222 size := m.Size() 223 dAtA = make([]byte, size) 224 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 225 if err != nil { 226 return nil, err 227 } 228 return dAtA[:n], nil 229 } 230 231 func (m *CommitInfo) MarshalTo(dAtA []byte) (int, error) { 232 size := m.Size() 233 return m.MarshalToSizedBuffer(dAtA[:size]) 234 } 235 236 func (m *CommitInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { 237 i := len(dAtA) 238 _ = i 239 var l int 240 _ = l 241 if len(m.StoreInfos) > 0 { 242 for iNdEx := len(m.StoreInfos) - 1; iNdEx >= 0; iNdEx-- { 243 { 244 size, err := m.StoreInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 245 if err != nil { 246 return 0, err 247 } 248 i -= size 249 i = encodeVarintCommitInfo(dAtA, i, uint64(size)) 250 } 251 i-- 252 dAtA[i] = 0x12 253 } 254 } 255 if m.Version != 0 { 256 i = encodeVarintCommitInfo(dAtA, i, uint64(m.Version)) 257 i-- 258 dAtA[i] = 0x8 259 } 260 return len(dAtA) - i, nil 261 } 262 263 func (m *StoreInfo) Marshal() (dAtA []byte, err error) { 264 size := m.Size() 265 dAtA = make([]byte, size) 266 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 267 if err != nil { 268 return nil, err 269 } 270 return dAtA[:n], nil 271 } 272 273 func (m *StoreInfo) MarshalTo(dAtA []byte) (int, error) { 274 size := m.Size() 275 return m.MarshalToSizedBuffer(dAtA[:size]) 276 } 277 278 func (m *StoreInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { 279 i := len(dAtA) 280 _ = i 281 var l int 282 _ = l 283 { 284 size, err := m.CommitId.MarshalToSizedBuffer(dAtA[:i]) 285 if err != nil { 286 return 0, err 287 } 288 i -= size 289 i = encodeVarintCommitInfo(dAtA, i, uint64(size)) 290 } 291 i-- 292 dAtA[i] = 0x12 293 if len(m.Name) > 0 { 294 i -= len(m.Name) 295 copy(dAtA[i:], m.Name) 296 i = encodeVarintCommitInfo(dAtA, i, uint64(len(m.Name))) 297 i-- 298 dAtA[i] = 0xa 299 } 300 return len(dAtA) - i, nil 301 } 302 303 func (m *CommitID) Marshal() (dAtA []byte, err error) { 304 size := m.Size() 305 dAtA = make([]byte, size) 306 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 307 if err != nil { 308 return nil, err 309 } 310 return dAtA[:n], nil 311 } 312 313 func (m *CommitID) MarshalTo(dAtA []byte) (int, error) { 314 size := m.Size() 315 return m.MarshalToSizedBuffer(dAtA[:size]) 316 } 317 318 func (m *CommitID) MarshalToSizedBuffer(dAtA []byte) (int, error) { 319 i := len(dAtA) 320 _ = i 321 var l int 322 _ = l 323 if len(m.Hash) > 0 { 324 i -= len(m.Hash) 325 copy(dAtA[i:], m.Hash) 326 i = encodeVarintCommitInfo(dAtA, i, uint64(len(m.Hash))) 327 i-- 328 dAtA[i] = 0x12 329 } 330 if m.Version != 0 { 331 i = encodeVarintCommitInfo(dAtA, i, uint64(m.Version)) 332 i-- 333 dAtA[i] = 0x8 334 } 335 return len(dAtA) - i, nil 336 } 337 338 func encodeVarintCommitInfo(dAtA []byte, offset int, v uint64) int { 339 offset -= sovCommitInfo(v) 340 base := offset 341 for v >= 1<<7 { 342 dAtA[offset] = uint8(v&0x7f | 0x80) 343 v >>= 7 344 offset++ 345 } 346 dAtA[offset] = uint8(v) 347 return base 348 } 349 func (m *CommitInfo) Size() (n int) { 350 if m == nil { 351 return 0 352 } 353 var l int 354 _ = l 355 if m.Version != 0 { 356 n += 1 + sovCommitInfo(uint64(m.Version)) 357 } 358 if len(m.StoreInfos) > 0 { 359 for _, e := range m.StoreInfos { 360 l = e.Size() 361 n += 1 + l + sovCommitInfo(uint64(l)) 362 } 363 } 364 return n 365 } 366 367 func (m *StoreInfo) Size() (n int) { 368 if m == nil { 369 return 0 370 } 371 var l int 372 _ = l 373 l = len(m.Name) 374 if l > 0 { 375 n += 1 + l + sovCommitInfo(uint64(l)) 376 } 377 l = m.CommitId.Size() 378 n += 1 + l + sovCommitInfo(uint64(l)) 379 return n 380 } 381 382 func (m *CommitID) Size() (n int) { 383 if m == nil { 384 return 0 385 } 386 var l int 387 _ = l 388 if m.Version != 0 { 389 n += 1 + sovCommitInfo(uint64(m.Version)) 390 } 391 l = len(m.Hash) 392 if l > 0 { 393 n += 1 + l + sovCommitInfo(uint64(l)) 394 } 395 return n 396 } 397 398 func sovCommitInfo(x uint64) (n int) { 399 return (math_bits.Len64(x|1) + 6) / 7 400 } 401 func sozCommitInfo(x uint64) (n int) { 402 return sovCommitInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 403 } 404 func (m *CommitInfo) Unmarshal(dAtA []byte) error { 405 l := len(dAtA) 406 iNdEx := 0 407 for iNdEx < l { 408 preIndex := iNdEx 409 var wire uint64 410 for shift := uint(0); ; shift += 7 { 411 if shift >= 64 { 412 return ErrIntOverflowCommitInfo 413 } 414 if iNdEx >= l { 415 return io.ErrUnexpectedEOF 416 } 417 b := dAtA[iNdEx] 418 iNdEx++ 419 wire |= uint64(b&0x7F) << shift 420 if b < 0x80 { 421 break 422 } 423 } 424 fieldNum := int32(wire >> 3) 425 wireType := int(wire & 0x7) 426 if wireType == 4 { 427 return fmt.Errorf("proto: CommitInfo: wiretype end group for non-group") 428 } 429 if fieldNum <= 0 { 430 return fmt.Errorf("proto: CommitInfo: illegal tag %d (wire type %d)", fieldNum, wire) 431 } 432 switch fieldNum { 433 case 1: 434 if wireType != 0 { 435 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 436 } 437 m.Version = 0 438 for shift := uint(0); ; shift += 7 { 439 if shift >= 64 { 440 return ErrIntOverflowCommitInfo 441 } 442 if iNdEx >= l { 443 return io.ErrUnexpectedEOF 444 } 445 b := dAtA[iNdEx] 446 iNdEx++ 447 m.Version |= int64(b&0x7F) << shift 448 if b < 0x80 { 449 break 450 } 451 } 452 case 2: 453 if wireType != 2 { 454 return fmt.Errorf("proto: wrong wireType = %d for field StoreInfos", wireType) 455 } 456 var msglen int 457 for shift := uint(0); ; shift += 7 { 458 if shift >= 64 { 459 return ErrIntOverflowCommitInfo 460 } 461 if iNdEx >= l { 462 return io.ErrUnexpectedEOF 463 } 464 b := dAtA[iNdEx] 465 iNdEx++ 466 msglen |= int(b&0x7F) << shift 467 if b < 0x80 { 468 break 469 } 470 } 471 if msglen < 0 { 472 return ErrInvalidLengthCommitInfo 473 } 474 postIndex := iNdEx + msglen 475 if postIndex < 0 { 476 return ErrInvalidLengthCommitInfo 477 } 478 if postIndex > l { 479 return io.ErrUnexpectedEOF 480 } 481 m.StoreInfos = append(m.StoreInfos, StoreInfo{}) 482 if err := m.StoreInfos[len(m.StoreInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 483 return err 484 } 485 iNdEx = postIndex 486 default: 487 iNdEx = preIndex 488 skippy, err := skipCommitInfo(dAtA[iNdEx:]) 489 if err != nil { 490 return err 491 } 492 if (skippy < 0) || (iNdEx+skippy) < 0 { 493 return ErrInvalidLengthCommitInfo 494 } 495 if (iNdEx + skippy) > l { 496 return io.ErrUnexpectedEOF 497 } 498 iNdEx += skippy 499 } 500 } 501 502 if iNdEx > l { 503 return io.ErrUnexpectedEOF 504 } 505 return nil 506 } 507 func (m *StoreInfo) Unmarshal(dAtA []byte) error { 508 l := len(dAtA) 509 iNdEx := 0 510 for iNdEx < l { 511 preIndex := iNdEx 512 var wire uint64 513 for shift := uint(0); ; shift += 7 { 514 if shift >= 64 { 515 return ErrIntOverflowCommitInfo 516 } 517 if iNdEx >= l { 518 return io.ErrUnexpectedEOF 519 } 520 b := dAtA[iNdEx] 521 iNdEx++ 522 wire |= uint64(b&0x7F) << shift 523 if b < 0x80 { 524 break 525 } 526 } 527 fieldNum := int32(wire >> 3) 528 wireType := int(wire & 0x7) 529 if wireType == 4 { 530 return fmt.Errorf("proto: StoreInfo: wiretype end group for non-group") 531 } 532 if fieldNum <= 0 { 533 return fmt.Errorf("proto: StoreInfo: illegal tag %d (wire type %d)", fieldNum, wire) 534 } 535 switch fieldNum { 536 case 1: 537 if wireType != 2 { 538 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 539 } 540 var stringLen uint64 541 for shift := uint(0); ; shift += 7 { 542 if shift >= 64 { 543 return ErrIntOverflowCommitInfo 544 } 545 if iNdEx >= l { 546 return io.ErrUnexpectedEOF 547 } 548 b := dAtA[iNdEx] 549 iNdEx++ 550 stringLen |= uint64(b&0x7F) << shift 551 if b < 0x80 { 552 break 553 } 554 } 555 intStringLen := int(stringLen) 556 if intStringLen < 0 { 557 return ErrInvalidLengthCommitInfo 558 } 559 postIndex := iNdEx + intStringLen 560 if postIndex < 0 { 561 return ErrInvalidLengthCommitInfo 562 } 563 if postIndex > l { 564 return io.ErrUnexpectedEOF 565 } 566 m.Name = string(dAtA[iNdEx:postIndex]) 567 iNdEx = postIndex 568 case 2: 569 if wireType != 2 { 570 return fmt.Errorf("proto: wrong wireType = %d for field CommitId", wireType) 571 } 572 var msglen int 573 for shift := uint(0); ; shift += 7 { 574 if shift >= 64 { 575 return ErrIntOverflowCommitInfo 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 ErrInvalidLengthCommitInfo 589 } 590 postIndex := iNdEx + msglen 591 if postIndex < 0 { 592 return ErrInvalidLengthCommitInfo 593 } 594 if postIndex > l { 595 return io.ErrUnexpectedEOF 596 } 597 if err := m.CommitId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 598 return err 599 } 600 iNdEx = postIndex 601 default: 602 iNdEx = preIndex 603 skippy, err := skipCommitInfo(dAtA[iNdEx:]) 604 if err != nil { 605 return err 606 } 607 if (skippy < 0) || (iNdEx+skippy) < 0 { 608 return ErrInvalidLengthCommitInfo 609 } 610 if (iNdEx + skippy) > l { 611 return io.ErrUnexpectedEOF 612 } 613 iNdEx += skippy 614 } 615 } 616 617 if iNdEx > l { 618 return io.ErrUnexpectedEOF 619 } 620 return nil 621 } 622 func (m *CommitID) Unmarshal(dAtA []byte) error { 623 l := len(dAtA) 624 iNdEx := 0 625 for iNdEx < l { 626 preIndex := iNdEx 627 var wire uint64 628 for shift := uint(0); ; shift += 7 { 629 if shift >= 64 { 630 return ErrIntOverflowCommitInfo 631 } 632 if iNdEx >= l { 633 return io.ErrUnexpectedEOF 634 } 635 b := dAtA[iNdEx] 636 iNdEx++ 637 wire |= uint64(b&0x7F) << shift 638 if b < 0x80 { 639 break 640 } 641 } 642 fieldNum := int32(wire >> 3) 643 wireType := int(wire & 0x7) 644 if wireType == 4 { 645 return fmt.Errorf("proto: CommitID: wiretype end group for non-group") 646 } 647 if fieldNum <= 0 { 648 return fmt.Errorf("proto: CommitID: illegal tag %d (wire type %d)", fieldNum, wire) 649 } 650 switch fieldNum { 651 case 1: 652 if wireType != 0 { 653 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 654 } 655 m.Version = 0 656 for shift := uint(0); ; shift += 7 { 657 if shift >= 64 { 658 return ErrIntOverflowCommitInfo 659 } 660 if iNdEx >= l { 661 return io.ErrUnexpectedEOF 662 } 663 b := dAtA[iNdEx] 664 iNdEx++ 665 m.Version |= int64(b&0x7F) << shift 666 if b < 0x80 { 667 break 668 } 669 } 670 case 2: 671 if wireType != 2 { 672 return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) 673 } 674 var byteLen int 675 for shift := uint(0); ; shift += 7 { 676 if shift >= 64 { 677 return ErrIntOverflowCommitInfo 678 } 679 if iNdEx >= l { 680 return io.ErrUnexpectedEOF 681 } 682 b := dAtA[iNdEx] 683 iNdEx++ 684 byteLen |= int(b&0x7F) << shift 685 if b < 0x80 { 686 break 687 } 688 } 689 if byteLen < 0 { 690 return ErrInvalidLengthCommitInfo 691 } 692 postIndex := iNdEx + byteLen 693 if postIndex < 0 { 694 return ErrInvalidLengthCommitInfo 695 } 696 if postIndex > l { 697 return io.ErrUnexpectedEOF 698 } 699 m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) 700 if m.Hash == nil { 701 m.Hash = []byte{} 702 } 703 iNdEx = postIndex 704 default: 705 iNdEx = preIndex 706 skippy, err := skipCommitInfo(dAtA[iNdEx:]) 707 if err != nil { 708 return err 709 } 710 if (skippy < 0) || (iNdEx+skippy) < 0 { 711 return ErrInvalidLengthCommitInfo 712 } 713 if (iNdEx + skippy) > l { 714 return io.ErrUnexpectedEOF 715 } 716 iNdEx += skippy 717 } 718 } 719 720 if iNdEx > l { 721 return io.ErrUnexpectedEOF 722 } 723 return nil 724 } 725 func skipCommitInfo(dAtA []byte) (n int, err error) { 726 l := len(dAtA) 727 iNdEx := 0 728 depth := 0 729 for iNdEx < l { 730 var wire uint64 731 for shift := uint(0); ; shift += 7 { 732 if shift >= 64 { 733 return 0, ErrIntOverflowCommitInfo 734 } 735 if iNdEx >= l { 736 return 0, io.ErrUnexpectedEOF 737 } 738 b := dAtA[iNdEx] 739 iNdEx++ 740 wire |= (uint64(b) & 0x7F) << shift 741 if b < 0x80 { 742 break 743 } 744 } 745 wireType := int(wire & 0x7) 746 switch wireType { 747 case 0: 748 for shift := uint(0); ; shift += 7 { 749 if shift >= 64 { 750 return 0, ErrIntOverflowCommitInfo 751 } 752 if iNdEx >= l { 753 return 0, io.ErrUnexpectedEOF 754 } 755 iNdEx++ 756 if dAtA[iNdEx-1] < 0x80 { 757 break 758 } 759 } 760 case 1: 761 iNdEx += 8 762 case 2: 763 var length int 764 for shift := uint(0); ; shift += 7 { 765 if shift >= 64 { 766 return 0, ErrIntOverflowCommitInfo 767 } 768 if iNdEx >= l { 769 return 0, io.ErrUnexpectedEOF 770 } 771 b := dAtA[iNdEx] 772 iNdEx++ 773 length |= (int(b) & 0x7F) << shift 774 if b < 0x80 { 775 break 776 } 777 } 778 if length < 0 { 779 return 0, ErrInvalidLengthCommitInfo 780 } 781 iNdEx += length 782 case 3: 783 depth++ 784 case 4: 785 if depth == 0 { 786 return 0, ErrUnexpectedEndOfGroupCommitInfo 787 } 788 depth-- 789 case 5: 790 iNdEx += 4 791 default: 792 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 793 } 794 if iNdEx < 0 { 795 return 0, ErrInvalidLengthCommitInfo 796 } 797 if depth == 0 { 798 return iNdEx, nil 799 } 800 } 801 return 0, io.ErrUnexpectedEOF 802 } 803 804 var ( 805 ErrInvalidLengthCommitInfo = fmt.Errorf("proto: negative length found during unmarshaling") 806 ErrIntOverflowCommitInfo = fmt.Errorf("proto: integer overflow") 807 ErrUnexpectedEndOfGroupCommitInfo = fmt.Errorf("proto: unexpected end of group") 808 )