You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1518 lines
35 KiB

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