github.com/supragya/TendermintConnector@v0.0.0-20210619045051-113e32b84fb1/chains/tm34/proto/tendermint/blockchain/types.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: tendermint/blockchain/types.proto 3 4 package blockchain 5 6 import ( 7 fmt "fmt" 8 proto "github.com/gogo/protobuf/proto" 9 types "github.com/supragya/TendermintConnector/chains/tm34/proto/tendermint/types" 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 // BlockRequest requests a block for a specific height 27 type BlockRequest struct { 28 Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` 29 } 30 31 func (m *BlockRequest) Reset() { *m = BlockRequest{} } 32 func (m *BlockRequest) String() string { return proto.CompactTextString(m) } 33 func (*BlockRequest) ProtoMessage() {} 34 func (*BlockRequest) Descriptor() ([]byte, []int) { 35 return fileDescriptor_2927480384e78499, []int{0} 36 } 37 func (m *BlockRequest) XXX_Unmarshal(b []byte) error { 38 return m.Unmarshal(b) 39 } 40 func (m *BlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 41 if deterministic { 42 return xxx_messageInfo_BlockRequest.Marshal(b, m, deterministic) 43 } else { 44 b = b[:cap(b)] 45 n, err := m.MarshalToSizedBuffer(b) 46 if err != nil { 47 return nil, err 48 } 49 return b[:n], nil 50 } 51 } 52 func (m *BlockRequest) XXX_Merge(src proto.Message) { 53 xxx_messageInfo_BlockRequest.Merge(m, src) 54 } 55 func (m *BlockRequest) XXX_Size() int { 56 return m.Size() 57 } 58 func (m *BlockRequest) XXX_DiscardUnknown() { 59 xxx_messageInfo_BlockRequest.DiscardUnknown(m) 60 } 61 62 var xxx_messageInfo_BlockRequest proto.InternalMessageInfo 63 64 func (m *BlockRequest) GetHeight() int64 { 65 if m != nil { 66 return m.Height 67 } 68 return 0 69 } 70 71 // NoBlockResponse informs the node that the peer does not have block at the requested height 72 type NoBlockResponse struct { 73 Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` 74 } 75 76 func (m *NoBlockResponse) Reset() { *m = NoBlockResponse{} } 77 func (m *NoBlockResponse) String() string { return proto.CompactTextString(m) } 78 func (*NoBlockResponse) ProtoMessage() {} 79 func (*NoBlockResponse) Descriptor() ([]byte, []int) { 80 return fileDescriptor_2927480384e78499, []int{1} 81 } 82 func (m *NoBlockResponse) XXX_Unmarshal(b []byte) error { 83 return m.Unmarshal(b) 84 } 85 func (m *NoBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 86 if deterministic { 87 return xxx_messageInfo_NoBlockResponse.Marshal(b, m, deterministic) 88 } else { 89 b = b[:cap(b)] 90 n, err := m.MarshalToSizedBuffer(b) 91 if err != nil { 92 return nil, err 93 } 94 return b[:n], nil 95 } 96 } 97 func (m *NoBlockResponse) XXX_Merge(src proto.Message) { 98 xxx_messageInfo_NoBlockResponse.Merge(m, src) 99 } 100 func (m *NoBlockResponse) XXX_Size() int { 101 return m.Size() 102 } 103 func (m *NoBlockResponse) XXX_DiscardUnknown() { 104 xxx_messageInfo_NoBlockResponse.DiscardUnknown(m) 105 } 106 107 var xxx_messageInfo_NoBlockResponse proto.InternalMessageInfo 108 109 func (m *NoBlockResponse) GetHeight() int64 { 110 if m != nil { 111 return m.Height 112 } 113 return 0 114 } 115 116 // BlockResponse returns block to the requested 117 type BlockResponse struct { 118 Block *types.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` 119 } 120 121 func (m *BlockResponse) Reset() { *m = BlockResponse{} } 122 func (m *BlockResponse) String() string { return proto.CompactTextString(m) } 123 func (*BlockResponse) ProtoMessage() {} 124 func (*BlockResponse) Descriptor() ([]byte, []int) { 125 return fileDescriptor_2927480384e78499, []int{2} 126 } 127 func (m *BlockResponse) XXX_Unmarshal(b []byte) error { 128 return m.Unmarshal(b) 129 } 130 func (m *BlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 131 if deterministic { 132 return xxx_messageInfo_BlockResponse.Marshal(b, m, deterministic) 133 } else { 134 b = b[:cap(b)] 135 n, err := m.MarshalToSizedBuffer(b) 136 if err != nil { 137 return nil, err 138 } 139 return b[:n], nil 140 } 141 } 142 func (m *BlockResponse) XXX_Merge(src proto.Message) { 143 xxx_messageInfo_BlockResponse.Merge(m, src) 144 } 145 func (m *BlockResponse) XXX_Size() int { 146 return m.Size() 147 } 148 func (m *BlockResponse) XXX_DiscardUnknown() { 149 xxx_messageInfo_BlockResponse.DiscardUnknown(m) 150 } 151 152 var xxx_messageInfo_BlockResponse proto.InternalMessageInfo 153 154 func (m *BlockResponse) GetBlock() *types.Block { 155 if m != nil { 156 return m.Block 157 } 158 return nil 159 } 160 161 // StatusRequest requests the status of a peer. 162 type StatusRequest struct { 163 } 164 165 func (m *StatusRequest) Reset() { *m = StatusRequest{} } 166 func (m *StatusRequest) String() string { return proto.CompactTextString(m) } 167 func (*StatusRequest) ProtoMessage() {} 168 func (*StatusRequest) Descriptor() ([]byte, []int) { 169 return fileDescriptor_2927480384e78499, []int{3} 170 } 171 func (m *StatusRequest) XXX_Unmarshal(b []byte) error { 172 return m.Unmarshal(b) 173 } 174 func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 175 if deterministic { 176 return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) 177 } else { 178 b = b[:cap(b)] 179 n, err := m.MarshalToSizedBuffer(b) 180 if err != nil { 181 return nil, err 182 } 183 return b[:n], nil 184 } 185 } 186 func (m *StatusRequest) XXX_Merge(src proto.Message) { 187 xxx_messageInfo_StatusRequest.Merge(m, src) 188 } 189 func (m *StatusRequest) XXX_Size() int { 190 return m.Size() 191 } 192 func (m *StatusRequest) XXX_DiscardUnknown() { 193 xxx_messageInfo_StatusRequest.DiscardUnknown(m) 194 } 195 196 var xxx_messageInfo_StatusRequest proto.InternalMessageInfo 197 198 // StatusResponse is a peer response to inform their status. 199 type StatusResponse struct { 200 Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` 201 Base int64 `protobuf:"varint,2,opt,name=base,proto3" json:"base,omitempty"` 202 } 203 204 func (m *StatusResponse) Reset() { *m = StatusResponse{} } 205 func (m *StatusResponse) String() string { return proto.CompactTextString(m) } 206 func (*StatusResponse) ProtoMessage() {} 207 func (*StatusResponse) Descriptor() ([]byte, []int) { 208 return fileDescriptor_2927480384e78499, []int{4} 209 } 210 func (m *StatusResponse) XXX_Unmarshal(b []byte) error { 211 return m.Unmarshal(b) 212 } 213 func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 214 if deterministic { 215 return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) 216 } else { 217 b = b[:cap(b)] 218 n, err := m.MarshalToSizedBuffer(b) 219 if err != nil { 220 return nil, err 221 } 222 return b[:n], nil 223 } 224 } 225 func (m *StatusResponse) XXX_Merge(src proto.Message) { 226 xxx_messageInfo_StatusResponse.Merge(m, src) 227 } 228 func (m *StatusResponse) XXX_Size() int { 229 return m.Size() 230 } 231 func (m *StatusResponse) XXX_DiscardUnknown() { 232 xxx_messageInfo_StatusResponse.DiscardUnknown(m) 233 } 234 235 var xxx_messageInfo_StatusResponse proto.InternalMessageInfo 236 237 func (m *StatusResponse) GetHeight() int64 { 238 if m != nil { 239 return m.Height 240 } 241 return 0 242 } 243 244 func (m *StatusResponse) GetBase() int64 { 245 if m != nil { 246 return m.Base 247 } 248 return 0 249 } 250 251 type Message struct { 252 // Types that are valid to be assigned to Sum: 253 // *Message_BlockRequest 254 // *Message_NoBlockResponse 255 // *Message_BlockResponse 256 // *Message_StatusRequest 257 // *Message_StatusResponse 258 Sum isMessage_Sum `protobuf_oneof:"sum"` 259 } 260 261 func (m *Message) Reset() { *m = Message{} } 262 func (m *Message) String() string { return proto.CompactTextString(m) } 263 func (*Message) ProtoMessage() {} 264 func (*Message) Descriptor() ([]byte, []int) { 265 return fileDescriptor_2927480384e78499, []int{5} 266 } 267 func (m *Message) XXX_Unmarshal(b []byte) error { 268 return m.Unmarshal(b) 269 } 270 func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 271 if deterministic { 272 return xxx_messageInfo_Message.Marshal(b, m, deterministic) 273 } else { 274 b = b[:cap(b)] 275 n, err := m.MarshalToSizedBuffer(b) 276 if err != nil { 277 return nil, err 278 } 279 return b[:n], nil 280 } 281 } 282 func (m *Message) XXX_Merge(src proto.Message) { 283 xxx_messageInfo_Message.Merge(m, src) 284 } 285 func (m *Message) XXX_Size() int { 286 return m.Size() 287 } 288 func (m *Message) XXX_DiscardUnknown() { 289 xxx_messageInfo_Message.DiscardUnknown(m) 290 } 291 292 var xxx_messageInfo_Message proto.InternalMessageInfo 293 294 type isMessage_Sum interface { 295 isMessage_Sum() 296 MarshalTo([]byte) (int, error) 297 Size() int 298 } 299 300 type Message_BlockRequest struct { 301 BlockRequest *BlockRequest `protobuf:"bytes,1,opt,name=block_request,json=blockRequest,proto3,oneof" json:"block_request,omitempty"` 302 } 303 type Message_NoBlockResponse struct { 304 NoBlockResponse *NoBlockResponse `protobuf:"bytes,2,opt,name=no_block_response,json=noBlockResponse,proto3,oneof" json:"no_block_response,omitempty"` 305 } 306 type Message_BlockResponse struct { 307 BlockResponse *BlockResponse `protobuf:"bytes,3,opt,name=block_response,json=blockResponse,proto3,oneof" json:"block_response,omitempty"` 308 } 309 type Message_StatusRequest struct { 310 StatusRequest *StatusRequest `protobuf:"bytes,4,opt,name=status_request,json=statusRequest,proto3,oneof" json:"status_request,omitempty"` 311 } 312 type Message_StatusResponse struct { 313 StatusResponse *StatusResponse `protobuf:"bytes,5,opt,name=status_response,json=statusResponse,proto3,oneof" json:"status_response,omitempty"` 314 } 315 316 func (*Message_BlockRequest) isMessage_Sum() {} 317 func (*Message_NoBlockResponse) isMessage_Sum() {} 318 func (*Message_BlockResponse) isMessage_Sum() {} 319 func (*Message_StatusRequest) isMessage_Sum() {} 320 func (*Message_StatusResponse) isMessage_Sum() {} 321 322 func (m *Message) GetSum() isMessage_Sum { 323 if m != nil { 324 return m.Sum 325 } 326 return nil 327 } 328 329 func (m *Message) GetBlockRequest() *BlockRequest { 330 if x, ok := m.GetSum().(*Message_BlockRequest); ok { 331 return x.BlockRequest 332 } 333 return nil 334 } 335 336 func (m *Message) GetNoBlockResponse() *NoBlockResponse { 337 if x, ok := m.GetSum().(*Message_NoBlockResponse); ok { 338 return x.NoBlockResponse 339 } 340 return nil 341 } 342 343 func (m *Message) GetBlockResponse() *BlockResponse { 344 if x, ok := m.GetSum().(*Message_BlockResponse); ok { 345 return x.BlockResponse 346 } 347 return nil 348 } 349 350 func (m *Message) GetStatusRequest() *StatusRequest { 351 if x, ok := m.GetSum().(*Message_StatusRequest); ok { 352 return x.StatusRequest 353 } 354 return nil 355 } 356 357 func (m *Message) GetStatusResponse() *StatusResponse { 358 if x, ok := m.GetSum().(*Message_StatusResponse); ok { 359 return x.StatusResponse 360 } 361 return nil 362 } 363 364 // XXX_OneofWrappers is for the internal use of the proto package. 365 func (*Message) XXX_OneofWrappers() []interface{} { 366 return []interface{}{ 367 (*Message_BlockRequest)(nil), 368 (*Message_NoBlockResponse)(nil), 369 (*Message_BlockResponse)(nil), 370 (*Message_StatusRequest)(nil), 371 (*Message_StatusResponse)(nil), 372 } 373 } 374 375 func init() { 376 proto.RegisterType((*BlockRequest)(nil), "tendermint.blockchain.BlockRequest") 377 proto.RegisterType((*NoBlockResponse)(nil), "tendermint.blockchain.NoBlockResponse") 378 proto.RegisterType((*BlockResponse)(nil), "tendermint.blockchain.BlockResponse") 379 proto.RegisterType((*StatusRequest)(nil), "tendermint.blockchain.StatusRequest") 380 proto.RegisterType((*StatusResponse)(nil), "tendermint.blockchain.StatusResponse") 381 proto.RegisterType((*Message)(nil), "tendermint.blockchain.Message") 382 } 383 384 func init() { proto.RegisterFile("tendermint/blockchain/types.proto", fileDescriptor_2927480384e78499) } 385 386 var fileDescriptor_2927480384e78499 = []byte{ 387 // 392 bytes of a gzipped FileDescriptorProto 388 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xc1, 0x4e, 0xa3, 0x40, 389 0x1c, 0xc6, 0x61, 0x69, 0xbb, 0xc9, 0xbf, 0xa5, 0x64, 0x49, 0x76, 0xb7, 0xd9, 0x6c, 0xc8, 0x2e, 390 0x6a, 0xa3, 0x07, 0x99, 0xa4, 0xf5, 0x68, 0x3c, 0xd4, 0x4b, 0x63, 0x52, 0x35, 0xd8, 0x93, 0x97, 391 0x06, 0x70, 0x02, 0x44, 0x99, 0x41, 0x66, 0x38, 0xf4, 0x2d, 0x7c, 0x06, 0x9f, 0xc6, 0x63, 0x8f, 392 0x1e, 0x4d, 0xfb, 0x22, 0xa6, 0x03, 0xa5, 0x94, 0xb4, 0xf5, 0xc6, 0xfc, 0xf9, 0xfe, 0xbf, 0xef, 393 0x9b, 0x2f, 0x00, 0xff, 0x39, 0x26, 0x0f, 0x38, 0x89, 0x42, 0xc2, 0x91, 0xfb, 0x44, 0xbd, 0x47, 394 0x2f, 0x70, 0x42, 0x82, 0xf8, 0x34, 0xc6, 0xcc, 0x8a, 0x13, 0xca, 0xa9, 0xfe, 0x73, 0x2d, 0xb1, 395 0xd6, 0x92, 0x3f, 0x7f, 0x4b, 0x9b, 0x42, 0x9e, 0xed, 0x67, 0x4b, 0x66, 0x17, 0x5a, 0x83, 0xe5, 396 0xd1, 0xc6, 0xcf, 0x29, 0x66, 0x5c, 0xff, 0x05, 0x8d, 0x00, 0x87, 0x7e, 0xc0, 0x3b, 0xf2, 0x3f, 397 0xf9, 0x58, 0xb1, 0xf3, 0x93, 0x79, 0x02, 0xda, 0x35, 0xcd, 0x95, 0x2c, 0xa6, 0x84, 0xe1, 0x9d, 398 0xd2, 0x0b, 0x50, 0x37, 0x85, 0xa7, 0x50, 0x17, 0x96, 0x42, 0xd7, 0xec, 0xfd, 0xb6, 0x4a, 0x41, 399 0xb3, 0x0b, 0x64, 0xfa, 0x4c, 0x65, 0x6a, 0xa0, 0xde, 0x71, 0x87, 0xa7, 0x2c, 0xcf, 0x64, 0x9e, 400 0x43, 0x7b, 0x35, 0xd8, 0x6f, 0xad, 0xeb, 0x50, 0x73, 0x1d, 0x86, 0x3b, 0xdf, 0xc4, 0x54, 0x3c, 401 0x9b, 0xaf, 0x0a, 0x7c, 0x1f, 0x61, 0xc6, 0x1c, 0x1f, 0xeb, 0x57, 0xa0, 0x0a, 0x8f, 0x49, 0x92, 402 0xa1, 0xf3, 0x44, 0x07, 0xd6, 0xd6, 0xea, 0xac, 0x72, 0x33, 0x43, 0xc9, 0x6e, 0xb9, 0xe5, 0xa6, 403 0xc6, 0xf0, 0x83, 0xd0, 0xc9, 0x0a, 0x97, 0x05, 0x13, 0xc6, 0xcd, 0x5e, 0x77, 0x07, 0xaf, 0xd2, 404 0xe0, 0x50, 0xb2, 0x35, 0x52, 0x29, 0x75, 0x04, 0xed, 0x0a, 0x52, 0x11, 0xc8, 0xc3, 0xfd, 0x11, 405 0x0b, 0xa0, 0xea, 0x56, 0x71, 0x4c, 0x54, 0x57, 0xdc, 0xb8, 0xb6, 0x17, 0xb7, 0x51, 0xfc, 0x12, 406 0xc7, 0xca, 0x03, 0xfd, 0x16, 0xb4, 0x02, 0x97, 0xc7, 0xab, 0x0b, 0xde, 0xd1, 0x17, 0xbc, 0x22, 407 0x5f, 0x9b, 0x6d, 0x4c, 0x06, 0x75, 0x50, 0x58, 0x1a, 0x0d, 0xc2, 0xb7, 0xb9, 0x21, 0xcf, 0xe6, 408 0x86, 0xfc, 0x31, 0x37, 0xe4, 0x97, 0x85, 0x21, 0xcd, 0x16, 0x86, 0xf4, 0xbe, 0x30, 0xa4, 0xfb, 409 0x1b, 0x3f, 0xe4, 0x41, 0xea, 0x5a, 0x1e, 0x8d, 0x10, 0x4b, 0xe3, 0xc4, 0xf1, 0xa7, 0x0e, 0x1a, 410 0x17, 0x66, 0x97, 0x94, 0x10, 0xec, 0x71, 0x9a, 0x20, 0x61, 0xc8, 0x10, 0x8f, 0xfa, 0x67, 0x48, 411 0x7c, 0xdb, 0x68, 0xeb, 0x2f, 0xe3, 0x36, 0xc4, 0xcb, 0xfe, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 412 0x23, 0x0a, 0xc8, 0x13, 0x52, 0x03, 0x00, 0x00, 413 } 414 415 func (m *BlockRequest) Marshal() (dAtA []byte, err error) { 416 size := m.Size() 417 dAtA = make([]byte, size) 418 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 419 if err != nil { 420 return nil, err 421 } 422 return dAtA[:n], nil 423 } 424 425 func (m *BlockRequest) MarshalTo(dAtA []byte) (int, error) { 426 size := m.Size() 427 return m.MarshalToSizedBuffer(dAtA[:size]) 428 } 429 430 func (m *BlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 431 i := len(dAtA) 432 _ = i 433 var l int 434 _ = l 435 if m.Height != 0 { 436 i = encodeVarintTypes(dAtA, i, uint64(m.Height)) 437 i-- 438 dAtA[i] = 0x8 439 } 440 return len(dAtA) - i, nil 441 } 442 443 func (m *NoBlockResponse) Marshal() (dAtA []byte, err error) { 444 size := m.Size() 445 dAtA = make([]byte, size) 446 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 447 if err != nil { 448 return nil, err 449 } 450 return dAtA[:n], nil 451 } 452 453 func (m *NoBlockResponse) MarshalTo(dAtA []byte) (int, error) { 454 size := m.Size() 455 return m.MarshalToSizedBuffer(dAtA[:size]) 456 } 457 458 func (m *NoBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 459 i := len(dAtA) 460 _ = i 461 var l int 462 _ = l 463 if m.Height != 0 { 464 i = encodeVarintTypes(dAtA, i, uint64(m.Height)) 465 i-- 466 dAtA[i] = 0x8 467 } 468 return len(dAtA) - i, nil 469 } 470 471 func (m *BlockResponse) Marshal() (dAtA []byte, err error) { 472 size := m.Size() 473 dAtA = make([]byte, size) 474 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 475 if err != nil { 476 return nil, err 477 } 478 return dAtA[:n], nil 479 } 480 481 func (m *BlockResponse) MarshalTo(dAtA []byte) (int, error) { 482 size := m.Size() 483 return m.MarshalToSizedBuffer(dAtA[:size]) 484 } 485 486 func (m *BlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 487 i := len(dAtA) 488 _ = i 489 var l int 490 _ = l 491 if m.Block != nil { 492 { 493 size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) 494 if err != nil { 495 return 0, err 496 } 497 i -= size 498 i = encodeVarintTypes(dAtA, i, uint64(size)) 499 } 500 i-- 501 dAtA[i] = 0xa 502 } 503 return len(dAtA) - i, nil 504 } 505 506 func (m *StatusRequest) Marshal() (dAtA []byte, err error) { 507 size := m.Size() 508 dAtA = make([]byte, size) 509 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 510 if err != nil { 511 return nil, err 512 } 513 return dAtA[:n], nil 514 } 515 516 func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { 517 size := m.Size() 518 return m.MarshalToSizedBuffer(dAtA[:size]) 519 } 520 521 func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 522 i := len(dAtA) 523 _ = i 524 var l int 525 _ = l 526 return len(dAtA) - i, nil 527 } 528 529 func (m *StatusResponse) Marshal() (dAtA []byte, err error) { 530 size := m.Size() 531 dAtA = make([]byte, size) 532 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 533 if err != nil { 534 return nil, err 535 } 536 return dAtA[:n], nil 537 } 538 539 func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { 540 size := m.Size() 541 return m.MarshalToSizedBuffer(dAtA[:size]) 542 } 543 544 func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 545 i := len(dAtA) 546 _ = i 547 var l int 548 _ = l 549 if m.Base != 0 { 550 i = encodeVarintTypes(dAtA, i, uint64(m.Base)) 551 i-- 552 dAtA[i] = 0x10 553 } 554 if m.Height != 0 { 555 i = encodeVarintTypes(dAtA, i, uint64(m.Height)) 556 i-- 557 dAtA[i] = 0x8 558 } 559 return len(dAtA) - i, nil 560 } 561 562 func (m *Message) Marshal() (dAtA []byte, err error) { 563 size := m.Size() 564 dAtA = make([]byte, size) 565 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 566 if err != nil { 567 return nil, err 568 } 569 return dAtA[:n], nil 570 } 571 572 func (m *Message) MarshalTo(dAtA []byte) (int, error) { 573 size := m.Size() 574 return m.MarshalToSizedBuffer(dAtA[:size]) 575 } 576 577 func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { 578 i := len(dAtA) 579 _ = i 580 var l int 581 _ = l 582 if m.Sum != nil { 583 { 584 size := m.Sum.Size() 585 i -= size 586 if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { 587 return 0, err 588 } 589 } 590 } 591 return len(dAtA) - i, nil 592 } 593 594 func (m *Message_BlockRequest) MarshalTo(dAtA []byte) (int, error) { 595 size := m.Size() 596 return m.MarshalToSizedBuffer(dAtA[:size]) 597 } 598 599 func (m *Message_BlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 600 i := len(dAtA) 601 if m.BlockRequest != nil { 602 { 603 size, err := m.BlockRequest.MarshalToSizedBuffer(dAtA[:i]) 604 if err != nil { 605 return 0, err 606 } 607 i -= size 608 i = encodeVarintTypes(dAtA, i, uint64(size)) 609 } 610 i-- 611 dAtA[i] = 0xa 612 } 613 return len(dAtA) - i, nil 614 } 615 func (m *Message_NoBlockResponse) MarshalTo(dAtA []byte) (int, error) { 616 size := m.Size() 617 return m.MarshalToSizedBuffer(dAtA[:size]) 618 } 619 620 func (m *Message_NoBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 621 i := len(dAtA) 622 if m.NoBlockResponse != nil { 623 { 624 size, err := m.NoBlockResponse.MarshalToSizedBuffer(dAtA[:i]) 625 if err != nil { 626 return 0, err 627 } 628 i -= size 629 i = encodeVarintTypes(dAtA, i, uint64(size)) 630 } 631 i-- 632 dAtA[i] = 0x12 633 } 634 return len(dAtA) - i, nil 635 } 636 func (m *Message_BlockResponse) MarshalTo(dAtA []byte) (int, error) { 637 size := m.Size() 638 return m.MarshalToSizedBuffer(dAtA[:size]) 639 } 640 641 func (m *Message_BlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 642 i := len(dAtA) 643 if m.BlockResponse != nil { 644 { 645 size, err := m.BlockResponse.MarshalToSizedBuffer(dAtA[:i]) 646 if err != nil { 647 return 0, err 648 } 649 i -= size 650 i = encodeVarintTypes(dAtA, i, uint64(size)) 651 } 652 i-- 653 dAtA[i] = 0x1a 654 } 655 return len(dAtA) - i, nil 656 } 657 func (m *Message_StatusRequest) MarshalTo(dAtA []byte) (int, error) { 658 size := m.Size() 659 return m.MarshalToSizedBuffer(dAtA[:size]) 660 } 661 662 func (m *Message_StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 663 i := len(dAtA) 664 if m.StatusRequest != nil { 665 { 666 size, err := m.StatusRequest.MarshalToSizedBuffer(dAtA[:i]) 667 if err != nil { 668 return 0, err 669 } 670 i -= size 671 i = encodeVarintTypes(dAtA, i, uint64(size)) 672 } 673 i-- 674 dAtA[i] = 0x22 675 } 676 return len(dAtA) - i, nil 677 } 678 func (m *Message_StatusResponse) MarshalTo(dAtA []byte) (int, error) { 679 size := m.Size() 680 return m.MarshalToSizedBuffer(dAtA[:size]) 681 } 682 683 func (m *Message_StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 684 i := len(dAtA) 685 if m.StatusResponse != nil { 686 { 687 size, err := m.StatusResponse.MarshalToSizedBuffer(dAtA[:i]) 688 if err != nil { 689 return 0, err 690 } 691 i -= size 692 i = encodeVarintTypes(dAtA, i, uint64(size)) 693 } 694 i-- 695 dAtA[i] = 0x2a 696 } 697 return len(dAtA) - i, nil 698 } 699 func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { 700 offset -= sovTypes(v) 701 base := offset 702 for v >= 1<<7 { 703 dAtA[offset] = uint8(v&0x7f | 0x80) 704 v >>= 7 705 offset++ 706 } 707 dAtA[offset] = uint8(v) 708 return base 709 } 710 func (m *BlockRequest) Size() (n int) { 711 if m == nil { 712 return 0 713 } 714 var l int 715 _ = l 716 if m.Height != 0 { 717 n += 1 + sovTypes(uint64(m.Height)) 718 } 719 return n 720 } 721 722 func (m *NoBlockResponse) Size() (n int) { 723 if m == nil { 724 return 0 725 } 726 var l int 727 _ = l 728 if m.Height != 0 { 729 n += 1 + sovTypes(uint64(m.Height)) 730 } 731 return n 732 } 733 734 func (m *BlockResponse) Size() (n int) { 735 if m == nil { 736 return 0 737 } 738 var l int 739 _ = l 740 if m.Block != nil { 741 l = m.Block.Size() 742 n += 1 + l + sovTypes(uint64(l)) 743 } 744 return n 745 } 746 747 func (m *StatusRequest) Size() (n int) { 748 if m == nil { 749 return 0 750 } 751 var l int 752 _ = l 753 return n 754 } 755 756 func (m *StatusResponse) Size() (n int) { 757 if m == nil { 758 return 0 759 } 760 var l int 761 _ = l 762 if m.Height != 0 { 763 n += 1 + sovTypes(uint64(m.Height)) 764 } 765 if m.Base != 0 { 766 n += 1 + sovTypes(uint64(m.Base)) 767 } 768 return n 769 } 770 771 func (m *Message) Size() (n int) { 772 if m == nil { 773 return 0 774 } 775 var l int 776 _ = l 777 if m.Sum != nil { 778 n += m.Sum.Size() 779 } 780 return n 781 } 782 783 func (m *Message_BlockRequest) Size() (n int) { 784 if m == nil { 785 return 0 786 } 787 var l int 788 _ = l 789 if m.BlockRequest != nil { 790 l = m.BlockRequest.Size() 791 n += 1 + l + sovTypes(uint64(l)) 792 } 793 return n 794 } 795 func (m *Message_NoBlockResponse) Size() (n int) { 796 if m == nil { 797 return 0 798 } 799 var l int 800 _ = l 801 if m.NoBlockResponse != nil { 802 l = m.NoBlockResponse.Size() 803 n += 1 + l + sovTypes(uint64(l)) 804 } 805 return n 806 } 807 func (m *Message_BlockResponse) Size() (n int) { 808 if m == nil { 809 return 0 810 } 811 var l int 812 _ = l 813 if m.BlockResponse != nil { 814 l = m.BlockResponse.Size() 815 n += 1 + l + sovTypes(uint64(l)) 816 } 817 return n 818 } 819 func (m *Message_StatusRequest) Size() (n int) { 820 if m == nil { 821 return 0 822 } 823 var l int 824 _ = l 825 if m.StatusRequest != nil { 826 l = m.StatusRequest.Size() 827 n += 1 + l + sovTypes(uint64(l)) 828 } 829 return n 830 } 831 func (m *Message_StatusResponse) Size() (n int) { 832 if m == nil { 833 return 0 834 } 835 var l int 836 _ = l 837 if m.StatusResponse != nil { 838 l = m.StatusResponse.Size() 839 n += 1 + l + sovTypes(uint64(l)) 840 } 841 return n 842 } 843 844 func sovTypes(x uint64) (n int) { 845 return (math_bits.Len64(x|1) + 6) / 7 846 } 847 func sozTypes(x uint64) (n int) { 848 return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 849 } 850 func (m *BlockRequest) Unmarshal(dAtA []byte) error { 851 l := len(dAtA) 852 iNdEx := 0 853 for iNdEx < l { 854 preIndex := iNdEx 855 var wire uint64 856 for shift := uint(0); ; shift += 7 { 857 if shift >= 64 { 858 return ErrIntOverflowTypes 859 } 860 if iNdEx >= l { 861 return io.ErrUnexpectedEOF 862 } 863 b := dAtA[iNdEx] 864 iNdEx++ 865 wire |= uint64(b&0x7F) << shift 866 if b < 0x80 { 867 break 868 } 869 } 870 fieldNum := int32(wire >> 3) 871 wireType := int(wire & 0x7) 872 if wireType == 4 { 873 return fmt.Errorf("proto: BlockRequest: wiretype end group for non-group") 874 } 875 if fieldNum <= 0 { 876 return fmt.Errorf("proto: BlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) 877 } 878 switch fieldNum { 879 case 1: 880 if wireType != 0 { 881 return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) 882 } 883 m.Height = 0 884 for shift := uint(0); ; shift += 7 { 885 if shift >= 64 { 886 return ErrIntOverflowTypes 887 } 888 if iNdEx >= l { 889 return io.ErrUnexpectedEOF 890 } 891 b := dAtA[iNdEx] 892 iNdEx++ 893 m.Height |= int64(b&0x7F) << shift 894 if b < 0x80 { 895 break 896 } 897 } 898 default: 899 iNdEx = preIndex 900 skippy, err := skipTypes(dAtA[iNdEx:]) 901 if err != nil { 902 return err 903 } 904 if (skippy < 0) || (iNdEx+skippy) < 0 { 905 return ErrInvalidLengthTypes 906 } 907 if (iNdEx + skippy) > l { 908 return io.ErrUnexpectedEOF 909 } 910 iNdEx += skippy 911 } 912 } 913 914 if iNdEx > l { 915 return io.ErrUnexpectedEOF 916 } 917 return nil 918 } 919 func (m *NoBlockResponse) Unmarshal(dAtA []byte) error { 920 l := len(dAtA) 921 iNdEx := 0 922 for iNdEx < l { 923 preIndex := iNdEx 924 var wire uint64 925 for shift := uint(0); ; shift += 7 { 926 if shift >= 64 { 927 return ErrIntOverflowTypes 928 } 929 if iNdEx >= l { 930 return io.ErrUnexpectedEOF 931 } 932 b := dAtA[iNdEx] 933 iNdEx++ 934 wire |= uint64(b&0x7F) << shift 935 if b < 0x80 { 936 break 937 } 938 } 939 fieldNum := int32(wire >> 3) 940 wireType := int(wire & 0x7) 941 if wireType == 4 { 942 return fmt.Errorf("proto: NoBlockResponse: wiretype end group for non-group") 943 } 944 if fieldNum <= 0 { 945 return fmt.Errorf("proto: NoBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) 946 } 947 switch fieldNum { 948 case 1: 949 if wireType != 0 { 950 return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) 951 } 952 m.Height = 0 953 for shift := uint(0); ; shift += 7 { 954 if shift >= 64 { 955 return ErrIntOverflowTypes 956 } 957 if iNdEx >= l { 958 return io.ErrUnexpectedEOF 959 } 960 b := dAtA[iNdEx] 961 iNdEx++ 962 m.Height |= int64(b&0x7F) << shift 963 if b < 0x80 { 964 break 965 } 966 } 967 default: 968 iNdEx = preIndex 969 skippy, err := skipTypes(dAtA[iNdEx:]) 970 if err != nil { 971 return err 972 } 973 if (skippy < 0) || (iNdEx+skippy) < 0 { 974 return ErrInvalidLengthTypes 975 } 976 if (iNdEx + skippy) > l { 977 return io.ErrUnexpectedEOF 978 } 979 iNdEx += skippy 980 } 981 } 982 983 if iNdEx > l { 984 return io.ErrUnexpectedEOF 985 } 986 return nil 987 } 988 func (m *BlockResponse) Unmarshal(dAtA []byte) error { 989 l := len(dAtA) 990 iNdEx := 0 991 for iNdEx < l { 992 preIndex := iNdEx 993 var wire uint64 994 for shift := uint(0); ; shift += 7 { 995 if shift >= 64 { 996 return ErrIntOverflowTypes 997 } 998 if iNdEx >= l { 999 return io.ErrUnexpectedEOF 1000 } 1001 b := dAtA[iNdEx] 1002 iNdEx++ 1003 wire |= uint64(b&0x7F) << shift 1004 if b < 0x80 { 1005 break 1006 } 1007 } 1008 fieldNum := int32(wire >> 3) 1009 wireType := int(wire & 0x7) 1010 if wireType == 4 { 1011 return fmt.Errorf("proto: BlockResponse: wiretype end group for non-group") 1012 } 1013 if fieldNum <= 0 { 1014 return fmt.Errorf("proto: BlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) 1015 } 1016 switch fieldNum { 1017 case 1: 1018 if wireType != 2 { 1019 return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) 1020 } 1021 var msglen int 1022 for shift := uint(0); ; shift += 7 { 1023 if shift >= 64 { 1024 return ErrIntOverflowTypes 1025 } 1026 if iNdEx >= l { 1027 return io.ErrUnexpectedEOF 1028 } 1029 b := dAtA[iNdEx] 1030 iNdEx++ 1031 msglen |= int(b&0x7F) << shift 1032 if b < 0x80 { 1033 break 1034 } 1035 } 1036 if msglen < 0 { 1037 return ErrInvalidLengthTypes 1038 } 1039 postIndex := iNdEx + msglen 1040 if postIndex < 0 { 1041 return ErrInvalidLengthTypes 1042 } 1043 if postIndex > l { 1044 return io.ErrUnexpectedEOF 1045 } 1046 if m.Block == nil { 1047 m.Block = &types.Block{} 1048 } 1049 if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1050 return err 1051 } 1052 iNdEx = postIndex 1053 default: 1054 iNdEx = preIndex 1055 skippy, err := skipTypes(dAtA[iNdEx:]) 1056 if err != nil { 1057 return err 1058 } 1059 if (skippy < 0) || (iNdEx+skippy) < 0 { 1060 return ErrInvalidLengthTypes 1061 } 1062 if (iNdEx + skippy) > l { 1063 return io.ErrUnexpectedEOF 1064 } 1065 iNdEx += skippy 1066 } 1067 } 1068 1069 if iNdEx > l { 1070 return io.ErrUnexpectedEOF 1071 } 1072 return nil 1073 } 1074 func (m *StatusRequest) Unmarshal(dAtA []byte) error { 1075 l := len(dAtA) 1076 iNdEx := 0 1077 for iNdEx < l { 1078 preIndex := iNdEx 1079 var wire uint64 1080 for shift := uint(0); ; shift += 7 { 1081 if shift >= 64 { 1082 return ErrIntOverflowTypes 1083 } 1084 if iNdEx >= l { 1085 return io.ErrUnexpectedEOF 1086 } 1087 b := dAtA[iNdEx] 1088 iNdEx++ 1089 wire |= uint64(b&0x7F) << shift 1090 if b < 0x80 { 1091 break 1092 } 1093 } 1094 fieldNum := int32(wire >> 3) 1095 wireType := int(wire & 0x7) 1096 if wireType == 4 { 1097 return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") 1098 } 1099 if fieldNum <= 0 { 1100 return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1101 } 1102 switch fieldNum { 1103 default: 1104 iNdEx = preIndex 1105 skippy, err := skipTypes(dAtA[iNdEx:]) 1106 if err != nil { 1107 return err 1108 } 1109 if (skippy < 0) || (iNdEx+skippy) < 0 { 1110 return ErrInvalidLengthTypes 1111 } 1112 if (iNdEx + skippy) > l { 1113 return io.ErrUnexpectedEOF 1114 } 1115 iNdEx += skippy 1116 } 1117 } 1118 1119 if iNdEx > l { 1120 return io.ErrUnexpectedEOF 1121 } 1122 return nil 1123 } 1124 func (m *StatusResponse) Unmarshal(dAtA []byte) error { 1125 l := len(dAtA) 1126 iNdEx := 0 1127 for iNdEx < l { 1128 preIndex := iNdEx 1129 var wire uint64 1130 for shift := uint(0); ; shift += 7 { 1131 if shift >= 64 { 1132 return ErrIntOverflowTypes 1133 } 1134 if iNdEx >= l { 1135 return io.ErrUnexpectedEOF 1136 } 1137 b := dAtA[iNdEx] 1138 iNdEx++ 1139 wire |= uint64(b&0x7F) << shift 1140 if b < 0x80 { 1141 break 1142 } 1143 } 1144 fieldNum := int32(wire >> 3) 1145 wireType := int(wire & 0x7) 1146 if wireType == 4 { 1147 return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") 1148 } 1149 if fieldNum <= 0 { 1150 return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) 1151 } 1152 switch fieldNum { 1153 case 1: 1154 if wireType != 0 { 1155 return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) 1156 } 1157 m.Height = 0 1158 for shift := uint(0); ; shift += 7 { 1159 if shift >= 64 { 1160 return ErrIntOverflowTypes 1161 } 1162 if iNdEx >= l { 1163 return io.ErrUnexpectedEOF 1164 } 1165 b := dAtA[iNdEx] 1166 iNdEx++ 1167 m.Height |= int64(b&0x7F) << shift 1168 if b < 0x80 { 1169 break 1170 } 1171 } 1172 case 2: 1173 if wireType != 0 { 1174 return fmt.Errorf("proto: wrong wireType = %d for field Base", wireType) 1175 } 1176 m.Base = 0 1177 for shift := uint(0); ; shift += 7 { 1178 if shift >= 64 { 1179 return ErrIntOverflowTypes 1180 } 1181 if iNdEx >= l { 1182 return io.ErrUnexpectedEOF 1183 } 1184 b := dAtA[iNdEx] 1185 iNdEx++ 1186 m.Base |= int64(b&0x7F) << shift 1187 if b < 0x80 { 1188 break 1189 } 1190 } 1191 default: 1192 iNdEx = preIndex 1193 skippy, err := skipTypes(dAtA[iNdEx:]) 1194 if err != nil { 1195 return err 1196 } 1197 if (skippy < 0) || (iNdEx+skippy) < 0 { 1198 return ErrInvalidLengthTypes 1199 } 1200 if (iNdEx + skippy) > l { 1201 return io.ErrUnexpectedEOF 1202 } 1203 iNdEx += skippy 1204 } 1205 } 1206 1207 if iNdEx > l { 1208 return io.ErrUnexpectedEOF 1209 } 1210 return nil 1211 } 1212 func (m *Message) Unmarshal(dAtA []byte) error { 1213 l := len(dAtA) 1214 iNdEx := 0 1215 for iNdEx < l { 1216 preIndex := iNdEx 1217 var wire uint64 1218 for shift := uint(0); ; shift += 7 { 1219 if shift >= 64 { 1220 return ErrIntOverflowTypes 1221 } 1222 if iNdEx >= l { 1223 return io.ErrUnexpectedEOF 1224 } 1225 b := dAtA[iNdEx] 1226 iNdEx++ 1227 wire |= uint64(b&0x7F) << shift 1228 if b < 0x80 { 1229 break 1230 } 1231 } 1232 fieldNum := int32(wire >> 3) 1233 wireType := int(wire & 0x7) 1234 if wireType == 4 { 1235 return fmt.Errorf("proto: Message: wiretype end group for non-group") 1236 } 1237 if fieldNum <= 0 { 1238 return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) 1239 } 1240 switch fieldNum { 1241 case 1: 1242 if wireType != 2 { 1243 return fmt.Errorf("proto: wrong wireType = %d for field BlockRequest", wireType) 1244 } 1245 var msglen int 1246 for shift := uint(0); ; shift += 7 { 1247 if shift >= 64 { 1248 return ErrIntOverflowTypes 1249 } 1250 if iNdEx >= l { 1251 return io.ErrUnexpectedEOF 1252 } 1253 b := dAtA[iNdEx] 1254 iNdEx++ 1255 msglen |= int(b&0x7F) << shift 1256 if b < 0x80 { 1257 break 1258 } 1259 } 1260 if msglen < 0 { 1261 return ErrInvalidLengthTypes 1262 } 1263 postIndex := iNdEx + msglen 1264 if postIndex < 0 { 1265 return ErrInvalidLengthTypes 1266 } 1267 if postIndex > l { 1268 return io.ErrUnexpectedEOF 1269 } 1270 v := &BlockRequest{} 1271 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1272 return err 1273 } 1274 m.Sum = &Message_BlockRequest{v} 1275 iNdEx = postIndex 1276 case 2: 1277 if wireType != 2 { 1278 return fmt.Errorf("proto: wrong wireType = %d for field NoBlockResponse", wireType) 1279 } 1280 var msglen int 1281 for shift := uint(0); ; shift += 7 { 1282 if shift >= 64 { 1283 return ErrIntOverflowTypes 1284 } 1285 if iNdEx >= l { 1286 return io.ErrUnexpectedEOF 1287 } 1288 b := dAtA[iNdEx] 1289 iNdEx++ 1290 msglen |= int(b&0x7F) << shift 1291 if b < 0x80 { 1292 break 1293 } 1294 } 1295 if msglen < 0 { 1296 return ErrInvalidLengthTypes 1297 } 1298 postIndex := iNdEx + msglen 1299 if postIndex < 0 { 1300 return ErrInvalidLengthTypes 1301 } 1302 if postIndex > l { 1303 return io.ErrUnexpectedEOF 1304 } 1305 v := &NoBlockResponse{} 1306 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1307 return err 1308 } 1309 m.Sum = &Message_NoBlockResponse{v} 1310 iNdEx = postIndex 1311 case 3: 1312 if wireType != 2 { 1313 return fmt.Errorf("proto: wrong wireType = %d for field BlockResponse", wireType) 1314 } 1315 var msglen int 1316 for shift := uint(0); ; shift += 7 { 1317 if shift >= 64 { 1318 return ErrIntOverflowTypes 1319 } 1320 if iNdEx >= l { 1321 return io.ErrUnexpectedEOF 1322 } 1323 b := dAtA[iNdEx] 1324 iNdEx++ 1325 msglen |= int(b&0x7F) << shift 1326 if b < 0x80 { 1327 break 1328 } 1329 } 1330 if msglen < 0 { 1331 return ErrInvalidLengthTypes 1332 } 1333 postIndex := iNdEx + msglen 1334 if postIndex < 0 { 1335 return ErrInvalidLengthTypes 1336 } 1337 if postIndex > l { 1338 return io.ErrUnexpectedEOF 1339 } 1340 v := &BlockResponse{} 1341 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1342 return err 1343 } 1344 m.Sum = &Message_BlockResponse{v} 1345 iNdEx = postIndex 1346 case 4: 1347 if wireType != 2 { 1348 return fmt.Errorf("proto: wrong wireType = %d for field StatusRequest", wireType) 1349 } 1350 var msglen int 1351 for shift := uint(0); ; shift += 7 { 1352 if shift >= 64 { 1353 return ErrIntOverflowTypes 1354 } 1355 if iNdEx >= l { 1356 return io.ErrUnexpectedEOF 1357 } 1358 b := dAtA[iNdEx] 1359 iNdEx++ 1360 msglen |= int(b&0x7F) << shift 1361 if b < 0x80 { 1362 break 1363 } 1364 } 1365 if msglen < 0 { 1366 return ErrInvalidLengthTypes 1367 } 1368 postIndex := iNdEx + msglen 1369 if postIndex < 0 { 1370 return ErrInvalidLengthTypes 1371 } 1372 if postIndex > l { 1373 return io.ErrUnexpectedEOF 1374 } 1375 v := &StatusRequest{} 1376 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1377 return err 1378 } 1379 m.Sum = &Message_StatusRequest{v} 1380 iNdEx = postIndex 1381 case 5: 1382 if wireType != 2 { 1383 return fmt.Errorf("proto: wrong wireType = %d for field StatusResponse", wireType) 1384 } 1385 var msglen int 1386 for shift := uint(0); ; shift += 7 { 1387 if shift >= 64 { 1388 return ErrIntOverflowTypes 1389 } 1390 if iNdEx >= l { 1391 return io.ErrUnexpectedEOF 1392 } 1393 b := dAtA[iNdEx] 1394 iNdEx++ 1395 msglen |= int(b&0x7F) << shift 1396 if b < 0x80 { 1397 break 1398 } 1399 } 1400 if msglen < 0 { 1401 return ErrInvalidLengthTypes 1402 } 1403 postIndex := iNdEx + msglen 1404 if postIndex < 0 { 1405 return ErrInvalidLengthTypes 1406 } 1407 if postIndex > l { 1408 return io.ErrUnexpectedEOF 1409 } 1410 v := &StatusResponse{} 1411 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1412 return err 1413 } 1414 m.Sum = &Message_StatusResponse{v} 1415 iNdEx = postIndex 1416 default: 1417 iNdEx = preIndex 1418 skippy, err := skipTypes(dAtA[iNdEx:]) 1419 if err != nil { 1420 return err 1421 } 1422 if (skippy < 0) || (iNdEx+skippy) < 0 { 1423 return ErrInvalidLengthTypes 1424 } 1425 if (iNdEx + skippy) > l { 1426 return io.ErrUnexpectedEOF 1427 } 1428 iNdEx += skippy 1429 } 1430 } 1431 1432 if iNdEx > l { 1433 return io.ErrUnexpectedEOF 1434 } 1435 return nil 1436 } 1437 func skipTypes(dAtA []byte) (n int, err error) { 1438 l := len(dAtA) 1439 iNdEx := 0 1440 depth := 0 1441 for iNdEx < l { 1442 var wire uint64 1443 for shift := uint(0); ; shift += 7 { 1444 if shift >= 64 { 1445 return 0, ErrIntOverflowTypes 1446 } 1447 if iNdEx >= l { 1448 return 0, io.ErrUnexpectedEOF 1449 } 1450 b := dAtA[iNdEx] 1451 iNdEx++ 1452 wire |= (uint64(b) & 0x7F) << shift 1453 if b < 0x80 { 1454 break 1455 } 1456 } 1457 wireType := int(wire & 0x7) 1458 switch wireType { 1459 case 0: 1460 for shift := uint(0); ; shift += 7 { 1461 if shift >= 64 { 1462 return 0, ErrIntOverflowTypes 1463 } 1464 if iNdEx >= l { 1465 return 0, io.ErrUnexpectedEOF 1466 } 1467 iNdEx++ 1468 if dAtA[iNdEx-1] < 0x80 { 1469 break 1470 } 1471 } 1472 case 1: 1473 iNdEx += 8 1474 case 2: 1475 var length int 1476 for shift := uint(0); ; shift += 7 { 1477 if shift >= 64 { 1478 return 0, ErrIntOverflowTypes 1479 } 1480 if iNdEx >= l { 1481 return 0, io.ErrUnexpectedEOF 1482 } 1483 b := dAtA[iNdEx] 1484 iNdEx++ 1485 length |= (int(b) & 0x7F) << shift 1486 if b < 0x80 { 1487 break 1488 } 1489 } 1490 if length < 0 { 1491 return 0, ErrInvalidLengthTypes 1492 } 1493 iNdEx += length 1494 case 3: 1495 depth++ 1496 case 4: 1497 if depth == 0 { 1498 return 0, ErrUnexpectedEndOfGroupTypes 1499 } 1500 depth-- 1501 case 5: 1502 iNdEx += 4 1503 default: 1504 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1505 } 1506 if iNdEx < 0 { 1507 return 0, ErrInvalidLengthTypes 1508 } 1509 if depth == 0 { 1510 return iNdEx, nil 1511 } 1512 } 1513 return 0, io.ErrUnexpectedEOF 1514 } 1515 1516 var ( 1517 ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") 1518 ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") 1519 ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") 1520 )