github.com/sunrise-zone/sunrise-node@v0.13.1-sr2/share/p2p/shrexnd/pb/share.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: share/p2p/shrexnd/pb/share.proto 3 4 package share_p2p_shrex_nd 5 6 import ( 7 fmt "fmt" 8 pb "github.com/celestiaorg/nmt/pb" 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 type StatusCode int32 27 28 const ( 29 StatusCode_INVALID StatusCode = 0 30 StatusCode_OK StatusCode = 1 31 StatusCode_NOT_FOUND StatusCode = 2 32 StatusCode_INTERNAL StatusCode = 3 33 ) 34 35 var StatusCode_name = map[int32]string{ 36 0: "INVALID", 37 1: "OK", 38 2: "NOT_FOUND", 39 3: "INTERNAL", 40 } 41 42 var StatusCode_value = map[string]int32{ 43 "INVALID": 0, 44 "OK": 1, 45 "NOT_FOUND": 2, 46 "INTERNAL": 3, 47 } 48 49 func (x StatusCode) String() string { 50 return proto.EnumName(StatusCode_name, int32(x)) 51 } 52 53 func (StatusCode) EnumDescriptor() ([]byte, []int) { 54 return fileDescriptor_ed9f13149b0de397, []int{0} 55 } 56 57 type GetSharesByNamespaceRequest struct { 58 RootHash []byte `protobuf:"bytes,1,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"` 59 Namespace []byte `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` 60 } 61 62 func (m *GetSharesByNamespaceRequest) Reset() { *m = GetSharesByNamespaceRequest{} } 63 func (m *GetSharesByNamespaceRequest) String() string { return proto.CompactTextString(m) } 64 func (*GetSharesByNamespaceRequest) ProtoMessage() {} 65 func (*GetSharesByNamespaceRequest) Descriptor() ([]byte, []int) { 66 return fileDescriptor_ed9f13149b0de397, []int{0} 67 } 68 func (m *GetSharesByNamespaceRequest) XXX_Unmarshal(b []byte) error { 69 return m.Unmarshal(b) 70 } 71 func (m *GetSharesByNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 72 if deterministic { 73 return xxx_messageInfo_GetSharesByNamespaceRequest.Marshal(b, m, deterministic) 74 } else { 75 b = b[:cap(b)] 76 n, err := m.MarshalToSizedBuffer(b) 77 if err != nil { 78 return nil, err 79 } 80 return b[:n], nil 81 } 82 } 83 func (m *GetSharesByNamespaceRequest) XXX_Merge(src proto.Message) { 84 xxx_messageInfo_GetSharesByNamespaceRequest.Merge(m, src) 85 } 86 func (m *GetSharesByNamespaceRequest) XXX_Size() int { 87 return m.Size() 88 } 89 func (m *GetSharesByNamespaceRequest) XXX_DiscardUnknown() { 90 xxx_messageInfo_GetSharesByNamespaceRequest.DiscardUnknown(m) 91 } 92 93 var xxx_messageInfo_GetSharesByNamespaceRequest proto.InternalMessageInfo 94 95 func (m *GetSharesByNamespaceRequest) GetRootHash() []byte { 96 if m != nil { 97 return m.RootHash 98 } 99 return nil 100 } 101 102 func (m *GetSharesByNamespaceRequest) GetNamespace() []byte { 103 if m != nil { 104 return m.Namespace 105 } 106 return nil 107 } 108 109 type GetSharesByNamespaceStatusResponse struct { 110 Status StatusCode `protobuf:"varint,1,opt,name=status,proto3,enum=share.p2p.shrex.nd.StatusCode" json:"status,omitempty"` 111 } 112 113 func (m *GetSharesByNamespaceStatusResponse) Reset() { *m = GetSharesByNamespaceStatusResponse{} } 114 func (m *GetSharesByNamespaceStatusResponse) String() string { return proto.CompactTextString(m) } 115 func (*GetSharesByNamespaceStatusResponse) ProtoMessage() {} 116 func (*GetSharesByNamespaceStatusResponse) Descriptor() ([]byte, []int) { 117 return fileDescriptor_ed9f13149b0de397, []int{1} 118 } 119 func (m *GetSharesByNamespaceStatusResponse) XXX_Unmarshal(b []byte) error { 120 return m.Unmarshal(b) 121 } 122 func (m *GetSharesByNamespaceStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 123 if deterministic { 124 return xxx_messageInfo_GetSharesByNamespaceStatusResponse.Marshal(b, m, deterministic) 125 } else { 126 b = b[:cap(b)] 127 n, err := m.MarshalToSizedBuffer(b) 128 if err != nil { 129 return nil, err 130 } 131 return b[:n], nil 132 } 133 } 134 func (m *GetSharesByNamespaceStatusResponse) XXX_Merge(src proto.Message) { 135 xxx_messageInfo_GetSharesByNamespaceStatusResponse.Merge(m, src) 136 } 137 func (m *GetSharesByNamespaceStatusResponse) XXX_Size() int { 138 return m.Size() 139 } 140 func (m *GetSharesByNamespaceStatusResponse) XXX_DiscardUnknown() { 141 xxx_messageInfo_GetSharesByNamespaceStatusResponse.DiscardUnknown(m) 142 } 143 144 var xxx_messageInfo_GetSharesByNamespaceStatusResponse proto.InternalMessageInfo 145 146 func (m *GetSharesByNamespaceStatusResponse) GetStatus() StatusCode { 147 if m != nil { 148 return m.Status 149 } 150 return StatusCode_INVALID 151 } 152 153 type NamespaceRowResponse struct { 154 Shares [][]byte `protobuf:"bytes,1,rep,name=shares,proto3" json:"shares,omitempty"` 155 Proof *pb.Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` 156 } 157 158 func (m *NamespaceRowResponse) Reset() { *m = NamespaceRowResponse{} } 159 func (m *NamespaceRowResponse) String() string { return proto.CompactTextString(m) } 160 func (*NamespaceRowResponse) ProtoMessage() {} 161 func (*NamespaceRowResponse) Descriptor() ([]byte, []int) { 162 return fileDescriptor_ed9f13149b0de397, []int{2} 163 } 164 func (m *NamespaceRowResponse) XXX_Unmarshal(b []byte) error { 165 return m.Unmarshal(b) 166 } 167 func (m *NamespaceRowResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 168 if deterministic { 169 return xxx_messageInfo_NamespaceRowResponse.Marshal(b, m, deterministic) 170 } else { 171 b = b[:cap(b)] 172 n, err := m.MarshalToSizedBuffer(b) 173 if err != nil { 174 return nil, err 175 } 176 return b[:n], nil 177 } 178 } 179 func (m *NamespaceRowResponse) XXX_Merge(src proto.Message) { 180 xxx_messageInfo_NamespaceRowResponse.Merge(m, src) 181 } 182 func (m *NamespaceRowResponse) XXX_Size() int { 183 return m.Size() 184 } 185 func (m *NamespaceRowResponse) XXX_DiscardUnknown() { 186 xxx_messageInfo_NamespaceRowResponse.DiscardUnknown(m) 187 } 188 189 var xxx_messageInfo_NamespaceRowResponse proto.InternalMessageInfo 190 191 func (m *NamespaceRowResponse) GetShares() [][]byte { 192 if m != nil { 193 return m.Shares 194 } 195 return nil 196 } 197 198 func (m *NamespaceRowResponse) GetProof() *pb.Proof { 199 if m != nil { 200 return m.Proof 201 } 202 return nil 203 } 204 205 func init() { 206 proto.RegisterEnum("share.p2p.shrex.nd.StatusCode", StatusCode_name, StatusCode_value) 207 proto.RegisterType((*GetSharesByNamespaceRequest)(nil), "share.p2p.shrex.nd.GetSharesByNamespaceRequest") 208 proto.RegisterType((*GetSharesByNamespaceStatusResponse)(nil), "share.p2p.shrex.nd.GetSharesByNamespaceStatusResponse") 209 proto.RegisterType((*NamespaceRowResponse)(nil), "share.p2p.shrex.nd.NamespaceRowResponse") 210 } 211 212 func init() { proto.RegisterFile("share/p2p/shrexnd/pb/share.proto", fileDescriptor_ed9f13149b0de397) } 213 214 var fileDescriptor_ed9f13149b0de397 = []byte{ 215 // 326 bytes of a gzipped FileDescriptorProto 216 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x4f, 0x4b, 0xf3, 0x40, 217 0x10, 0xc6, 0x93, 0x96, 0x37, 0x6f, 0x3b, 0xad, 0x35, 0x2c, 0x22, 0xc5, 0xca, 0x52, 0x02, 0x42, 218 0xf1, 0xb0, 0x81, 0x08, 0x1e, 0x85, 0xd6, 0xfa, 0xa7, 0x58, 0x52, 0xd9, 0xb6, 0xe2, 0x41, 0x28, 219 0x1b, 0xbb, 0x92, 0x8b, 0xd9, 0x35, 0xbb, 0x45, 0xfd, 0x16, 0x7e, 0x2c, 0x8f, 0x3d, 0x7a, 0x94, 220 0xf6, 0x8b, 0x48, 0xb6, 0xd1, 0x1c, 0xf4, 0xb6, 0xf3, 0xcc, 0x33, 0xbf, 0x7d, 0x66, 0xa0, 0xad, 221 0x62, 0x96, 0x72, 0x5f, 0x06, 0xd2, 0x57, 0x71, 0xca, 0x5f, 0x92, 0xb9, 0x2f, 0x23, 0xdf, 0x88, 222 0x44, 0xa6, 0x42, 0x0b, 0x84, 0xf2, 0x22, 0x90, 0xc4, 0x38, 0x48, 0x32, 0xdf, 0x6b, 0xc8, 0xc8, 223 0x97, 0xa9, 0x10, 0x0f, 0x1b, 0x8f, 0x77, 0x0b, 0xad, 0x0b, 0xae, 0xc7, 0x99, 0x51, 0xf5, 0x5e, 224 0x43, 0xf6, 0xc8, 0x95, 0x64, 0xf7, 0x9c, 0xf2, 0xa7, 0x05, 0x57, 0x1a, 0xb5, 0xa0, 0x9a, 0x0a, 225 0xa1, 0x67, 0x31, 0x53, 0x71, 0xd3, 0x6e, 0xdb, 0x9d, 0x3a, 0xad, 0x64, 0xc2, 0x25, 0x53, 0x31, 226 0xda, 0x87, 0x6a, 0xf2, 0x3d, 0xd0, 0x2c, 0x99, 0x66, 0x21, 0x78, 0x77, 0xe0, 0xfd, 0x45, 0x1e, 227 0x6b, 0xa6, 0x17, 0x8a, 0x72, 0x25, 0x45, 0xa2, 0x38, 0x3a, 0x06, 0x47, 0x19, 0xc5, 0xd0, 0x1b, 228 0x01, 0x26, 0xbf, 0x43, 0x93, 0xcd, 0xcc, 0xa9, 0x98, 0x73, 0x9a, 0xbb, 0xbd, 0x29, 0xec, 0x14, 229 0x61, 0xc5, 0xf3, 0x0f, 0x6f, 0x17, 0x1c, 0x03, 0xc8, 0x78, 0xe5, 0x4e, 0x9d, 0xe6, 0x15, 0x3a, 230 0x80, 0x7f, 0x66, 0x6d, 0x93, 0xb3, 0x16, 0x6c, 0x93, 0xfc, 0x08, 0x11, 0xb9, 0xce, 0x1e, 0x74, 231 0xd3, 0x3d, 0x3c, 0x01, 0x28, 0x3e, 0x43, 0x35, 0xf8, 0x3f, 0x08, 0x6f, 0xba, 0xc3, 0x41, 0xdf, 232 0xb5, 0x90, 0x03, 0xa5, 0xd1, 0x95, 0x6b, 0xa3, 0x2d, 0xa8, 0x86, 0xa3, 0xc9, 0xec, 0x7c, 0x34, 233 0x0d, 0xfb, 0x6e, 0x09, 0xd5, 0xa1, 0x32, 0x08, 0x27, 0x67, 0x34, 0xec, 0x0e, 0xdd, 0x72, 0xaf, 234 0xf9, 0xbe, 0xc2, 0xf6, 0x72, 0x85, 0xed, 0xcf, 0x15, 0xb6, 0xdf, 0xd6, 0xd8, 0x5a, 0xae, 0xb1, 235 0xf5, 0xb1, 0xc6, 0x56, 0xe4, 0x98, 0x7b, 0x1f, 0x7d, 0x05, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x53, 236 0xb4, 0x86, 0xb7, 0x01, 0x00, 0x00, 237 } 238 239 func (m *GetSharesByNamespaceRequest) Marshal() (dAtA []byte, err error) { 240 size := m.Size() 241 dAtA = make([]byte, size) 242 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 243 if err != nil { 244 return nil, err 245 } 246 return dAtA[:n], nil 247 } 248 249 func (m *GetSharesByNamespaceRequest) MarshalTo(dAtA []byte) (int, error) { 250 size := m.Size() 251 return m.MarshalToSizedBuffer(dAtA[:size]) 252 } 253 254 func (m *GetSharesByNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 255 i := len(dAtA) 256 _ = i 257 var l int 258 _ = l 259 if len(m.Namespace) > 0 { 260 i -= len(m.Namespace) 261 copy(dAtA[i:], m.Namespace) 262 i = encodeVarintShare(dAtA, i, uint64(len(m.Namespace))) 263 i-- 264 dAtA[i] = 0x12 265 } 266 if len(m.RootHash) > 0 { 267 i -= len(m.RootHash) 268 copy(dAtA[i:], m.RootHash) 269 i = encodeVarintShare(dAtA, i, uint64(len(m.RootHash))) 270 i-- 271 dAtA[i] = 0xa 272 } 273 return len(dAtA) - i, nil 274 } 275 276 func (m *GetSharesByNamespaceStatusResponse) Marshal() (dAtA []byte, err error) { 277 size := m.Size() 278 dAtA = make([]byte, size) 279 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 280 if err != nil { 281 return nil, err 282 } 283 return dAtA[:n], nil 284 } 285 286 func (m *GetSharesByNamespaceStatusResponse) MarshalTo(dAtA []byte) (int, error) { 287 size := m.Size() 288 return m.MarshalToSizedBuffer(dAtA[:size]) 289 } 290 291 func (m *GetSharesByNamespaceStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 292 i := len(dAtA) 293 _ = i 294 var l int 295 _ = l 296 if m.Status != 0 { 297 i = encodeVarintShare(dAtA, i, uint64(m.Status)) 298 i-- 299 dAtA[i] = 0x8 300 } 301 return len(dAtA) - i, nil 302 } 303 304 func (m *NamespaceRowResponse) Marshal() (dAtA []byte, err error) { 305 size := m.Size() 306 dAtA = make([]byte, size) 307 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 308 if err != nil { 309 return nil, err 310 } 311 return dAtA[:n], nil 312 } 313 314 func (m *NamespaceRowResponse) MarshalTo(dAtA []byte) (int, error) { 315 size := m.Size() 316 return m.MarshalToSizedBuffer(dAtA[:size]) 317 } 318 319 func (m *NamespaceRowResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 320 i := len(dAtA) 321 _ = i 322 var l int 323 _ = l 324 if m.Proof != nil { 325 { 326 size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) 327 if err != nil { 328 return 0, err 329 } 330 i -= size 331 i = encodeVarintShare(dAtA, i, uint64(size)) 332 } 333 i-- 334 dAtA[i] = 0x12 335 } 336 if len(m.Shares) > 0 { 337 for iNdEx := len(m.Shares) - 1; iNdEx >= 0; iNdEx-- { 338 i -= len(m.Shares[iNdEx]) 339 copy(dAtA[i:], m.Shares[iNdEx]) 340 i = encodeVarintShare(dAtA, i, uint64(len(m.Shares[iNdEx]))) 341 i-- 342 dAtA[i] = 0xa 343 } 344 } 345 return len(dAtA) - i, nil 346 } 347 348 func encodeVarintShare(dAtA []byte, offset int, v uint64) int { 349 offset -= sovShare(v) 350 base := offset 351 for v >= 1<<7 { 352 dAtA[offset] = uint8(v&0x7f | 0x80) 353 v >>= 7 354 offset++ 355 } 356 dAtA[offset] = uint8(v) 357 return base 358 } 359 func (m *GetSharesByNamespaceRequest) Size() (n int) { 360 if m == nil { 361 return 0 362 } 363 var l int 364 _ = l 365 l = len(m.RootHash) 366 if l > 0 { 367 n += 1 + l + sovShare(uint64(l)) 368 } 369 l = len(m.Namespace) 370 if l > 0 { 371 n += 1 + l + sovShare(uint64(l)) 372 } 373 return n 374 } 375 376 func (m *GetSharesByNamespaceStatusResponse) Size() (n int) { 377 if m == nil { 378 return 0 379 } 380 var l int 381 _ = l 382 if m.Status != 0 { 383 n += 1 + sovShare(uint64(m.Status)) 384 } 385 return n 386 } 387 388 func (m *NamespaceRowResponse) Size() (n int) { 389 if m == nil { 390 return 0 391 } 392 var l int 393 _ = l 394 if len(m.Shares) > 0 { 395 for _, b := range m.Shares { 396 l = len(b) 397 n += 1 + l + sovShare(uint64(l)) 398 } 399 } 400 if m.Proof != nil { 401 l = m.Proof.Size() 402 n += 1 + l + sovShare(uint64(l)) 403 } 404 return n 405 } 406 407 func sovShare(x uint64) (n int) { 408 return (math_bits.Len64(x|1) + 6) / 7 409 } 410 func sozShare(x uint64) (n int) { 411 return sovShare(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 412 } 413 func (m *GetSharesByNamespaceRequest) Unmarshal(dAtA []byte) error { 414 l := len(dAtA) 415 iNdEx := 0 416 for iNdEx < l { 417 preIndex := iNdEx 418 var wire uint64 419 for shift := uint(0); ; shift += 7 { 420 if shift >= 64 { 421 return ErrIntOverflowShare 422 } 423 if iNdEx >= l { 424 return io.ErrUnexpectedEOF 425 } 426 b := dAtA[iNdEx] 427 iNdEx++ 428 wire |= uint64(b&0x7F) << shift 429 if b < 0x80 { 430 break 431 } 432 } 433 fieldNum := int32(wire >> 3) 434 wireType := int(wire & 0x7) 435 if wireType == 4 { 436 return fmt.Errorf("proto: GetSharesByNamespaceRequest: wiretype end group for non-group") 437 } 438 if fieldNum <= 0 { 439 return fmt.Errorf("proto: GetSharesByNamespaceRequest: illegal tag %d (wire type %d)", fieldNum, wire) 440 } 441 switch fieldNum { 442 case 1: 443 if wireType != 2 { 444 return fmt.Errorf("proto: wrong wireType = %d for field RootHash", wireType) 445 } 446 var byteLen int 447 for shift := uint(0); ; shift += 7 { 448 if shift >= 64 { 449 return ErrIntOverflowShare 450 } 451 if iNdEx >= l { 452 return io.ErrUnexpectedEOF 453 } 454 b := dAtA[iNdEx] 455 iNdEx++ 456 byteLen |= int(b&0x7F) << shift 457 if b < 0x80 { 458 break 459 } 460 } 461 if byteLen < 0 { 462 return ErrInvalidLengthShare 463 } 464 postIndex := iNdEx + byteLen 465 if postIndex < 0 { 466 return ErrInvalidLengthShare 467 } 468 if postIndex > l { 469 return io.ErrUnexpectedEOF 470 } 471 m.RootHash = append(m.RootHash[:0], dAtA[iNdEx:postIndex]...) 472 if m.RootHash == nil { 473 m.RootHash = []byte{} 474 } 475 iNdEx = postIndex 476 case 2: 477 if wireType != 2 { 478 return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) 479 } 480 var byteLen int 481 for shift := uint(0); ; shift += 7 { 482 if shift >= 64 { 483 return ErrIntOverflowShare 484 } 485 if iNdEx >= l { 486 return io.ErrUnexpectedEOF 487 } 488 b := dAtA[iNdEx] 489 iNdEx++ 490 byteLen |= int(b&0x7F) << shift 491 if b < 0x80 { 492 break 493 } 494 } 495 if byteLen < 0 { 496 return ErrInvalidLengthShare 497 } 498 postIndex := iNdEx + byteLen 499 if postIndex < 0 { 500 return ErrInvalidLengthShare 501 } 502 if postIndex > l { 503 return io.ErrUnexpectedEOF 504 } 505 m.Namespace = append(m.Namespace[:0], dAtA[iNdEx:postIndex]...) 506 if m.Namespace == nil { 507 m.Namespace = []byte{} 508 } 509 iNdEx = postIndex 510 default: 511 iNdEx = preIndex 512 skippy, err := skipShare(dAtA[iNdEx:]) 513 if err != nil { 514 return err 515 } 516 if (skippy < 0) || (iNdEx+skippy) < 0 { 517 return ErrInvalidLengthShare 518 } 519 if (iNdEx + skippy) > l { 520 return io.ErrUnexpectedEOF 521 } 522 iNdEx += skippy 523 } 524 } 525 526 if iNdEx > l { 527 return io.ErrUnexpectedEOF 528 } 529 return nil 530 } 531 func (m *GetSharesByNamespaceStatusResponse) Unmarshal(dAtA []byte) error { 532 l := len(dAtA) 533 iNdEx := 0 534 for iNdEx < l { 535 preIndex := iNdEx 536 var wire uint64 537 for shift := uint(0); ; shift += 7 { 538 if shift >= 64 { 539 return ErrIntOverflowShare 540 } 541 if iNdEx >= l { 542 return io.ErrUnexpectedEOF 543 } 544 b := dAtA[iNdEx] 545 iNdEx++ 546 wire |= uint64(b&0x7F) << shift 547 if b < 0x80 { 548 break 549 } 550 } 551 fieldNum := int32(wire >> 3) 552 wireType := int(wire & 0x7) 553 if wireType == 4 { 554 return fmt.Errorf("proto: GetSharesByNamespaceStatusResponse: wiretype end group for non-group") 555 } 556 if fieldNum <= 0 { 557 return fmt.Errorf("proto: GetSharesByNamespaceStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) 558 } 559 switch fieldNum { 560 case 1: 561 if wireType != 0 { 562 return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) 563 } 564 m.Status = 0 565 for shift := uint(0); ; shift += 7 { 566 if shift >= 64 { 567 return ErrIntOverflowShare 568 } 569 if iNdEx >= l { 570 return io.ErrUnexpectedEOF 571 } 572 b := dAtA[iNdEx] 573 iNdEx++ 574 m.Status |= StatusCode(b&0x7F) << shift 575 if b < 0x80 { 576 break 577 } 578 } 579 default: 580 iNdEx = preIndex 581 skippy, err := skipShare(dAtA[iNdEx:]) 582 if err != nil { 583 return err 584 } 585 if (skippy < 0) || (iNdEx+skippy) < 0 { 586 return ErrInvalidLengthShare 587 } 588 if (iNdEx + skippy) > l { 589 return io.ErrUnexpectedEOF 590 } 591 iNdEx += skippy 592 } 593 } 594 595 if iNdEx > l { 596 return io.ErrUnexpectedEOF 597 } 598 return nil 599 } 600 func (m *NamespaceRowResponse) Unmarshal(dAtA []byte) error { 601 l := len(dAtA) 602 iNdEx := 0 603 for iNdEx < l { 604 preIndex := iNdEx 605 var wire uint64 606 for shift := uint(0); ; shift += 7 { 607 if shift >= 64 { 608 return ErrIntOverflowShare 609 } 610 if iNdEx >= l { 611 return io.ErrUnexpectedEOF 612 } 613 b := dAtA[iNdEx] 614 iNdEx++ 615 wire |= uint64(b&0x7F) << shift 616 if b < 0x80 { 617 break 618 } 619 } 620 fieldNum := int32(wire >> 3) 621 wireType := int(wire & 0x7) 622 if wireType == 4 { 623 return fmt.Errorf("proto: NamespaceRowResponse: wiretype end group for non-group") 624 } 625 if fieldNum <= 0 { 626 return fmt.Errorf("proto: NamespaceRowResponse: illegal tag %d (wire type %d)", fieldNum, wire) 627 } 628 switch fieldNum { 629 case 1: 630 if wireType != 2 { 631 return fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) 632 } 633 var byteLen int 634 for shift := uint(0); ; shift += 7 { 635 if shift >= 64 { 636 return ErrIntOverflowShare 637 } 638 if iNdEx >= l { 639 return io.ErrUnexpectedEOF 640 } 641 b := dAtA[iNdEx] 642 iNdEx++ 643 byteLen |= int(b&0x7F) << shift 644 if b < 0x80 { 645 break 646 } 647 } 648 if byteLen < 0 { 649 return ErrInvalidLengthShare 650 } 651 postIndex := iNdEx + byteLen 652 if postIndex < 0 { 653 return ErrInvalidLengthShare 654 } 655 if postIndex > l { 656 return io.ErrUnexpectedEOF 657 } 658 m.Shares = append(m.Shares, make([]byte, postIndex-iNdEx)) 659 copy(m.Shares[len(m.Shares)-1], dAtA[iNdEx:postIndex]) 660 iNdEx = postIndex 661 case 2: 662 if wireType != 2 { 663 return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) 664 } 665 var msglen int 666 for shift := uint(0); ; shift += 7 { 667 if shift >= 64 { 668 return ErrIntOverflowShare 669 } 670 if iNdEx >= l { 671 return io.ErrUnexpectedEOF 672 } 673 b := dAtA[iNdEx] 674 iNdEx++ 675 msglen |= int(b&0x7F) << shift 676 if b < 0x80 { 677 break 678 } 679 } 680 if msglen < 0 { 681 return ErrInvalidLengthShare 682 } 683 postIndex := iNdEx + msglen 684 if postIndex < 0 { 685 return ErrInvalidLengthShare 686 } 687 if postIndex > l { 688 return io.ErrUnexpectedEOF 689 } 690 if m.Proof == nil { 691 m.Proof = &pb.Proof{} 692 } 693 if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 694 return err 695 } 696 iNdEx = postIndex 697 default: 698 iNdEx = preIndex 699 skippy, err := skipShare(dAtA[iNdEx:]) 700 if err != nil { 701 return err 702 } 703 if (skippy < 0) || (iNdEx+skippy) < 0 { 704 return ErrInvalidLengthShare 705 } 706 if (iNdEx + skippy) > l { 707 return io.ErrUnexpectedEOF 708 } 709 iNdEx += skippy 710 } 711 } 712 713 if iNdEx > l { 714 return io.ErrUnexpectedEOF 715 } 716 return nil 717 } 718 func skipShare(dAtA []byte) (n int, err error) { 719 l := len(dAtA) 720 iNdEx := 0 721 depth := 0 722 for iNdEx < l { 723 var wire uint64 724 for shift := uint(0); ; shift += 7 { 725 if shift >= 64 { 726 return 0, ErrIntOverflowShare 727 } 728 if iNdEx >= l { 729 return 0, io.ErrUnexpectedEOF 730 } 731 b := dAtA[iNdEx] 732 iNdEx++ 733 wire |= (uint64(b) & 0x7F) << shift 734 if b < 0x80 { 735 break 736 } 737 } 738 wireType := int(wire & 0x7) 739 switch wireType { 740 case 0: 741 for shift := uint(0); ; shift += 7 { 742 if shift >= 64 { 743 return 0, ErrIntOverflowShare 744 } 745 if iNdEx >= l { 746 return 0, io.ErrUnexpectedEOF 747 } 748 iNdEx++ 749 if dAtA[iNdEx-1] < 0x80 { 750 break 751 } 752 } 753 case 1: 754 iNdEx += 8 755 case 2: 756 var length int 757 for shift := uint(0); ; shift += 7 { 758 if shift >= 64 { 759 return 0, ErrIntOverflowShare 760 } 761 if iNdEx >= l { 762 return 0, io.ErrUnexpectedEOF 763 } 764 b := dAtA[iNdEx] 765 iNdEx++ 766 length |= (int(b) & 0x7F) << shift 767 if b < 0x80 { 768 break 769 } 770 } 771 if length < 0 { 772 return 0, ErrInvalidLengthShare 773 } 774 iNdEx += length 775 case 3: 776 depth++ 777 case 4: 778 if depth == 0 { 779 return 0, ErrUnexpectedEndOfGroupShare 780 } 781 depth-- 782 case 5: 783 iNdEx += 4 784 default: 785 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 786 } 787 if iNdEx < 0 { 788 return 0, ErrInvalidLengthShare 789 } 790 if depth == 0 { 791 return iNdEx, nil 792 } 793 } 794 return 0, io.ErrUnexpectedEOF 795 } 796 797 var ( 798 ErrInvalidLengthShare = fmt.Errorf("proto: negative length found during unmarshaling") 799 ErrIntOverflowShare = fmt.Errorf("proto: integer overflow") 800 ErrUnexpectedEndOfGroupShare = fmt.Errorf("proto: unexpected end of group") 801 )