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.

494 lines
12 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: proto/types/block.proto
  3. package types
  4. import (
  5. fmt "fmt"
  6. _ "github.com/gogo/protobuf/gogoproto"
  7. proto "github.com/gogo/protobuf/proto"
  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. type Block struct {
  22. Header Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"`
  23. Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"`
  24. Evidence EvidenceData `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"`
  25. LastCommit *Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"`
  26. }
  27. func (m *Block) Reset() { *m = Block{} }
  28. func (m *Block) String() string { return proto.CompactTextString(m) }
  29. func (*Block) ProtoMessage() {}
  30. func (*Block) Descriptor() ([]byte, []int) {
  31. return fileDescriptor_3aa007336dea920d, []int{0}
  32. }
  33. func (m *Block) XXX_Unmarshal(b []byte) error {
  34. return m.Unmarshal(b)
  35. }
  36. func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  37. if deterministic {
  38. return xxx_messageInfo_Block.Marshal(b, m, deterministic)
  39. } else {
  40. b = b[:cap(b)]
  41. n, err := m.MarshalToSizedBuffer(b)
  42. if err != nil {
  43. return nil, err
  44. }
  45. return b[:n], nil
  46. }
  47. }
  48. func (m *Block) XXX_Merge(src proto.Message) {
  49. xxx_messageInfo_Block.Merge(m, src)
  50. }
  51. func (m *Block) XXX_Size() int {
  52. return m.Size()
  53. }
  54. func (m *Block) XXX_DiscardUnknown() {
  55. xxx_messageInfo_Block.DiscardUnknown(m)
  56. }
  57. var xxx_messageInfo_Block proto.InternalMessageInfo
  58. func (m *Block) GetHeader() Header {
  59. if m != nil {
  60. return m.Header
  61. }
  62. return Header{}
  63. }
  64. func (m *Block) GetData() Data {
  65. if m != nil {
  66. return m.Data
  67. }
  68. return Data{}
  69. }
  70. func (m *Block) GetEvidence() EvidenceData {
  71. if m != nil {
  72. return m.Evidence
  73. }
  74. return EvidenceData{}
  75. }
  76. func (m *Block) GetLastCommit() *Commit {
  77. if m != nil {
  78. return m.LastCommit
  79. }
  80. return nil
  81. }
  82. func init() {
  83. proto.RegisterType((*Block)(nil), "tendermint.proto.types.Block")
  84. }
  85. func init() { proto.RegisterFile("proto/types/block.proto", fileDescriptor_3aa007336dea920d) }
  86. var fileDescriptor_3aa007336dea920d = []byte{
  87. // 273 bytes of a gzipped FileDescriptorProto
  88. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0x28, 0xca, 0x2f,
  89. 0xc9, 0xd7, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0xd6, 0x03, 0x8b,
  90. 0x08, 0x89, 0x95, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95, 0x40, 0x44, 0xf4, 0xc0,
  91. 0x6a, 0xa4, 0xd4, 0x4a, 0x32, 0x32, 0x8b, 0x52, 0xe2, 0x0b, 0x12, 0x8b, 0x4a, 0x2a, 0xf5, 0x21,
  92. 0x9a, 0xd3, 0xf3, 0xd3, 0xf3, 0x11, 0x2c, 0x88, 0x6a, 0x29, 0x14, 0x83, 0xc1, 0x24, 0x54, 0x42,
  93. 0x0a, 0x59, 0x22, 0xb5, 0x2c, 0x33, 0x25, 0x35, 0x2f, 0x39, 0x15, 0x22, 0xa7, 0xd4, 0xc6, 0xc4,
  94. 0xc5, 0xea, 0x04, 0x72, 0x84, 0x90, 0x0d, 0x17, 0x5b, 0x46, 0x6a, 0x62, 0x4a, 0x6a, 0x91, 0x04,
  95. 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x9c, 0x1e, 0x76, 0xf7, 0xe8, 0x79, 0x80, 0x55, 0x39, 0xb1,
  96. 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0xd5, 0x23, 0x64, 0xc6, 0xc5, 0x92, 0x92, 0x58, 0x92, 0x28,
  97. 0xc1, 0x04, 0xd6, 0x2b, 0x83, 0x4b, 0xaf, 0x4b, 0x62, 0x49, 0x22, 0x54, 0x27, 0x58, 0xbd, 0x90,
  98. 0x1b, 0x17, 0x07, 0xcc, 0x45, 0x12, 0xcc, 0x60, 0xbd, 0x2a, 0xb8, 0xf4, 0xba, 0x42, 0xd5, 0x21,
  99. 0x99, 0x01, 0xd7, 0x2b, 0x64, 0xcf, 0xc5, 0x9d, 0x93, 0x58, 0x5c, 0x12, 0x9f, 0x9c, 0x9f, 0x9b,
  100. 0x9b, 0x59, 0x22, 0xc1, 0x82, 0xdf, 0x0b, 0xce, 0x60, 0x55, 0x41, 0x5c, 0x20, 0x2d, 0x10, 0xb6,
  101. 0x93, 0xdb, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1,
  102. 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0xa4, 0x67, 0x96,
  103. 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x23, 0xcc, 0x43, 0x66, 0x22, 0x85, 0x6f, 0x12,
  104. 0x1b, 0x98, 0x63, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x42, 0x07, 0x4a, 0xe7, 0x01, 0x00,
  105. 0x00,
  106. }
  107. func (m *Block) Marshal() (dAtA []byte, err error) {
  108. size := m.Size()
  109. dAtA = make([]byte, size)
  110. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  111. if err != nil {
  112. return nil, err
  113. }
  114. return dAtA[:n], nil
  115. }
  116. func (m *Block) MarshalTo(dAtA []byte) (int, error) {
  117. size := m.Size()
  118. return m.MarshalToSizedBuffer(dAtA[:size])
  119. }
  120. func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  121. i := len(dAtA)
  122. _ = i
  123. var l int
  124. _ = l
  125. if m.LastCommit != nil {
  126. {
  127. size, err := m.LastCommit.MarshalToSizedBuffer(dAtA[:i])
  128. if err != nil {
  129. return 0, err
  130. }
  131. i -= size
  132. i = encodeVarintBlock(dAtA, i, uint64(size))
  133. }
  134. i--
  135. dAtA[i] = 0x22
  136. }
  137. {
  138. size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i])
  139. if err != nil {
  140. return 0, err
  141. }
  142. i -= size
  143. i = encodeVarintBlock(dAtA, i, uint64(size))
  144. }
  145. i--
  146. dAtA[i] = 0x1a
  147. {
  148. size, err := m.Data.MarshalToSizedBuffer(dAtA[:i])
  149. if err != nil {
  150. return 0, err
  151. }
  152. i -= size
  153. i = encodeVarintBlock(dAtA, i, uint64(size))
  154. }
  155. i--
  156. dAtA[i] = 0x12
  157. {
  158. size, err := m.Header.MarshalToSizedBuffer(dAtA[:i])
  159. if err != nil {
  160. return 0, err
  161. }
  162. i -= size
  163. i = encodeVarintBlock(dAtA, i, uint64(size))
  164. }
  165. i--
  166. dAtA[i] = 0xa
  167. return len(dAtA) - i, nil
  168. }
  169. func encodeVarintBlock(dAtA []byte, offset int, v uint64) int {
  170. offset -= sovBlock(v)
  171. base := offset
  172. for v >= 1<<7 {
  173. dAtA[offset] = uint8(v&0x7f | 0x80)
  174. v >>= 7
  175. offset++
  176. }
  177. dAtA[offset] = uint8(v)
  178. return base
  179. }
  180. func (m *Block) Size() (n int) {
  181. if m == nil {
  182. return 0
  183. }
  184. var l int
  185. _ = l
  186. l = m.Header.Size()
  187. n += 1 + l + sovBlock(uint64(l))
  188. l = m.Data.Size()
  189. n += 1 + l + sovBlock(uint64(l))
  190. l = m.Evidence.Size()
  191. n += 1 + l + sovBlock(uint64(l))
  192. if m.LastCommit != nil {
  193. l = m.LastCommit.Size()
  194. n += 1 + l + sovBlock(uint64(l))
  195. }
  196. return n
  197. }
  198. func sovBlock(x uint64) (n int) {
  199. return (math_bits.Len64(x|1) + 6) / 7
  200. }
  201. func sozBlock(x uint64) (n int) {
  202. return sovBlock(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  203. }
  204. func (m *Block) Unmarshal(dAtA []byte) error {
  205. l := len(dAtA)
  206. iNdEx := 0
  207. for iNdEx < l {
  208. preIndex := iNdEx
  209. var wire uint64
  210. for shift := uint(0); ; shift += 7 {
  211. if shift >= 64 {
  212. return ErrIntOverflowBlock
  213. }
  214. if iNdEx >= l {
  215. return io.ErrUnexpectedEOF
  216. }
  217. b := dAtA[iNdEx]
  218. iNdEx++
  219. wire |= uint64(b&0x7F) << shift
  220. if b < 0x80 {
  221. break
  222. }
  223. }
  224. fieldNum := int32(wire >> 3)
  225. wireType := int(wire & 0x7)
  226. if wireType == 4 {
  227. return fmt.Errorf("proto: Block: wiretype end group for non-group")
  228. }
  229. if fieldNum <= 0 {
  230. return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire)
  231. }
  232. switch fieldNum {
  233. case 1:
  234. if wireType != 2 {
  235. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  236. }
  237. var msglen int
  238. for shift := uint(0); ; shift += 7 {
  239. if shift >= 64 {
  240. return ErrIntOverflowBlock
  241. }
  242. if iNdEx >= l {
  243. return io.ErrUnexpectedEOF
  244. }
  245. b := dAtA[iNdEx]
  246. iNdEx++
  247. msglen |= int(b&0x7F) << shift
  248. if b < 0x80 {
  249. break
  250. }
  251. }
  252. if msglen < 0 {
  253. return ErrInvalidLengthBlock
  254. }
  255. postIndex := iNdEx + msglen
  256. if postIndex < 0 {
  257. return ErrInvalidLengthBlock
  258. }
  259. if postIndex > l {
  260. return io.ErrUnexpectedEOF
  261. }
  262. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  263. return err
  264. }
  265. iNdEx = postIndex
  266. case 2:
  267. if wireType != 2 {
  268. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  269. }
  270. var msglen int
  271. for shift := uint(0); ; shift += 7 {
  272. if shift >= 64 {
  273. return ErrIntOverflowBlock
  274. }
  275. if iNdEx >= l {
  276. return io.ErrUnexpectedEOF
  277. }
  278. b := dAtA[iNdEx]
  279. iNdEx++
  280. msglen |= int(b&0x7F) << shift
  281. if b < 0x80 {
  282. break
  283. }
  284. }
  285. if msglen < 0 {
  286. return ErrInvalidLengthBlock
  287. }
  288. postIndex := iNdEx + msglen
  289. if postIndex < 0 {
  290. return ErrInvalidLengthBlock
  291. }
  292. if postIndex > l {
  293. return io.ErrUnexpectedEOF
  294. }
  295. if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  296. return err
  297. }
  298. iNdEx = postIndex
  299. case 3:
  300. if wireType != 2 {
  301. return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType)
  302. }
  303. var msglen int
  304. for shift := uint(0); ; shift += 7 {
  305. if shift >= 64 {
  306. return ErrIntOverflowBlock
  307. }
  308. if iNdEx >= l {
  309. return io.ErrUnexpectedEOF
  310. }
  311. b := dAtA[iNdEx]
  312. iNdEx++
  313. msglen |= int(b&0x7F) << shift
  314. if b < 0x80 {
  315. break
  316. }
  317. }
  318. if msglen < 0 {
  319. return ErrInvalidLengthBlock
  320. }
  321. postIndex := iNdEx + msglen
  322. if postIndex < 0 {
  323. return ErrInvalidLengthBlock
  324. }
  325. if postIndex > l {
  326. return io.ErrUnexpectedEOF
  327. }
  328. if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  329. return err
  330. }
  331. iNdEx = postIndex
  332. case 4:
  333. if wireType != 2 {
  334. return fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType)
  335. }
  336. var msglen int
  337. for shift := uint(0); ; shift += 7 {
  338. if shift >= 64 {
  339. return ErrIntOverflowBlock
  340. }
  341. if iNdEx >= l {
  342. return io.ErrUnexpectedEOF
  343. }
  344. b := dAtA[iNdEx]
  345. iNdEx++
  346. msglen |= int(b&0x7F) << shift
  347. if b < 0x80 {
  348. break
  349. }
  350. }
  351. if msglen < 0 {
  352. return ErrInvalidLengthBlock
  353. }
  354. postIndex := iNdEx + msglen
  355. if postIndex < 0 {
  356. return ErrInvalidLengthBlock
  357. }
  358. if postIndex > l {
  359. return io.ErrUnexpectedEOF
  360. }
  361. if m.LastCommit == nil {
  362. m.LastCommit = &Commit{}
  363. }
  364. if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  365. return err
  366. }
  367. iNdEx = postIndex
  368. default:
  369. iNdEx = preIndex
  370. skippy, err := skipBlock(dAtA[iNdEx:])
  371. if err != nil {
  372. return err
  373. }
  374. if skippy < 0 {
  375. return ErrInvalidLengthBlock
  376. }
  377. if (iNdEx + skippy) < 0 {
  378. return ErrInvalidLengthBlock
  379. }
  380. if (iNdEx + skippy) > l {
  381. return io.ErrUnexpectedEOF
  382. }
  383. iNdEx += skippy
  384. }
  385. }
  386. if iNdEx > l {
  387. return io.ErrUnexpectedEOF
  388. }
  389. return nil
  390. }
  391. func skipBlock(dAtA []byte) (n int, err error) {
  392. l := len(dAtA)
  393. iNdEx := 0
  394. depth := 0
  395. for iNdEx < l {
  396. var wire uint64
  397. for shift := uint(0); ; shift += 7 {
  398. if shift >= 64 {
  399. return 0, ErrIntOverflowBlock
  400. }
  401. if iNdEx >= l {
  402. return 0, io.ErrUnexpectedEOF
  403. }
  404. b := dAtA[iNdEx]
  405. iNdEx++
  406. wire |= (uint64(b) & 0x7F) << shift
  407. if b < 0x80 {
  408. break
  409. }
  410. }
  411. wireType := int(wire & 0x7)
  412. switch wireType {
  413. case 0:
  414. for shift := uint(0); ; shift += 7 {
  415. if shift >= 64 {
  416. return 0, ErrIntOverflowBlock
  417. }
  418. if iNdEx >= l {
  419. return 0, io.ErrUnexpectedEOF
  420. }
  421. iNdEx++
  422. if dAtA[iNdEx-1] < 0x80 {
  423. break
  424. }
  425. }
  426. case 1:
  427. iNdEx += 8
  428. case 2:
  429. var length int
  430. for shift := uint(0); ; shift += 7 {
  431. if shift >= 64 {
  432. return 0, ErrIntOverflowBlock
  433. }
  434. if iNdEx >= l {
  435. return 0, io.ErrUnexpectedEOF
  436. }
  437. b := dAtA[iNdEx]
  438. iNdEx++
  439. length |= (int(b) & 0x7F) << shift
  440. if b < 0x80 {
  441. break
  442. }
  443. }
  444. if length < 0 {
  445. return 0, ErrInvalidLengthBlock
  446. }
  447. iNdEx += length
  448. case 3:
  449. depth++
  450. case 4:
  451. if depth == 0 {
  452. return 0, ErrUnexpectedEndOfGroupBlock
  453. }
  454. depth--
  455. case 5:
  456. iNdEx += 4
  457. default:
  458. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  459. }
  460. if iNdEx < 0 {
  461. return 0, ErrInvalidLengthBlock
  462. }
  463. if depth == 0 {
  464. return iNdEx, nil
  465. }
  466. }
  467. return 0, io.ErrUnexpectedEOF
  468. }
  469. var (
  470. ErrInvalidLengthBlock = fmt.Errorf("proto: negative length found during unmarshaling")
  471. ErrIntOverflowBlock = fmt.Errorf("proto: integer overflow")
  472. ErrUnexpectedEndOfGroupBlock = fmt.Errorf("proto: unexpected end of group")
  473. )