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.

1607 lines
37 KiB

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