github.com/number571/tendermint@v0.34.11-gost/proto/tendermint/statesync/types.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: tendermint/statesync/types.proto 3 4 package statesync 5 6 import ( 7 types "github.com/number571/tendermint/proto/tendermint/types" 8 fmt "fmt" 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 Message struct { 27 // Types that are valid to be assigned to Sum: 28 // *Message_SnapshotsRequest 29 // *Message_SnapshotsResponse 30 // *Message_ChunkRequest 31 // *Message_ChunkResponse 32 // *Message_LightBlockRequest 33 // *Message_LightBlockResponse 34 Sum isMessage_Sum `protobuf_oneof:"sum"` 35 } 36 37 func (m *Message) Reset() { *m = Message{} } 38 func (m *Message) String() string { return proto.CompactTextString(m) } 39 func (*Message) ProtoMessage() {} 40 func (*Message) Descriptor() ([]byte, []int) { 41 return fileDescriptor_a1c2869546ca7914, []int{0} 42 } 43 func (m *Message) XXX_Unmarshal(b []byte) error { 44 return m.Unmarshal(b) 45 } 46 func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 47 if deterministic { 48 return xxx_messageInfo_Message.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 *Message) XXX_Merge(src proto.Message) { 59 xxx_messageInfo_Message.Merge(m, src) 60 } 61 func (m *Message) XXX_Size() int { 62 return m.Size() 63 } 64 func (m *Message) XXX_DiscardUnknown() { 65 xxx_messageInfo_Message.DiscardUnknown(m) 66 } 67 68 var xxx_messageInfo_Message proto.InternalMessageInfo 69 70 type isMessage_Sum interface { 71 isMessage_Sum() 72 MarshalTo([]byte) (int, error) 73 Size() int 74 } 75 76 type Message_SnapshotsRequest struct { 77 SnapshotsRequest *SnapshotsRequest `protobuf:"bytes,1,opt,name=snapshots_request,json=snapshotsRequest,proto3,oneof" json:"snapshots_request,omitempty"` 78 } 79 type Message_SnapshotsResponse struct { 80 SnapshotsResponse *SnapshotsResponse `protobuf:"bytes,2,opt,name=snapshots_response,json=snapshotsResponse,proto3,oneof" json:"snapshots_response,omitempty"` 81 } 82 type Message_ChunkRequest struct { 83 ChunkRequest *ChunkRequest `protobuf:"bytes,3,opt,name=chunk_request,json=chunkRequest,proto3,oneof" json:"chunk_request,omitempty"` 84 } 85 type Message_ChunkResponse struct { 86 ChunkResponse *ChunkResponse `protobuf:"bytes,4,opt,name=chunk_response,json=chunkResponse,proto3,oneof" json:"chunk_response,omitempty"` 87 } 88 type Message_LightBlockRequest struct { 89 LightBlockRequest *LightBlockRequest `protobuf:"bytes,5,opt,name=light_block_request,json=lightBlockRequest,proto3,oneof" json:"light_block_request,omitempty"` 90 } 91 type Message_LightBlockResponse struct { 92 LightBlockResponse *LightBlockResponse `protobuf:"bytes,6,opt,name=light_block_response,json=lightBlockResponse,proto3,oneof" json:"light_block_response,omitempty"` 93 } 94 95 func (*Message_SnapshotsRequest) isMessage_Sum() {} 96 func (*Message_SnapshotsResponse) isMessage_Sum() {} 97 func (*Message_ChunkRequest) isMessage_Sum() {} 98 func (*Message_ChunkResponse) isMessage_Sum() {} 99 func (*Message_LightBlockRequest) isMessage_Sum() {} 100 func (*Message_LightBlockResponse) isMessage_Sum() {} 101 102 func (m *Message) GetSum() isMessage_Sum { 103 if m != nil { 104 return m.Sum 105 } 106 return nil 107 } 108 109 func (m *Message) GetSnapshotsRequest() *SnapshotsRequest { 110 if x, ok := m.GetSum().(*Message_SnapshotsRequest); ok { 111 return x.SnapshotsRequest 112 } 113 return nil 114 } 115 116 func (m *Message) GetSnapshotsResponse() *SnapshotsResponse { 117 if x, ok := m.GetSum().(*Message_SnapshotsResponse); ok { 118 return x.SnapshotsResponse 119 } 120 return nil 121 } 122 123 func (m *Message) GetChunkRequest() *ChunkRequest { 124 if x, ok := m.GetSum().(*Message_ChunkRequest); ok { 125 return x.ChunkRequest 126 } 127 return nil 128 } 129 130 func (m *Message) GetChunkResponse() *ChunkResponse { 131 if x, ok := m.GetSum().(*Message_ChunkResponse); ok { 132 return x.ChunkResponse 133 } 134 return nil 135 } 136 137 func (m *Message) GetLightBlockRequest() *LightBlockRequest { 138 if x, ok := m.GetSum().(*Message_LightBlockRequest); ok { 139 return x.LightBlockRequest 140 } 141 return nil 142 } 143 144 func (m *Message) GetLightBlockResponse() *LightBlockResponse { 145 if x, ok := m.GetSum().(*Message_LightBlockResponse); ok { 146 return x.LightBlockResponse 147 } 148 return nil 149 } 150 151 // XXX_OneofWrappers is for the internal use of the proto package. 152 func (*Message) XXX_OneofWrappers() []interface{} { 153 return []interface{}{ 154 (*Message_SnapshotsRequest)(nil), 155 (*Message_SnapshotsResponse)(nil), 156 (*Message_ChunkRequest)(nil), 157 (*Message_ChunkResponse)(nil), 158 (*Message_LightBlockRequest)(nil), 159 (*Message_LightBlockResponse)(nil), 160 } 161 } 162 163 type SnapshotsRequest struct { 164 } 165 166 func (m *SnapshotsRequest) Reset() { *m = SnapshotsRequest{} } 167 func (m *SnapshotsRequest) String() string { return proto.CompactTextString(m) } 168 func (*SnapshotsRequest) ProtoMessage() {} 169 func (*SnapshotsRequest) Descriptor() ([]byte, []int) { 170 return fileDescriptor_a1c2869546ca7914, []int{1} 171 } 172 func (m *SnapshotsRequest) XXX_Unmarshal(b []byte) error { 173 return m.Unmarshal(b) 174 } 175 func (m *SnapshotsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 176 if deterministic { 177 return xxx_messageInfo_SnapshotsRequest.Marshal(b, m, deterministic) 178 } else { 179 b = b[:cap(b)] 180 n, err := m.MarshalToSizedBuffer(b) 181 if err != nil { 182 return nil, err 183 } 184 return b[:n], nil 185 } 186 } 187 func (m *SnapshotsRequest) XXX_Merge(src proto.Message) { 188 xxx_messageInfo_SnapshotsRequest.Merge(m, src) 189 } 190 func (m *SnapshotsRequest) XXX_Size() int { 191 return m.Size() 192 } 193 func (m *SnapshotsRequest) XXX_DiscardUnknown() { 194 xxx_messageInfo_SnapshotsRequest.DiscardUnknown(m) 195 } 196 197 var xxx_messageInfo_SnapshotsRequest proto.InternalMessageInfo 198 199 type SnapshotsResponse struct { 200 Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` 201 Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` 202 Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3" json:"chunks,omitempty"` 203 Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` 204 Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` 205 } 206 207 func (m *SnapshotsResponse) Reset() { *m = SnapshotsResponse{} } 208 func (m *SnapshotsResponse) String() string { return proto.CompactTextString(m) } 209 func (*SnapshotsResponse) ProtoMessage() {} 210 func (*SnapshotsResponse) Descriptor() ([]byte, []int) { 211 return fileDescriptor_a1c2869546ca7914, []int{2} 212 } 213 func (m *SnapshotsResponse) XXX_Unmarshal(b []byte) error { 214 return m.Unmarshal(b) 215 } 216 func (m *SnapshotsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 217 if deterministic { 218 return xxx_messageInfo_SnapshotsResponse.Marshal(b, m, deterministic) 219 } else { 220 b = b[:cap(b)] 221 n, err := m.MarshalToSizedBuffer(b) 222 if err != nil { 223 return nil, err 224 } 225 return b[:n], nil 226 } 227 } 228 func (m *SnapshotsResponse) XXX_Merge(src proto.Message) { 229 xxx_messageInfo_SnapshotsResponse.Merge(m, src) 230 } 231 func (m *SnapshotsResponse) XXX_Size() int { 232 return m.Size() 233 } 234 func (m *SnapshotsResponse) XXX_DiscardUnknown() { 235 xxx_messageInfo_SnapshotsResponse.DiscardUnknown(m) 236 } 237 238 var xxx_messageInfo_SnapshotsResponse proto.InternalMessageInfo 239 240 func (m *SnapshotsResponse) GetHeight() uint64 { 241 if m != nil { 242 return m.Height 243 } 244 return 0 245 } 246 247 func (m *SnapshotsResponse) GetFormat() uint32 { 248 if m != nil { 249 return m.Format 250 } 251 return 0 252 } 253 254 func (m *SnapshotsResponse) GetChunks() uint32 { 255 if m != nil { 256 return m.Chunks 257 } 258 return 0 259 } 260 261 func (m *SnapshotsResponse) GetHash() []byte { 262 if m != nil { 263 return m.Hash 264 } 265 return nil 266 } 267 268 func (m *SnapshotsResponse) GetMetadata() []byte { 269 if m != nil { 270 return m.Metadata 271 } 272 return nil 273 } 274 275 type ChunkRequest struct { 276 Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` 277 Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` 278 Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` 279 } 280 281 func (m *ChunkRequest) Reset() { *m = ChunkRequest{} } 282 func (m *ChunkRequest) String() string { return proto.CompactTextString(m) } 283 func (*ChunkRequest) ProtoMessage() {} 284 func (*ChunkRequest) Descriptor() ([]byte, []int) { 285 return fileDescriptor_a1c2869546ca7914, []int{3} 286 } 287 func (m *ChunkRequest) XXX_Unmarshal(b []byte) error { 288 return m.Unmarshal(b) 289 } 290 func (m *ChunkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 291 if deterministic { 292 return xxx_messageInfo_ChunkRequest.Marshal(b, m, deterministic) 293 } else { 294 b = b[:cap(b)] 295 n, err := m.MarshalToSizedBuffer(b) 296 if err != nil { 297 return nil, err 298 } 299 return b[:n], nil 300 } 301 } 302 func (m *ChunkRequest) XXX_Merge(src proto.Message) { 303 xxx_messageInfo_ChunkRequest.Merge(m, src) 304 } 305 func (m *ChunkRequest) XXX_Size() int { 306 return m.Size() 307 } 308 func (m *ChunkRequest) XXX_DiscardUnknown() { 309 xxx_messageInfo_ChunkRequest.DiscardUnknown(m) 310 } 311 312 var xxx_messageInfo_ChunkRequest proto.InternalMessageInfo 313 314 func (m *ChunkRequest) GetHeight() uint64 { 315 if m != nil { 316 return m.Height 317 } 318 return 0 319 } 320 321 func (m *ChunkRequest) GetFormat() uint32 { 322 if m != nil { 323 return m.Format 324 } 325 return 0 326 } 327 328 func (m *ChunkRequest) GetIndex() uint32 { 329 if m != nil { 330 return m.Index 331 } 332 return 0 333 } 334 335 type ChunkResponse struct { 336 Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` 337 Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` 338 Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` 339 Chunk []byte `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk,omitempty"` 340 Missing bool `protobuf:"varint,5,opt,name=missing,proto3" json:"missing,omitempty"` 341 } 342 343 func (m *ChunkResponse) Reset() { *m = ChunkResponse{} } 344 func (m *ChunkResponse) String() string { return proto.CompactTextString(m) } 345 func (*ChunkResponse) ProtoMessage() {} 346 func (*ChunkResponse) Descriptor() ([]byte, []int) { 347 return fileDescriptor_a1c2869546ca7914, []int{4} 348 } 349 func (m *ChunkResponse) XXX_Unmarshal(b []byte) error { 350 return m.Unmarshal(b) 351 } 352 func (m *ChunkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 353 if deterministic { 354 return xxx_messageInfo_ChunkResponse.Marshal(b, m, deterministic) 355 } else { 356 b = b[:cap(b)] 357 n, err := m.MarshalToSizedBuffer(b) 358 if err != nil { 359 return nil, err 360 } 361 return b[:n], nil 362 } 363 } 364 func (m *ChunkResponse) XXX_Merge(src proto.Message) { 365 xxx_messageInfo_ChunkResponse.Merge(m, src) 366 } 367 func (m *ChunkResponse) XXX_Size() int { 368 return m.Size() 369 } 370 func (m *ChunkResponse) XXX_DiscardUnknown() { 371 xxx_messageInfo_ChunkResponse.DiscardUnknown(m) 372 } 373 374 var xxx_messageInfo_ChunkResponse proto.InternalMessageInfo 375 376 func (m *ChunkResponse) GetHeight() uint64 { 377 if m != nil { 378 return m.Height 379 } 380 return 0 381 } 382 383 func (m *ChunkResponse) GetFormat() uint32 { 384 if m != nil { 385 return m.Format 386 } 387 return 0 388 } 389 390 func (m *ChunkResponse) GetIndex() uint32 { 391 if m != nil { 392 return m.Index 393 } 394 return 0 395 } 396 397 func (m *ChunkResponse) GetChunk() []byte { 398 if m != nil { 399 return m.Chunk 400 } 401 return nil 402 } 403 404 func (m *ChunkResponse) GetMissing() bool { 405 if m != nil { 406 return m.Missing 407 } 408 return false 409 } 410 411 type LightBlockRequest struct { 412 Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` 413 } 414 415 func (m *LightBlockRequest) Reset() { *m = LightBlockRequest{} } 416 func (m *LightBlockRequest) String() string { return proto.CompactTextString(m) } 417 func (*LightBlockRequest) ProtoMessage() {} 418 func (*LightBlockRequest) Descriptor() ([]byte, []int) { 419 return fileDescriptor_a1c2869546ca7914, []int{5} 420 } 421 func (m *LightBlockRequest) XXX_Unmarshal(b []byte) error { 422 return m.Unmarshal(b) 423 } 424 func (m *LightBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 425 if deterministic { 426 return xxx_messageInfo_LightBlockRequest.Marshal(b, m, deterministic) 427 } else { 428 b = b[:cap(b)] 429 n, err := m.MarshalToSizedBuffer(b) 430 if err != nil { 431 return nil, err 432 } 433 return b[:n], nil 434 } 435 } 436 func (m *LightBlockRequest) XXX_Merge(src proto.Message) { 437 xxx_messageInfo_LightBlockRequest.Merge(m, src) 438 } 439 func (m *LightBlockRequest) XXX_Size() int { 440 return m.Size() 441 } 442 func (m *LightBlockRequest) XXX_DiscardUnknown() { 443 xxx_messageInfo_LightBlockRequest.DiscardUnknown(m) 444 } 445 446 var xxx_messageInfo_LightBlockRequest proto.InternalMessageInfo 447 448 func (m *LightBlockRequest) GetHeight() uint64 { 449 if m != nil { 450 return m.Height 451 } 452 return 0 453 } 454 455 type LightBlockResponse struct { 456 LightBlock *types.LightBlock `protobuf:"bytes,1,opt,name=light_block,json=lightBlock,proto3" json:"light_block,omitempty"` 457 } 458 459 func (m *LightBlockResponse) Reset() { *m = LightBlockResponse{} } 460 func (m *LightBlockResponse) String() string { return proto.CompactTextString(m) } 461 func (*LightBlockResponse) ProtoMessage() {} 462 func (*LightBlockResponse) Descriptor() ([]byte, []int) { 463 return fileDescriptor_a1c2869546ca7914, []int{6} 464 } 465 func (m *LightBlockResponse) XXX_Unmarshal(b []byte) error { 466 return m.Unmarshal(b) 467 } 468 func (m *LightBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 469 if deterministic { 470 return xxx_messageInfo_LightBlockResponse.Marshal(b, m, deterministic) 471 } else { 472 b = b[:cap(b)] 473 n, err := m.MarshalToSizedBuffer(b) 474 if err != nil { 475 return nil, err 476 } 477 return b[:n], nil 478 } 479 } 480 func (m *LightBlockResponse) XXX_Merge(src proto.Message) { 481 xxx_messageInfo_LightBlockResponse.Merge(m, src) 482 } 483 func (m *LightBlockResponse) XXX_Size() int { 484 return m.Size() 485 } 486 func (m *LightBlockResponse) XXX_DiscardUnknown() { 487 xxx_messageInfo_LightBlockResponse.DiscardUnknown(m) 488 } 489 490 var xxx_messageInfo_LightBlockResponse proto.InternalMessageInfo 491 492 func (m *LightBlockResponse) GetLightBlock() *types.LightBlock { 493 if m != nil { 494 return m.LightBlock 495 } 496 return nil 497 } 498 499 func init() { 500 proto.RegisterType((*Message)(nil), "tendermint.statesync.Message") 501 proto.RegisterType((*SnapshotsRequest)(nil), "tendermint.statesync.SnapshotsRequest") 502 proto.RegisterType((*SnapshotsResponse)(nil), "tendermint.statesync.SnapshotsResponse") 503 proto.RegisterType((*ChunkRequest)(nil), "tendermint.statesync.ChunkRequest") 504 proto.RegisterType((*ChunkResponse)(nil), "tendermint.statesync.ChunkResponse") 505 proto.RegisterType((*LightBlockRequest)(nil), "tendermint.statesync.LightBlockRequest") 506 proto.RegisterType((*LightBlockResponse)(nil), "tendermint.statesync.LightBlockResponse") 507 } 508 509 func init() { proto.RegisterFile("tendermint/statesync/types.proto", fileDescriptor_a1c2869546ca7914) } 510 511 var fileDescriptor_a1c2869546ca7914 = []byte{ 512 // 485 bytes of a gzipped FileDescriptorProto 513 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x51, 0x6b, 0xd3, 0x50, 514 0x14, 0x4e, 0x5c, 0xdb, 0x8d, 0xb3, 0x46, 0x96, 0x63, 0x91, 0x32, 0x46, 0x18, 0x11, 0x74, 0x20, 515 0xa4, 0xa0, 0x8f, 0xe2, 0x4b, 0x7d, 0x99, 0x30, 0x5f, 0xee, 0x1c, 0xa8, 0x08, 0x23, 0x4d, 0xaf, 516 0x4d, 0xb0, 0x49, 0x6a, 0xcf, 0x2d, 0xb8, 0x1f, 0xe0, 0x93, 0x2f, 0x82, 0x7f, 0xca, 0xc7, 0x3d, 517 0xfa, 0x28, 0xed, 0x1f, 0x91, 0x9c, 0xdc, 0x26, 0x77, 0x6d, 0x5d, 0x11, 0xf6, 0x96, 0xef, 0xeb, 518 0x77, 0x3e, 0xbe, 0x73, 0xcf, 0xe9, 0x81, 0x63, 0x25, 0xb3, 0xa1, 0x9c, 0xa6, 0x49, 0xa6, 0x7a, 519 0xa4, 0x42, 0x25, 0xe9, 0x2a, 0x8b, 0x7a, 0xea, 0x6a, 0x22, 0x29, 0x98, 0x4c, 0x73, 0x95, 0x63, 520 0xa7, 0x56, 0x04, 0x95, 0xe2, 0xf0, 0xc8, 0xa8, 0x63, 0xb5, 0x59, 0xe3, 0xff, 0x6c, 0xc0, 0xee, 521 0x1b, 0x49, 0x14, 0x8e, 0x24, 0x5e, 0x80, 0x4b, 0x59, 0x38, 0xa1, 0x38, 0x57, 0x74, 0x39, 0x95, 522 0x5f, 0x66, 0x92, 0x54, 0xd7, 0x3e, 0xb6, 0x4f, 0xf6, 0x9f, 0x3d, 0x0e, 0x36, 0x79, 0x07, 0xe7, 523 0x4b, 0xb9, 0x28, 0xd5, 0xa7, 0x96, 0x38, 0xa0, 0x15, 0x0e, 0xdf, 0x01, 0x9a, 0xb6, 0x34, 0xc9, 524 0x33, 0x92, 0xdd, 0x7b, 0xec, 0xfb, 0x64, 0xab, 0x6f, 0x29, 0x3f, 0xb5, 0x84, 0x4b, 0xab, 0x24, 525 0xbe, 0x06, 0x27, 0x8a, 0x67, 0xd9, 0xe7, 0x2a, 0xec, 0x0e, 0x9b, 0xfa, 0x9b, 0x4d, 0x5f, 0x15, 526 0xd2, 0x3a, 0x68, 0x3b, 0x32, 0x30, 0x9e, 0xc1, 0xfd, 0xa5, 0x95, 0x0e, 0xd8, 0x60, 0xaf, 0x47, 527 0xb7, 0x7a, 0x55, 0xe1, 0x9c, 0xc8, 0x24, 0xf0, 0x3d, 0x3c, 0x18, 0x27, 0xa3, 0x58, 0x5d, 0x0e, 528 0xc6, 0x79, 0x54, 0xc7, 0x6b, 0xde, 0xd6, 0xf3, 0x59, 0x51, 0xd0, 0x2f, 0xf4, 0x75, 0x46, 0x77, 529 0xbc, 0x4a, 0xe2, 0x47, 0xe8, 0xdc, 0xb4, 0xd6, 0x71, 0x5b, 0xec, 0x7d, 0xb2, 0xdd, 0xbb, 0xca, 530 0x8c, 0xe3, 0x35, 0xb6, 0xdf, 0x84, 0x1d, 0x9a, 0xa5, 0x3e, 0xc2, 0xc1, 0xea, 0x68, 0xfd, 0xef, 531 0x36, 0xb8, 0x6b, 0x73, 0xc1, 0x87, 0xd0, 0x8a, 0x65, 0xe1, 0xc3, 0x8b, 0xd2, 0x10, 0x1a, 0x15, 532 0xfc, 0xa7, 0x7c, 0x9a, 0x86, 0x8a, 0x07, 0xed, 0x08, 0x8d, 0x0a, 0x9e, 0x9f, 0x8a, 0x78, 0x56, 533 0x8e, 0xd0, 0x08, 0x11, 0x1a, 0x71, 0x48, 0x31, 0xbf, 0x7a, 0x5b, 0xf0, 0x37, 0x1e, 0xc2, 0x5e, 534 0x2a, 0x55, 0x38, 0x0c, 0x55, 0xc8, 0x4f, 0xd7, 0x16, 0x15, 0xf6, 0xdf, 0x42, 0xdb, 0x9c, 0xe7, 535 0x7f, 0xe7, 0xe8, 0x40, 0x33, 0xc9, 0x86, 0xf2, 0xab, 0x8e, 0x51, 0x02, 0xff, 0x9b, 0x0d, 0xce, 536 0x8d, 0xd1, 0xde, 0x8d, 0x6f, 0xc1, 0x72, 0x9f, 0xba, 0xbd, 0x12, 0x60, 0x17, 0x76, 0xd3, 0x84, 537 0x28, 0xc9, 0x46, 0xdc, 0xde, 0x9e, 0x58, 0x42, 0xff, 0x29, 0xb8, 0x6b, 0xeb, 0xf0, 0xaf, 0x28, 538 0xfe, 0x39, 0xe0, 0xfa, 0x7c, 0xf1, 0x25, 0xec, 0x1b, 0x7b, 0xa2, 0xff, 0xc6, 0x47, 0xe6, 0x7a, 539 0x94, 0x67, 0xc0, 0x28, 0x85, 0x7a, 0x21, 0xfa, 0x17, 0xbf, 0xe6, 0x9e, 0x7d, 0x3d, 0xf7, 0xec, 540 0x3f, 0x73, 0xcf, 0xfe, 0xb1, 0xf0, 0xac, 0xeb, 0x85, 0x67, 0xfd, 0x5e, 0x78, 0xd6, 0x87, 0x17, 541 0xa3, 0x44, 0xc5, 0xb3, 0x41, 0x10, 0xe5, 0x69, 0xcf, 0x3c, 0x2d, 0xf5, 0x27, 0x5f, 0x96, 0xde, 542 0xa6, 0x73, 0x35, 0x68, 0xf1, 0x6f, 0xcf, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x45, 0x35, 543 0xee, 0xcd, 0x04, 0x00, 0x00, 544 } 545 546 func (m *Message) Marshal() (dAtA []byte, err error) { 547 size := m.Size() 548 dAtA = make([]byte, size) 549 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 550 if err != nil { 551 return nil, err 552 } 553 return dAtA[:n], nil 554 } 555 556 func (m *Message) MarshalTo(dAtA []byte) (int, error) { 557 size := m.Size() 558 return m.MarshalToSizedBuffer(dAtA[:size]) 559 } 560 561 func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { 562 i := len(dAtA) 563 _ = i 564 var l int 565 _ = l 566 if m.Sum != nil { 567 { 568 size := m.Sum.Size() 569 i -= size 570 if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { 571 return 0, err 572 } 573 } 574 } 575 return len(dAtA) - i, nil 576 } 577 578 func (m *Message_SnapshotsRequest) MarshalTo(dAtA []byte) (int, error) { 579 size := m.Size() 580 return m.MarshalToSizedBuffer(dAtA[:size]) 581 } 582 583 func (m *Message_SnapshotsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 584 i := len(dAtA) 585 if m.SnapshotsRequest != nil { 586 { 587 size, err := m.SnapshotsRequest.MarshalToSizedBuffer(dAtA[:i]) 588 if err != nil { 589 return 0, err 590 } 591 i -= size 592 i = encodeVarintTypes(dAtA, i, uint64(size)) 593 } 594 i-- 595 dAtA[i] = 0xa 596 } 597 return len(dAtA) - i, nil 598 } 599 func (m *Message_SnapshotsResponse) MarshalTo(dAtA []byte) (int, error) { 600 size := m.Size() 601 return m.MarshalToSizedBuffer(dAtA[:size]) 602 } 603 604 func (m *Message_SnapshotsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 605 i := len(dAtA) 606 if m.SnapshotsResponse != nil { 607 { 608 size, err := m.SnapshotsResponse.MarshalToSizedBuffer(dAtA[:i]) 609 if err != nil { 610 return 0, err 611 } 612 i -= size 613 i = encodeVarintTypes(dAtA, i, uint64(size)) 614 } 615 i-- 616 dAtA[i] = 0x12 617 } 618 return len(dAtA) - i, nil 619 } 620 func (m *Message_ChunkRequest) MarshalTo(dAtA []byte) (int, error) { 621 size := m.Size() 622 return m.MarshalToSizedBuffer(dAtA[:size]) 623 } 624 625 func (m *Message_ChunkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 626 i := len(dAtA) 627 if m.ChunkRequest != nil { 628 { 629 size, err := m.ChunkRequest.MarshalToSizedBuffer(dAtA[:i]) 630 if err != nil { 631 return 0, err 632 } 633 i -= size 634 i = encodeVarintTypes(dAtA, i, uint64(size)) 635 } 636 i-- 637 dAtA[i] = 0x1a 638 } 639 return len(dAtA) - i, nil 640 } 641 func (m *Message_ChunkResponse) MarshalTo(dAtA []byte) (int, error) { 642 size := m.Size() 643 return m.MarshalToSizedBuffer(dAtA[:size]) 644 } 645 646 func (m *Message_ChunkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 647 i := len(dAtA) 648 if m.ChunkResponse != nil { 649 { 650 size, err := m.ChunkResponse.MarshalToSizedBuffer(dAtA[:i]) 651 if err != nil { 652 return 0, err 653 } 654 i -= size 655 i = encodeVarintTypes(dAtA, i, uint64(size)) 656 } 657 i-- 658 dAtA[i] = 0x22 659 } 660 return len(dAtA) - i, nil 661 } 662 func (m *Message_LightBlockRequest) MarshalTo(dAtA []byte) (int, error) { 663 size := m.Size() 664 return m.MarshalToSizedBuffer(dAtA[:size]) 665 } 666 667 func (m *Message_LightBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 668 i := len(dAtA) 669 if m.LightBlockRequest != nil { 670 { 671 size, err := m.LightBlockRequest.MarshalToSizedBuffer(dAtA[:i]) 672 if err != nil { 673 return 0, err 674 } 675 i -= size 676 i = encodeVarintTypes(dAtA, i, uint64(size)) 677 } 678 i-- 679 dAtA[i] = 0x2a 680 } 681 return len(dAtA) - i, nil 682 } 683 func (m *Message_LightBlockResponse) MarshalTo(dAtA []byte) (int, error) { 684 size := m.Size() 685 return m.MarshalToSizedBuffer(dAtA[:size]) 686 } 687 688 func (m *Message_LightBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 689 i := len(dAtA) 690 if m.LightBlockResponse != nil { 691 { 692 size, err := m.LightBlockResponse.MarshalToSizedBuffer(dAtA[:i]) 693 if err != nil { 694 return 0, err 695 } 696 i -= size 697 i = encodeVarintTypes(dAtA, i, uint64(size)) 698 } 699 i-- 700 dAtA[i] = 0x32 701 } 702 return len(dAtA) - i, nil 703 } 704 func (m *SnapshotsRequest) Marshal() (dAtA []byte, err error) { 705 size := m.Size() 706 dAtA = make([]byte, size) 707 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 708 if err != nil { 709 return nil, err 710 } 711 return dAtA[:n], nil 712 } 713 714 func (m *SnapshotsRequest) MarshalTo(dAtA []byte) (int, error) { 715 size := m.Size() 716 return m.MarshalToSizedBuffer(dAtA[:size]) 717 } 718 719 func (m *SnapshotsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 720 i := len(dAtA) 721 _ = i 722 var l int 723 _ = l 724 return len(dAtA) - i, nil 725 } 726 727 func (m *SnapshotsResponse) Marshal() (dAtA []byte, err error) { 728 size := m.Size() 729 dAtA = make([]byte, size) 730 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 731 if err != nil { 732 return nil, err 733 } 734 return dAtA[:n], nil 735 } 736 737 func (m *SnapshotsResponse) MarshalTo(dAtA []byte) (int, error) { 738 size := m.Size() 739 return m.MarshalToSizedBuffer(dAtA[:size]) 740 } 741 742 func (m *SnapshotsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 743 i := len(dAtA) 744 _ = i 745 var l int 746 _ = l 747 if len(m.Metadata) > 0 { 748 i -= len(m.Metadata) 749 copy(dAtA[i:], m.Metadata) 750 i = encodeVarintTypes(dAtA, i, uint64(len(m.Metadata))) 751 i-- 752 dAtA[i] = 0x2a 753 } 754 if len(m.Hash) > 0 { 755 i -= len(m.Hash) 756 copy(dAtA[i:], m.Hash) 757 i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) 758 i-- 759 dAtA[i] = 0x22 760 } 761 if m.Chunks != 0 { 762 i = encodeVarintTypes(dAtA, i, uint64(m.Chunks)) 763 i-- 764 dAtA[i] = 0x18 765 } 766 if m.Format != 0 { 767 i = encodeVarintTypes(dAtA, i, uint64(m.Format)) 768 i-- 769 dAtA[i] = 0x10 770 } 771 if m.Height != 0 { 772 i = encodeVarintTypes(dAtA, i, uint64(m.Height)) 773 i-- 774 dAtA[i] = 0x8 775 } 776 return len(dAtA) - i, nil 777 } 778 779 func (m *ChunkRequest) Marshal() (dAtA []byte, err error) { 780 size := m.Size() 781 dAtA = make([]byte, size) 782 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 783 if err != nil { 784 return nil, err 785 } 786 return dAtA[:n], nil 787 } 788 789 func (m *ChunkRequest) MarshalTo(dAtA []byte) (int, error) { 790 size := m.Size() 791 return m.MarshalToSizedBuffer(dAtA[:size]) 792 } 793 794 func (m *ChunkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 795 i := len(dAtA) 796 _ = i 797 var l int 798 _ = l 799 if m.Index != 0 { 800 i = encodeVarintTypes(dAtA, i, uint64(m.Index)) 801 i-- 802 dAtA[i] = 0x18 803 } 804 if m.Format != 0 { 805 i = encodeVarintTypes(dAtA, i, uint64(m.Format)) 806 i-- 807 dAtA[i] = 0x10 808 } 809 if m.Height != 0 { 810 i = encodeVarintTypes(dAtA, i, uint64(m.Height)) 811 i-- 812 dAtA[i] = 0x8 813 } 814 return len(dAtA) - i, nil 815 } 816 817 func (m *ChunkResponse) Marshal() (dAtA []byte, err error) { 818 size := m.Size() 819 dAtA = make([]byte, size) 820 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 821 if err != nil { 822 return nil, err 823 } 824 return dAtA[:n], nil 825 } 826 827 func (m *ChunkResponse) MarshalTo(dAtA []byte) (int, error) { 828 size := m.Size() 829 return m.MarshalToSizedBuffer(dAtA[:size]) 830 } 831 832 func (m *ChunkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 833 i := len(dAtA) 834 _ = i 835 var l int 836 _ = l 837 if m.Missing { 838 i-- 839 if m.Missing { 840 dAtA[i] = 1 841 } else { 842 dAtA[i] = 0 843 } 844 i-- 845 dAtA[i] = 0x28 846 } 847 if len(m.Chunk) > 0 { 848 i -= len(m.Chunk) 849 copy(dAtA[i:], m.Chunk) 850 i = encodeVarintTypes(dAtA, i, uint64(len(m.Chunk))) 851 i-- 852 dAtA[i] = 0x22 853 } 854 if m.Index != 0 { 855 i = encodeVarintTypes(dAtA, i, uint64(m.Index)) 856 i-- 857 dAtA[i] = 0x18 858 } 859 if m.Format != 0 { 860 i = encodeVarintTypes(dAtA, i, uint64(m.Format)) 861 i-- 862 dAtA[i] = 0x10 863 } 864 if m.Height != 0 { 865 i = encodeVarintTypes(dAtA, i, uint64(m.Height)) 866 i-- 867 dAtA[i] = 0x8 868 } 869 return len(dAtA) - i, nil 870 } 871 872 func (m *LightBlockRequest) Marshal() (dAtA []byte, err error) { 873 size := m.Size() 874 dAtA = make([]byte, size) 875 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 876 if err != nil { 877 return nil, err 878 } 879 return dAtA[:n], nil 880 } 881 882 func (m *LightBlockRequest) MarshalTo(dAtA []byte) (int, error) { 883 size := m.Size() 884 return m.MarshalToSizedBuffer(dAtA[:size]) 885 } 886 887 func (m *LightBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 888 i := len(dAtA) 889 _ = i 890 var l int 891 _ = l 892 if m.Height != 0 { 893 i = encodeVarintTypes(dAtA, i, uint64(m.Height)) 894 i-- 895 dAtA[i] = 0x8 896 } 897 return len(dAtA) - i, nil 898 } 899 900 func (m *LightBlockResponse) Marshal() (dAtA []byte, err error) { 901 size := m.Size() 902 dAtA = make([]byte, size) 903 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 904 if err != nil { 905 return nil, err 906 } 907 return dAtA[:n], nil 908 } 909 910 func (m *LightBlockResponse) MarshalTo(dAtA []byte) (int, error) { 911 size := m.Size() 912 return m.MarshalToSizedBuffer(dAtA[:size]) 913 } 914 915 func (m *LightBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 916 i := len(dAtA) 917 _ = i 918 var l int 919 _ = l 920 if m.LightBlock != nil { 921 { 922 size, err := m.LightBlock.MarshalToSizedBuffer(dAtA[:i]) 923 if err != nil { 924 return 0, err 925 } 926 i -= size 927 i = encodeVarintTypes(dAtA, i, uint64(size)) 928 } 929 i-- 930 dAtA[i] = 0xa 931 } 932 return len(dAtA) - i, nil 933 } 934 935 func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { 936 offset -= sovTypes(v) 937 base := offset 938 for v >= 1<<7 { 939 dAtA[offset] = uint8(v&0x7f | 0x80) 940 v >>= 7 941 offset++ 942 } 943 dAtA[offset] = uint8(v) 944 return base 945 } 946 func (m *Message) Size() (n int) { 947 if m == nil { 948 return 0 949 } 950 var l int 951 _ = l 952 if m.Sum != nil { 953 n += m.Sum.Size() 954 } 955 return n 956 } 957 958 func (m *Message_SnapshotsRequest) Size() (n int) { 959 if m == nil { 960 return 0 961 } 962 var l int 963 _ = l 964 if m.SnapshotsRequest != nil { 965 l = m.SnapshotsRequest.Size() 966 n += 1 + l + sovTypes(uint64(l)) 967 } 968 return n 969 } 970 func (m *Message_SnapshotsResponse) Size() (n int) { 971 if m == nil { 972 return 0 973 } 974 var l int 975 _ = l 976 if m.SnapshotsResponse != nil { 977 l = m.SnapshotsResponse.Size() 978 n += 1 + l + sovTypes(uint64(l)) 979 } 980 return n 981 } 982 func (m *Message_ChunkRequest) Size() (n int) { 983 if m == nil { 984 return 0 985 } 986 var l int 987 _ = l 988 if m.ChunkRequest != nil { 989 l = m.ChunkRequest.Size() 990 n += 1 + l + sovTypes(uint64(l)) 991 } 992 return n 993 } 994 func (m *Message_ChunkResponse) Size() (n int) { 995 if m == nil { 996 return 0 997 } 998 var l int 999 _ = l 1000 if m.ChunkResponse != nil { 1001 l = m.ChunkResponse.Size() 1002 n += 1 + l + sovTypes(uint64(l)) 1003 } 1004 return n 1005 } 1006 func (m *Message_LightBlockRequest) Size() (n int) { 1007 if m == nil { 1008 return 0 1009 } 1010 var l int 1011 _ = l 1012 if m.LightBlockRequest != nil { 1013 l = m.LightBlockRequest.Size() 1014 n += 1 + l + sovTypes(uint64(l)) 1015 } 1016 return n 1017 } 1018 func (m *Message_LightBlockResponse) Size() (n int) { 1019 if m == nil { 1020 return 0 1021 } 1022 var l int 1023 _ = l 1024 if m.LightBlockResponse != nil { 1025 l = m.LightBlockResponse.Size() 1026 n += 1 + l + sovTypes(uint64(l)) 1027 } 1028 return n 1029 } 1030 func (m *SnapshotsRequest) Size() (n int) { 1031 if m == nil { 1032 return 0 1033 } 1034 var l int 1035 _ = l 1036 return n 1037 } 1038 1039 func (m *SnapshotsResponse) Size() (n int) { 1040 if m == nil { 1041 return 0 1042 } 1043 var l int 1044 _ = l 1045 if m.Height != 0 { 1046 n += 1 + sovTypes(uint64(m.Height)) 1047 } 1048 if m.Format != 0 { 1049 n += 1 + sovTypes(uint64(m.Format)) 1050 } 1051 if m.Chunks != 0 { 1052 n += 1 + sovTypes(uint64(m.Chunks)) 1053 } 1054 l = len(m.Hash) 1055 if l > 0 { 1056 n += 1 + l + sovTypes(uint64(l)) 1057 } 1058 l = len(m.Metadata) 1059 if l > 0 { 1060 n += 1 + l + sovTypes(uint64(l)) 1061 } 1062 return n 1063 } 1064 1065 func (m *ChunkRequest) Size() (n int) { 1066 if m == nil { 1067 return 0 1068 } 1069 var l int 1070 _ = l 1071 if m.Height != 0 { 1072 n += 1 + sovTypes(uint64(m.Height)) 1073 } 1074 if m.Format != 0 { 1075 n += 1 + sovTypes(uint64(m.Format)) 1076 } 1077 if m.Index != 0 { 1078 n += 1 + sovTypes(uint64(m.Index)) 1079 } 1080 return n 1081 } 1082 1083 func (m *ChunkResponse) Size() (n int) { 1084 if m == nil { 1085 return 0 1086 } 1087 var l int 1088 _ = l 1089 if m.Height != 0 { 1090 n += 1 + sovTypes(uint64(m.Height)) 1091 } 1092 if m.Format != 0 { 1093 n += 1 + sovTypes(uint64(m.Format)) 1094 } 1095 if m.Index != 0 { 1096 n += 1 + sovTypes(uint64(m.Index)) 1097 } 1098 l = len(m.Chunk) 1099 if l > 0 { 1100 n += 1 + l + sovTypes(uint64(l)) 1101 } 1102 if m.Missing { 1103 n += 2 1104 } 1105 return n 1106 } 1107 1108 func (m *LightBlockRequest) Size() (n int) { 1109 if m == nil { 1110 return 0 1111 } 1112 var l int 1113 _ = l 1114 if m.Height != 0 { 1115 n += 1 + sovTypes(uint64(m.Height)) 1116 } 1117 return n 1118 } 1119 1120 func (m *LightBlockResponse) Size() (n int) { 1121 if m == nil { 1122 return 0 1123 } 1124 var l int 1125 _ = l 1126 if m.LightBlock != nil { 1127 l = m.LightBlock.Size() 1128 n += 1 + l + sovTypes(uint64(l)) 1129 } 1130 return n 1131 } 1132 1133 func sovTypes(x uint64) (n int) { 1134 return (math_bits.Len64(x|1) + 6) / 7 1135 } 1136 func sozTypes(x uint64) (n int) { 1137 return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1138 } 1139 func (m *Message) Unmarshal(dAtA []byte) error { 1140 l := len(dAtA) 1141 iNdEx := 0 1142 for iNdEx < l { 1143 preIndex := iNdEx 1144 var wire uint64 1145 for shift := uint(0); ; shift += 7 { 1146 if shift >= 64 { 1147 return ErrIntOverflowTypes 1148 } 1149 if iNdEx >= l { 1150 return io.ErrUnexpectedEOF 1151 } 1152 b := dAtA[iNdEx] 1153 iNdEx++ 1154 wire |= uint64(b&0x7F) << shift 1155 if b < 0x80 { 1156 break 1157 } 1158 } 1159 fieldNum := int32(wire >> 3) 1160 wireType := int(wire & 0x7) 1161 if wireType == 4 { 1162 return fmt.Errorf("proto: Message: wiretype end group for non-group") 1163 } 1164 if fieldNum <= 0 { 1165 return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) 1166 } 1167 switch fieldNum { 1168 case 1: 1169 if wireType != 2 { 1170 return fmt.Errorf("proto: wrong wireType = %d for field SnapshotsRequest", wireType) 1171 } 1172 var msglen int 1173 for shift := uint(0); ; shift += 7 { 1174 if shift >= 64 { 1175 return ErrIntOverflowTypes 1176 } 1177 if iNdEx >= l { 1178 return io.ErrUnexpectedEOF 1179 } 1180 b := dAtA[iNdEx] 1181 iNdEx++ 1182 msglen |= int(b&0x7F) << shift 1183 if b < 0x80 { 1184 break 1185 } 1186 } 1187 if msglen < 0 { 1188 return ErrInvalidLengthTypes 1189 } 1190 postIndex := iNdEx + msglen 1191 if postIndex < 0 { 1192 return ErrInvalidLengthTypes 1193 } 1194 if postIndex > l { 1195 return io.ErrUnexpectedEOF 1196 } 1197 v := &SnapshotsRequest{} 1198 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1199 return err 1200 } 1201 m.Sum = &Message_SnapshotsRequest{v} 1202 iNdEx = postIndex 1203 case 2: 1204 if wireType != 2 { 1205 return fmt.Errorf("proto: wrong wireType = %d for field SnapshotsResponse", wireType) 1206 } 1207 var msglen int 1208 for shift := uint(0); ; shift += 7 { 1209 if shift >= 64 { 1210 return ErrIntOverflowTypes 1211 } 1212 if iNdEx >= l { 1213 return io.ErrUnexpectedEOF 1214 } 1215 b := dAtA[iNdEx] 1216 iNdEx++ 1217 msglen |= int(b&0x7F) << shift 1218 if b < 0x80 { 1219 break 1220 } 1221 } 1222 if msglen < 0 { 1223 return ErrInvalidLengthTypes 1224 } 1225 postIndex := iNdEx + msglen 1226 if postIndex < 0 { 1227 return ErrInvalidLengthTypes 1228 } 1229 if postIndex > l { 1230 return io.ErrUnexpectedEOF 1231 } 1232 v := &SnapshotsResponse{} 1233 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1234 return err 1235 } 1236 m.Sum = &Message_SnapshotsResponse{v} 1237 iNdEx = postIndex 1238 case 3: 1239 if wireType != 2 { 1240 return fmt.Errorf("proto: wrong wireType = %d for field ChunkRequest", wireType) 1241 } 1242 var msglen int 1243 for shift := uint(0); ; shift += 7 { 1244 if shift >= 64 { 1245 return ErrIntOverflowTypes 1246 } 1247 if iNdEx >= l { 1248 return io.ErrUnexpectedEOF 1249 } 1250 b := dAtA[iNdEx] 1251 iNdEx++ 1252 msglen |= int(b&0x7F) << shift 1253 if b < 0x80 { 1254 break 1255 } 1256 } 1257 if msglen < 0 { 1258 return ErrInvalidLengthTypes 1259 } 1260 postIndex := iNdEx + msglen 1261 if postIndex < 0 { 1262 return ErrInvalidLengthTypes 1263 } 1264 if postIndex > l { 1265 return io.ErrUnexpectedEOF 1266 } 1267 v := &ChunkRequest{} 1268 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1269 return err 1270 } 1271 m.Sum = &Message_ChunkRequest{v} 1272 iNdEx = postIndex 1273 case 4: 1274 if wireType != 2 { 1275 return fmt.Errorf("proto: wrong wireType = %d for field ChunkResponse", wireType) 1276 } 1277 var msglen int 1278 for shift := uint(0); ; shift += 7 { 1279 if shift >= 64 { 1280 return ErrIntOverflowTypes 1281 } 1282 if iNdEx >= l { 1283 return io.ErrUnexpectedEOF 1284 } 1285 b := dAtA[iNdEx] 1286 iNdEx++ 1287 msglen |= int(b&0x7F) << shift 1288 if b < 0x80 { 1289 break 1290 } 1291 } 1292 if msglen < 0 { 1293 return ErrInvalidLengthTypes 1294 } 1295 postIndex := iNdEx + msglen 1296 if postIndex < 0 { 1297 return ErrInvalidLengthTypes 1298 } 1299 if postIndex > l { 1300 return io.ErrUnexpectedEOF 1301 } 1302 v := &ChunkResponse{} 1303 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1304 return err 1305 } 1306 m.Sum = &Message_ChunkResponse{v} 1307 iNdEx = postIndex 1308 case 5: 1309 if wireType != 2 { 1310 return fmt.Errorf("proto: wrong wireType = %d for field LightBlockRequest", wireType) 1311 } 1312 var msglen int 1313 for shift := uint(0); ; shift += 7 { 1314 if shift >= 64 { 1315 return ErrIntOverflowTypes 1316 } 1317 if iNdEx >= l { 1318 return io.ErrUnexpectedEOF 1319 } 1320 b := dAtA[iNdEx] 1321 iNdEx++ 1322 msglen |= int(b&0x7F) << shift 1323 if b < 0x80 { 1324 break 1325 } 1326 } 1327 if msglen < 0 { 1328 return ErrInvalidLengthTypes 1329 } 1330 postIndex := iNdEx + msglen 1331 if postIndex < 0 { 1332 return ErrInvalidLengthTypes 1333 } 1334 if postIndex > l { 1335 return io.ErrUnexpectedEOF 1336 } 1337 v := &LightBlockRequest{} 1338 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1339 return err 1340 } 1341 m.Sum = &Message_LightBlockRequest{v} 1342 iNdEx = postIndex 1343 case 6: 1344 if wireType != 2 { 1345 return fmt.Errorf("proto: wrong wireType = %d for field LightBlockResponse", wireType) 1346 } 1347 var msglen int 1348 for shift := uint(0); ; shift += 7 { 1349 if shift >= 64 { 1350 return ErrIntOverflowTypes 1351 } 1352 if iNdEx >= l { 1353 return io.ErrUnexpectedEOF 1354 } 1355 b := dAtA[iNdEx] 1356 iNdEx++ 1357 msglen |= int(b&0x7F) << shift 1358 if b < 0x80 { 1359 break 1360 } 1361 } 1362 if msglen < 0 { 1363 return ErrInvalidLengthTypes 1364 } 1365 postIndex := iNdEx + msglen 1366 if postIndex < 0 { 1367 return ErrInvalidLengthTypes 1368 } 1369 if postIndex > l { 1370 return io.ErrUnexpectedEOF 1371 } 1372 v := &LightBlockResponse{} 1373 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1374 return err 1375 } 1376 m.Sum = &Message_LightBlockResponse{v} 1377 iNdEx = postIndex 1378 default: 1379 iNdEx = preIndex 1380 skippy, err := skipTypes(dAtA[iNdEx:]) 1381 if err != nil { 1382 return err 1383 } 1384 if (skippy < 0) || (iNdEx+skippy) < 0 { 1385 return ErrInvalidLengthTypes 1386 } 1387 if (iNdEx + skippy) > l { 1388 return io.ErrUnexpectedEOF 1389 } 1390 iNdEx += skippy 1391 } 1392 } 1393 1394 if iNdEx > l { 1395 return io.ErrUnexpectedEOF 1396 } 1397 return nil 1398 } 1399 func (m *SnapshotsRequest) Unmarshal(dAtA []byte) error { 1400 l := len(dAtA) 1401 iNdEx := 0 1402 for iNdEx < l { 1403 preIndex := iNdEx 1404 var wire uint64 1405 for shift := uint(0); ; shift += 7 { 1406 if shift >= 64 { 1407 return ErrIntOverflowTypes 1408 } 1409 if iNdEx >= l { 1410 return io.ErrUnexpectedEOF 1411 } 1412 b := dAtA[iNdEx] 1413 iNdEx++ 1414 wire |= uint64(b&0x7F) << shift 1415 if b < 0x80 { 1416 break 1417 } 1418 } 1419 fieldNum := int32(wire >> 3) 1420 wireType := int(wire & 0x7) 1421 if wireType == 4 { 1422 return fmt.Errorf("proto: SnapshotsRequest: wiretype end group for non-group") 1423 } 1424 if fieldNum <= 0 { 1425 return fmt.Errorf("proto: SnapshotsRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1426 } 1427 switch fieldNum { 1428 default: 1429 iNdEx = preIndex 1430 skippy, err := skipTypes(dAtA[iNdEx:]) 1431 if err != nil { 1432 return err 1433 } 1434 if (skippy < 0) || (iNdEx+skippy) < 0 { 1435 return ErrInvalidLengthTypes 1436 } 1437 if (iNdEx + skippy) > l { 1438 return io.ErrUnexpectedEOF 1439 } 1440 iNdEx += skippy 1441 } 1442 } 1443 1444 if iNdEx > l { 1445 return io.ErrUnexpectedEOF 1446 } 1447 return nil 1448 } 1449 func (m *SnapshotsResponse) Unmarshal(dAtA []byte) error { 1450 l := len(dAtA) 1451 iNdEx := 0 1452 for iNdEx < l { 1453 preIndex := iNdEx 1454 var wire uint64 1455 for shift := uint(0); ; shift += 7 { 1456 if shift >= 64 { 1457 return ErrIntOverflowTypes 1458 } 1459 if iNdEx >= l { 1460 return io.ErrUnexpectedEOF 1461 } 1462 b := dAtA[iNdEx] 1463 iNdEx++ 1464 wire |= uint64(b&0x7F) << shift 1465 if b < 0x80 { 1466 break 1467 } 1468 } 1469 fieldNum := int32(wire >> 3) 1470 wireType := int(wire & 0x7) 1471 if wireType == 4 { 1472 return fmt.Errorf("proto: SnapshotsResponse: wiretype end group for non-group") 1473 } 1474 if fieldNum <= 0 { 1475 return fmt.Errorf("proto: SnapshotsResponse: illegal tag %d (wire type %d)", fieldNum, wire) 1476 } 1477 switch fieldNum { 1478 case 1: 1479 if wireType != 0 { 1480 return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) 1481 } 1482 m.Height = 0 1483 for shift := uint(0); ; shift += 7 { 1484 if shift >= 64 { 1485 return ErrIntOverflowTypes 1486 } 1487 if iNdEx >= l { 1488 return io.ErrUnexpectedEOF 1489 } 1490 b := dAtA[iNdEx] 1491 iNdEx++ 1492 m.Height |= uint64(b&0x7F) << shift 1493 if b < 0x80 { 1494 break 1495 } 1496 } 1497 case 2: 1498 if wireType != 0 { 1499 return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) 1500 } 1501 m.Format = 0 1502 for shift := uint(0); ; shift += 7 { 1503 if shift >= 64 { 1504 return ErrIntOverflowTypes 1505 } 1506 if iNdEx >= l { 1507 return io.ErrUnexpectedEOF 1508 } 1509 b := dAtA[iNdEx] 1510 iNdEx++ 1511 m.Format |= uint32(b&0x7F) << shift 1512 if b < 0x80 { 1513 break 1514 } 1515 } 1516 case 3: 1517 if wireType != 0 { 1518 return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) 1519 } 1520 m.Chunks = 0 1521 for shift := uint(0); ; shift += 7 { 1522 if shift >= 64 { 1523 return ErrIntOverflowTypes 1524 } 1525 if iNdEx >= l { 1526 return io.ErrUnexpectedEOF 1527 } 1528 b := dAtA[iNdEx] 1529 iNdEx++ 1530 m.Chunks |= uint32(b&0x7F) << shift 1531 if b < 0x80 { 1532 break 1533 } 1534 } 1535 case 4: 1536 if wireType != 2 { 1537 return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) 1538 } 1539 var byteLen int 1540 for shift := uint(0); ; shift += 7 { 1541 if shift >= 64 { 1542 return ErrIntOverflowTypes 1543 } 1544 if iNdEx >= l { 1545 return io.ErrUnexpectedEOF 1546 } 1547 b := dAtA[iNdEx] 1548 iNdEx++ 1549 byteLen |= int(b&0x7F) << shift 1550 if b < 0x80 { 1551 break 1552 } 1553 } 1554 if byteLen < 0 { 1555 return ErrInvalidLengthTypes 1556 } 1557 postIndex := iNdEx + byteLen 1558 if postIndex < 0 { 1559 return ErrInvalidLengthTypes 1560 } 1561 if postIndex > l { 1562 return io.ErrUnexpectedEOF 1563 } 1564 m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) 1565 if m.Hash == nil { 1566 m.Hash = []byte{} 1567 } 1568 iNdEx = postIndex 1569 case 5: 1570 if wireType != 2 { 1571 return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) 1572 } 1573 var byteLen int 1574 for shift := uint(0); ; shift += 7 { 1575 if shift >= 64 { 1576 return ErrIntOverflowTypes 1577 } 1578 if iNdEx >= l { 1579 return io.ErrUnexpectedEOF 1580 } 1581 b := dAtA[iNdEx] 1582 iNdEx++ 1583 byteLen |= int(b&0x7F) << shift 1584 if b < 0x80 { 1585 break 1586 } 1587 } 1588 if byteLen < 0 { 1589 return ErrInvalidLengthTypes 1590 } 1591 postIndex := iNdEx + byteLen 1592 if postIndex < 0 { 1593 return ErrInvalidLengthTypes 1594 } 1595 if postIndex > l { 1596 return io.ErrUnexpectedEOF 1597 } 1598 m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) 1599 if m.Metadata == nil { 1600 m.Metadata = []byte{} 1601 } 1602 iNdEx = postIndex 1603 default: 1604 iNdEx = preIndex 1605 skippy, err := skipTypes(dAtA[iNdEx:]) 1606 if err != nil { 1607 return err 1608 } 1609 if (skippy < 0) || (iNdEx+skippy) < 0 { 1610 return ErrInvalidLengthTypes 1611 } 1612 if (iNdEx + skippy) > l { 1613 return io.ErrUnexpectedEOF 1614 } 1615 iNdEx += skippy 1616 } 1617 } 1618 1619 if iNdEx > l { 1620 return io.ErrUnexpectedEOF 1621 } 1622 return nil 1623 } 1624 func (m *ChunkRequest) Unmarshal(dAtA []byte) error { 1625 l := len(dAtA) 1626 iNdEx := 0 1627 for iNdEx < l { 1628 preIndex := iNdEx 1629 var wire uint64 1630 for shift := uint(0); ; shift += 7 { 1631 if shift >= 64 { 1632 return ErrIntOverflowTypes 1633 } 1634 if iNdEx >= l { 1635 return io.ErrUnexpectedEOF 1636 } 1637 b := dAtA[iNdEx] 1638 iNdEx++ 1639 wire |= uint64(b&0x7F) << shift 1640 if b < 0x80 { 1641 break 1642 } 1643 } 1644 fieldNum := int32(wire >> 3) 1645 wireType := int(wire & 0x7) 1646 if wireType == 4 { 1647 return fmt.Errorf("proto: ChunkRequest: wiretype end group for non-group") 1648 } 1649 if fieldNum <= 0 { 1650 return fmt.Errorf("proto: ChunkRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1651 } 1652 switch fieldNum { 1653 case 1: 1654 if wireType != 0 { 1655 return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) 1656 } 1657 m.Height = 0 1658 for shift := uint(0); ; shift += 7 { 1659 if shift >= 64 { 1660 return ErrIntOverflowTypes 1661 } 1662 if iNdEx >= l { 1663 return io.ErrUnexpectedEOF 1664 } 1665 b := dAtA[iNdEx] 1666 iNdEx++ 1667 m.Height |= uint64(b&0x7F) << shift 1668 if b < 0x80 { 1669 break 1670 } 1671 } 1672 case 2: 1673 if wireType != 0 { 1674 return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) 1675 } 1676 m.Format = 0 1677 for shift := uint(0); ; shift += 7 { 1678 if shift >= 64 { 1679 return ErrIntOverflowTypes 1680 } 1681 if iNdEx >= l { 1682 return io.ErrUnexpectedEOF 1683 } 1684 b := dAtA[iNdEx] 1685 iNdEx++ 1686 m.Format |= uint32(b&0x7F) << shift 1687 if b < 0x80 { 1688 break 1689 } 1690 } 1691 case 3: 1692 if wireType != 0 { 1693 return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) 1694 } 1695 m.Index = 0 1696 for shift := uint(0); ; shift += 7 { 1697 if shift >= 64 { 1698 return ErrIntOverflowTypes 1699 } 1700 if iNdEx >= l { 1701 return io.ErrUnexpectedEOF 1702 } 1703 b := dAtA[iNdEx] 1704 iNdEx++ 1705 m.Index |= uint32(b&0x7F) << shift 1706 if b < 0x80 { 1707 break 1708 } 1709 } 1710 default: 1711 iNdEx = preIndex 1712 skippy, err := skipTypes(dAtA[iNdEx:]) 1713 if err != nil { 1714 return err 1715 } 1716 if (skippy < 0) || (iNdEx+skippy) < 0 { 1717 return ErrInvalidLengthTypes 1718 } 1719 if (iNdEx + skippy) > l { 1720 return io.ErrUnexpectedEOF 1721 } 1722 iNdEx += skippy 1723 } 1724 } 1725 1726 if iNdEx > l { 1727 return io.ErrUnexpectedEOF 1728 } 1729 return nil 1730 } 1731 func (m *ChunkResponse) Unmarshal(dAtA []byte) error { 1732 l := len(dAtA) 1733 iNdEx := 0 1734 for iNdEx < l { 1735 preIndex := iNdEx 1736 var wire uint64 1737 for shift := uint(0); ; shift += 7 { 1738 if shift >= 64 { 1739 return ErrIntOverflowTypes 1740 } 1741 if iNdEx >= l { 1742 return io.ErrUnexpectedEOF 1743 } 1744 b := dAtA[iNdEx] 1745 iNdEx++ 1746 wire |= uint64(b&0x7F) << shift 1747 if b < 0x80 { 1748 break 1749 } 1750 } 1751 fieldNum := int32(wire >> 3) 1752 wireType := int(wire & 0x7) 1753 if wireType == 4 { 1754 return fmt.Errorf("proto: ChunkResponse: wiretype end group for non-group") 1755 } 1756 if fieldNum <= 0 { 1757 return fmt.Errorf("proto: ChunkResponse: illegal tag %d (wire type %d)", fieldNum, wire) 1758 } 1759 switch fieldNum { 1760 case 1: 1761 if wireType != 0 { 1762 return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) 1763 } 1764 m.Height = 0 1765 for shift := uint(0); ; shift += 7 { 1766 if shift >= 64 { 1767 return ErrIntOverflowTypes 1768 } 1769 if iNdEx >= l { 1770 return io.ErrUnexpectedEOF 1771 } 1772 b := dAtA[iNdEx] 1773 iNdEx++ 1774 m.Height |= uint64(b&0x7F) << shift 1775 if b < 0x80 { 1776 break 1777 } 1778 } 1779 case 2: 1780 if wireType != 0 { 1781 return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) 1782 } 1783 m.Format = 0 1784 for shift := uint(0); ; shift += 7 { 1785 if shift >= 64 { 1786 return ErrIntOverflowTypes 1787 } 1788 if iNdEx >= l { 1789 return io.ErrUnexpectedEOF 1790 } 1791 b := dAtA[iNdEx] 1792 iNdEx++ 1793 m.Format |= uint32(b&0x7F) << shift 1794 if b < 0x80 { 1795 break 1796 } 1797 } 1798 case 3: 1799 if wireType != 0 { 1800 return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) 1801 } 1802 m.Index = 0 1803 for shift := uint(0); ; shift += 7 { 1804 if shift >= 64 { 1805 return ErrIntOverflowTypes 1806 } 1807 if iNdEx >= l { 1808 return io.ErrUnexpectedEOF 1809 } 1810 b := dAtA[iNdEx] 1811 iNdEx++ 1812 m.Index |= uint32(b&0x7F) << shift 1813 if b < 0x80 { 1814 break 1815 } 1816 } 1817 case 4: 1818 if wireType != 2 { 1819 return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) 1820 } 1821 var byteLen int 1822 for shift := uint(0); ; shift += 7 { 1823 if shift >= 64 { 1824 return ErrIntOverflowTypes 1825 } 1826 if iNdEx >= l { 1827 return io.ErrUnexpectedEOF 1828 } 1829 b := dAtA[iNdEx] 1830 iNdEx++ 1831 byteLen |= int(b&0x7F) << shift 1832 if b < 0x80 { 1833 break 1834 } 1835 } 1836 if byteLen < 0 { 1837 return ErrInvalidLengthTypes 1838 } 1839 postIndex := iNdEx + byteLen 1840 if postIndex < 0 { 1841 return ErrInvalidLengthTypes 1842 } 1843 if postIndex > l { 1844 return io.ErrUnexpectedEOF 1845 } 1846 m.Chunk = append(m.Chunk[:0], dAtA[iNdEx:postIndex]...) 1847 if m.Chunk == nil { 1848 m.Chunk = []byte{} 1849 } 1850 iNdEx = postIndex 1851 case 5: 1852 if wireType != 0 { 1853 return fmt.Errorf("proto: wrong wireType = %d for field Missing", wireType) 1854 } 1855 var v int 1856 for shift := uint(0); ; shift += 7 { 1857 if shift >= 64 { 1858 return ErrIntOverflowTypes 1859 } 1860 if iNdEx >= l { 1861 return io.ErrUnexpectedEOF 1862 } 1863 b := dAtA[iNdEx] 1864 iNdEx++ 1865 v |= int(b&0x7F) << shift 1866 if b < 0x80 { 1867 break 1868 } 1869 } 1870 m.Missing = bool(v != 0) 1871 default: 1872 iNdEx = preIndex 1873 skippy, err := skipTypes(dAtA[iNdEx:]) 1874 if err != nil { 1875 return err 1876 } 1877 if (skippy < 0) || (iNdEx+skippy) < 0 { 1878 return ErrInvalidLengthTypes 1879 } 1880 if (iNdEx + skippy) > l { 1881 return io.ErrUnexpectedEOF 1882 } 1883 iNdEx += skippy 1884 } 1885 } 1886 1887 if iNdEx > l { 1888 return io.ErrUnexpectedEOF 1889 } 1890 return nil 1891 } 1892 func (m *LightBlockRequest) Unmarshal(dAtA []byte) error { 1893 l := len(dAtA) 1894 iNdEx := 0 1895 for iNdEx < l { 1896 preIndex := iNdEx 1897 var wire uint64 1898 for shift := uint(0); ; shift += 7 { 1899 if shift >= 64 { 1900 return ErrIntOverflowTypes 1901 } 1902 if iNdEx >= l { 1903 return io.ErrUnexpectedEOF 1904 } 1905 b := dAtA[iNdEx] 1906 iNdEx++ 1907 wire |= uint64(b&0x7F) << shift 1908 if b < 0x80 { 1909 break 1910 } 1911 } 1912 fieldNum := int32(wire >> 3) 1913 wireType := int(wire & 0x7) 1914 if wireType == 4 { 1915 return fmt.Errorf("proto: LightBlockRequest: wiretype end group for non-group") 1916 } 1917 if fieldNum <= 0 { 1918 return fmt.Errorf("proto: LightBlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1919 } 1920 switch fieldNum { 1921 case 1: 1922 if wireType != 0 { 1923 return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) 1924 } 1925 m.Height = 0 1926 for shift := uint(0); ; shift += 7 { 1927 if shift >= 64 { 1928 return ErrIntOverflowTypes 1929 } 1930 if iNdEx >= l { 1931 return io.ErrUnexpectedEOF 1932 } 1933 b := dAtA[iNdEx] 1934 iNdEx++ 1935 m.Height |= uint64(b&0x7F) << shift 1936 if b < 0x80 { 1937 break 1938 } 1939 } 1940 default: 1941 iNdEx = preIndex 1942 skippy, err := skipTypes(dAtA[iNdEx:]) 1943 if err != nil { 1944 return err 1945 } 1946 if (skippy < 0) || (iNdEx+skippy) < 0 { 1947 return ErrInvalidLengthTypes 1948 } 1949 if (iNdEx + skippy) > l { 1950 return io.ErrUnexpectedEOF 1951 } 1952 iNdEx += skippy 1953 } 1954 } 1955 1956 if iNdEx > l { 1957 return io.ErrUnexpectedEOF 1958 } 1959 return nil 1960 } 1961 func (m *LightBlockResponse) Unmarshal(dAtA []byte) error { 1962 l := len(dAtA) 1963 iNdEx := 0 1964 for iNdEx < l { 1965 preIndex := iNdEx 1966 var wire uint64 1967 for shift := uint(0); ; shift += 7 { 1968 if shift >= 64 { 1969 return ErrIntOverflowTypes 1970 } 1971 if iNdEx >= l { 1972 return io.ErrUnexpectedEOF 1973 } 1974 b := dAtA[iNdEx] 1975 iNdEx++ 1976 wire |= uint64(b&0x7F) << shift 1977 if b < 0x80 { 1978 break 1979 } 1980 } 1981 fieldNum := int32(wire >> 3) 1982 wireType := int(wire & 0x7) 1983 if wireType == 4 { 1984 return fmt.Errorf("proto: LightBlockResponse: wiretype end group for non-group") 1985 } 1986 if fieldNum <= 0 { 1987 return fmt.Errorf("proto: LightBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) 1988 } 1989 switch fieldNum { 1990 case 1: 1991 if wireType != 2 { 1992 return fmt.Errorf("proto: wrong wireType = %d for field LightBlock", wireType) 1993 } 1994 var msglen int 1995 for shift := uint(0); ; shift += 7 { 1996 if shift >= 64 { 1997 return ErrIntOverflowTypes 1998 } 1999 if iNdEx >= l { 2000 return io.ErrUnexpectedEOF 2001 } 2002 b := dAtA[iNdEx] 2003 iNdEx++ 2004 msglen |= int(b&0x7F) << shift 2005 if b < 0x80 { 2006 break 2007 } 2008 } 2009 if msglen < 0 { 2010 return ErrInvalidLengthTypes 2011 } 2012 postIndex := iNdEx + msglen 2013 if postIndex < 0 { 2014 return ErrInvalidLengthTypes 2015 } 2016 if postIndex > l { 2017 return io.ErrUnexpectedEOF 2018 } 2019 if m.LightBlock == nil { 2020 m.LightBlock = &types.LightBlock{} 2021 } 2022 if err := m.LightBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2023 return err 2024 } 2025 iNdEx = postIndex 2026 default: 2027 iNdEx = preIndex 2028 skippy, err := skipTypes(dAtA[iNdEx:]) 2029 if err != nil { 2030 return err 2031 } 2032 if (skippy < 0) || (iNdEx+skippy) < 0 { 2033 return ErrInvalidLengthTypes 2034 } 2035 if (iNdEx + skippy) > l { 2036 return io.ErrUnexpectedEOF 2037 } 2038 iNdEx += skippy 2039 } 2040 } 2041 2042 if iNdEx > l { 2043 return io.ErrUnexpectedEOF 2044 } 2045 return nil 2046 } 2047 func skipTypes(dAtA []byte) (n int, err error) { 2048 l := len(dAtA) 2049 iNdEx := 0 2050 depth := 0 2051 for iNdEx < l { 2052 var wire uint64 2053 for shift := uint(0); ; shift += 7 { 2054 if shift >= 64 { 2055 return 0, ErrIntOverflowTypes 2056 } 2057 if iNdEx >= l { 2058 return 0, io.ErrUnexpectedEOF 2059 } 2060 b := dAtA[iNdEx] 2061 iNdEx++ 2062 wire |= (uint64(b) & 0x7F) << shift 2063 if b < 0x80 { 2064 break 2065 } 2066 } 2067 wireType := int(wire & 0x7) 2068 switch wireType { 2069 case 0: 2070 for shift := uint(0); ; shift += 7 { 2071 if shift >= 64 { 2072 return 0, ErrIntOverflowTypes 2073 } 2074 if iNdEx >= l { 2075 return 0, io.ErrUnexpectedEOF 2076 } 2077 iNdEx++ 2078 if dAtA[iNdEx-1] < 0x80 { 2079 break 2080 } 2081 } 2082 case 1: 2083 iNdEx += 8 2084 case 2: 2085 var length int 2086 for shift := uint(0); ; shift += 7 { 2087 if shift >= 64 { 2088 return 0, ErrIntOverflowTypes 2089 } 2090 if iNdEx >= l { 2091 return 0, io.ErrUnexpectedEOF 2092 } 2093 b := dAtA[iNdEx] 2094 iNdEx++ 2095 length |= (int(b) & 0x7F) << shift 2096 if b < 0x80 { 2097 break 2098 } 2099 } 2100 if length < 0 { 2101 return 0, ErrInvalidLengthTypes 2102 } 2103 iNdEx += length 2104 case 3: 2105 depth++ 2106 case 4: 2107 if depth == 0 { 2108 return 0, ErrUnexpectedEndOfGroupTypes 2109 } 2110 depth-- 2111 case 5: 2112 iNdEx += 4 2113 default: 2114 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 2115 } 2116 if iNdEx < 0 { 2117 return 0, ErrInvalidLengthTypes 2118 } 2119 if depth == 0 { 2120 return iNdEx, nil 2121 } 2122 } 2123 return 0, io.ErrUnexpectedEOF 2124 } 2125 2126 var ( 2127 ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") 2128 ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") 2129 ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") 2130 )