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.

5100 lines
120 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: tendermint/types/types.proto
  3. package types
  4. import (
  5. fmt "fmt"
  6. _ "github.com/gogo/protobuf/gogoproto"
  7. proto "github.com/gogo/protobuf/proto"
  8. _ "github.com/gogo/protobuf/types"
  9. github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
  10. crypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
  11. version "github.com/tendermint/tendermint/proto/tendermint/version"
  12. io "io"
  13. math "math"
  14. math_bits "math/bits"
  15. time "time"
  16. )
  17. // Reference imports to suppress errors if they are not otherwise used.
  18. var _ = proto.Marshal
  19. var _ = fmt.Errorf
  20. var _ = math.Inf
  21. var _ = time.Kitchen
  22. // This is a compile-time assertion to ensure that this generated file
  23. // is compatible with the proto package it is being compiled against.
  24. // A compilation error at this line likely means your copy of the
  25. // proto package needs to be updated.
  26. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  27. // BlockIdFlag indicates which BlcokID the signature is for
  28. type BlockIDFlag int32
  29. const (
  30. BlockIDFlagUnknown BlockIDFlag = 0
  31. BlockIDFlagAbsent BlockIDFlag = 1
  32. BlockIDFlagCommit BlockIDFlag = 2
  33. BlockIDFlagNil BlockIDFlag = 3
  34. )
  35. var BlockIDFlag_name = map[int32]string{
  36. 0: "BLOCK_ID_FLAG_UNKNOWN",
  37. 1: "BLOCK_ID_FLAG_ABSENT",
  38. 2: "BLOCK_ID_FLAG_COMMIT",
  39. 3: "BLOCK_ID_FLAG_NIL",
  40. }
  41. var BlockIDFlag_value = map[string]int32{
  42. "BLOCK_ID_FLAG_UNKNOWN": 0,
  43. "BLOCK_ID_FLAG_ABSENT": 1,
  44. "BLOCK_ID_FLAG_COMMIT": 2,
  45. "BLOCK_ID_FLAG_NIL": 3,
  46. }
  47. func (x BlockIDFlag) String() string {
  48. return proto.EnumName(BlockIDFlag_name, int32(x))
  49. }
  50. func (BlockIDFlag) EnumDescriptor() ([]byte, []int) {
  51. return fileDescriptor_d3a6e55e2345de56, []int{0}
  52. }
  53. // SignedMsgType is a type of signed message in the consensus.
  54. type SignedMsgType int32
  55. const (
  56. UnknownType SignedMsgType = 0
  57. // Votes
  58. PrevoteType SignedMsgType = 1
  59. PrecommitType SignedMsgType = 2
  60. // Proposals
  61. ProposalType SignedMsgType = 32
  62. )
  63. var SignedMsgType_name = map[int32]string{
  64. 0: "SIGNED_MSG_TYPE_UNKNOWN",
  65. 1: "SIGNED_MSG_TYPE_PREVOTE",
  66. 2: "SIGNED_MSG_TYPE_PRECOMMIT",
  67. 32: "SIGNED_MSG_TYPE_PROPOSAL",
  68. }
  69. var SignedMsgType_value = map[string]int32{
  70. "SIGNED_MSG_TYPE_UNKNOWN": 0,
  71. "SIGNED_MSG_TYPE_PREVOTE": 1,
  72. "SIGNED_MSG_TYPE_PRECOMMIT": 2,
  73. "SIGNED_MSG_TYPE_PROPOSAL": 32,
  74. }
  75. func (x SignedMsgType) String() string {
  76. return proto.EnumName(SignedMsgType_name, int32(x))
  77. }
  78. func (SignedMsgType) EnumDescriptor() ([]byte, []int) {
  79. return fileDescriptor_d3a6e55e2345de56, []int{1}
  80. }
  81. // PartsetHeader
  82. type PartSetHeader struct {
  83. Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
  84. Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
  85. }
  86. func (m *PartSetHeader) Reset() { *m = PartSetHeader{} }
  87. func (m *PartSetHeader) String() string { return proto.CompactTextString(m) }
  88. func (*PartSetHeader) ProtoMessage() {}
  89. func (*PartSetHeader) Descriptor() ([]byte, []int) {
  90. return fileDescriptor_d3a6e55e2345de56, []int{0}
  91. }
  92. func (m *PartSetHeader) XXX_Unmarshal(b []byte) error {
  93. return m.Unmarshal(b)
  94. }
  95. func (m *PartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  96. if deterministic {
  97. return xxx_messageInfo_PartSetHeader.Marshal(b, m, deterministic)
  98. } else {
  99. b = b[:cap(b)]
  100. n, err := m.MarshalToSizedBuffer(b)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return b[:n], nil
  105. }
  106. }
  107. func (m *PartSetHeader) XXX_Merge(src proto.Message) {
  108. xxx_messageInfo_PartSetHeader.Merge(m, src)
  109. }
  110. func (m *PartSetHeader) XXX_Size() int {
  111. return m.Size()
  112. }
  113. func (m *PartSetHeader) XXX_DiscardUnknown() {
  114. xxx_messageInfo_PartSetHeader.DiscardUnknown(m)
  115. }
  116. var xxx_messageInfo_PartSetHeader proto.InternalMessageInfo
  117. func (m *PartSetHeader) GetTotal() uint32 {
  118. if m != nil {
  119. return m.Total
  120. }
  121. return 0
  122. }
  123. func (m *PartSetHeader) GetHash() []byte {
  124. if m != nil {
  125. return m.Hash
  126. }
  127. return nil
  128. }
  129. type Part struct {
  130. Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
  131. Bytes []byte `protobuf:"bytes,2,opt,name=bytes,proto3" json:"bytes,omitempty"`
  132. Proof crypto.Proof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof"`
  133. }
  134. func (m *Part) Reset() { *m = Part{} }
  135. func (m *Part) String() string { return proto.CompactTextString(m) }
  136. func (*Part) ProtoMessage() {}
  137. func (*Part) Descriptor() ([]byte, []int) {
  138. return fileDescriptor_d3a6e55e2345de56, []int{1}
  139. }
  140. func (m *Part) XXX_Unmarshal(b []byte) error {
  141. return m.Unmarshal(b)
  142. }
  143. func (m *Part) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  144. if deterministic {
  145. return xxx_messageInfo_Part.Marshal(b, m, deterministic)
  146. } else {
  147. b = b[:cap(b)]
  148. n, err := m.MarshalToSizedBuffer(b)
  149. if err != nil {
  150. return nil, err
  151. }
  152. return b[:n], nil
  153. }
  154. }
  155. func (m *Part) XXX_Merge(src proto.Message) {
  156. xxx_messageInfo_Part.Merge(m, src)
  157. }
  158. func (m *Part) XXX_Size() int {
  159. return m.Size()
  160. }
  161. func (m *Part) XXX_DiscardUnknown() {
  162. xxx_messageInfo_Part.DiscardUnknown(m)
  163. }
  164. var xxx_messageInfo_Part proto.InternalMessageInfo
  165. func (m *Part) GetIndex() uint32 {
  166. if m != nil {
  167. return m.Index
  168. }
  169. return 0
  170. }
  171. func (m *Part) GetBytes() []byte {
  172. if m != nil {
  173. return m.Bytes
  174. }
  175. return nil
  176. }
  177. func (m *Part) GetProof() crypto.Proof {
  178. if m != nil {
  179. return m.Proof
  180. }
  181. return crypto.Proof{}
  182. }
  183. // BlockID
  184. type BlockID struct {
  185. Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
  186. PartSetHeader PartSetHeader `protobuf:"bytes,2,opt,name=part_set_header,json=partSetHeader,proto3" json:"part_set_header"`
  187. }
  188. func (m *BlockID) Reset() { *m = BlockID{} }
  189. func (m *BlockID) String() string { return proto.CompactTextString(m) }
  190. func (*BlockID) ProtoMessage() {}
  191. func (*BlockID) Descriptor() ([]byte, []int) {
  192. return fileDescriptor_d3a6e55e2345de56, []int{2}
  193. }
  194. func (m *BlockID) XXX_Unmarshal(b []byte) error {
  195. return m.Unmarshal(b)
  196. }
  197. func (m *BlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  198. if deterministic {
  199. return xxx_messageInfo_BlockID.Marshal(b, m, deterministic)
  200. } else {
  201. b = b[:cap(b)]
  202. n, err := m.MarshalToSizedBuffer(b)
  203. if err != nil {
  204. return nil, err
  205. }
  206. return b[:n], nil
  207. }
  208. }
  209. func (m *BlockID) XXX_Merge(src proto.Message) {
  210. xxx_messageInfo_BlockID.Merge(m, src)
  211. }
  212. func (m *BlockID) XXX_Size() int {
  213. return m.Size()
  214. }
  215. func (m *BlockID) XXX_DiscardUnknown() {
  216. xxx_messageInfo_BlockID.DiscardUnknown(m)
  217. }
  218. var xxx_messageInfo_BlockID proto.InternalMessageInfo
  219. func (m *BlockID) GetHash() []byte {
  220. if m != nil {
  221. return m.Hash
  222. }
  223. return nil
  224. }
  225. func (m *BlockID) GetPartSetHeader() PartSetHeader {
  226. if m != nil {
  227. return m.PartSetHeader
  228. }
  229. return PartSetHeader{}
  230. }
  231. // Header defines the structure of a Tendermint block header.
  232. type Header struct {
  233. // basic block info
  234. Version version.Consensus `protobuf:"bytes,1,opt,name=version,proto3" json:"version"`
  235. ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
  236. Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
  237. Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"`
  238. // prev block info
  239. LastBlockId BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"`
  240. // hashes of block data
  241. LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"`
  242. DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"`
  243. // hashes from the app output from the prev block
  244. ValidatorsHash []byte `protobuf:"bytes,8,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"`
  245. NextValidatorsHash []byte `protobuf:"bytes,9,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"`
  246. ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"`
  247. AppHash []byte `protobuf:"bytes,11,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"`
  248. LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"`
  249. // consensus info
  250. EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"`
  251. ProposerAddress []byte `protobuf:"bytes,14,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"`
  252. }
  253. func (m *Header) Reset() { *m = Header{} }
  254. func (m *Header) String() string { return proto.CompactTextString(m) }
  255. func (*Header) ProtoMessage() {}
  256. func (*Header) Descriptor() ([]byte, []int) {
  257. return fileDescriptor_d3a6e55e2345de56, []int{3}
  258. }
  259. func (m *Header) XXX_Unmarshal(b []byte) error {
  260. return m.Unmarshal(b)
  261. }
  262. func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  263. if deterministic {
  264. return xxx_messageInfo_Header.Marshal(b, m, deterministic)
  265. } else {
  266. b = b[:cap(b)]
  267. n, err := m.MarshalToSizedBuffer(b)
  268. if err != nil {
  269. return nil, err
  270. }
  271. return b[:n], nil
  272. }
  273. }
  274. func (m *Header) XXX_Merge(src proto.Message) {
  275. xxx_messageInfo_Header.Merge(m, src)
  276. }
  277. func (m *Header) XXX_Size() int {
  278. return m.Size()
  279. }
  280. func (m *Header) XXX_DiscardUnknown() {
  281. xxx_messageInfo_Header.DiscardUnknown(m)
  282. }
  283. var xxx_messageInfo_Header proto.InternalMessageInfo
  284. func (m *Header) GetVersion() version.Consensus {
  285. if m != nil {
  286. return m.Version
  287. }
  288. return version.Consensus{}
  289. }
  290. func (m *Header) GetChainID() string {
  291. if m != nil {
  292. return m.ChainID
  293. }
  294. return ""
  295. }
  296. func (m *Header) GetHeight() int64 {
  297. if m != nil {
  298. return m.Height
  299. }
  300. return 0
  301. }
  302. func (m *Header) GetTime() time.Time {
  303. if m != nil {
  304. return m.Time
  305. }
  306. return time.Time{}
  307. }
  308. func (m *Header) GetLastBlockId() BlockID {
  309. if m != nil {
  310. return m.LastBlockId
  311. }
  312. return BlockID{}
  313. }
  314. func (m *Header) GetLastCommitHash() []byte {
  315. if m != nil {
  316. return m.LastCommitHash
  317. }
  318. return nil
  319. }
  320. func (m *Header) GetDataHash() []byte {
  321. if m != nil {
  322. return m.DataHash
  323. }
  324. return nil
  325. }
  326. func (m *Header) GetValidatorsHash() []byte {
  327. if m != nil {
  328. return m.ValidatorsHash
  329. }
  330. return nil
  331. }
  332. func (m *Header) GetNextValidatorsHash() []byte {
  333. if m != nil {
  334. return m.NextValidatorsHash
  335. }
  336. return nil
  337. }
  338. func (m *Header) GetConsensusHash() []byte {
  339. if m != nil {
  340. return m.ConsensusHash
  341. }
  342. return nil
  343. }
  344. func (m *Header) GetAppHash() []byte {
  345. if m != nil {
  346. return m.AppHash
  347. }
  348. return nil
  349. }
  350. func (m *Header) GetLastResultsHash() []byte {
  351. if m != nil {
  352. return m.LastResultsHash
  353. }
  354. return nil
  355. }
  356. func (m *Header) GetEvidenceHash() []byte {
  357. if m != nil {
  358. return m.EvidenceHash
  359. }
  360. return nil
  361. }
  362. func (m *Header) GetProposerAddress() []byte {
  363. if m != nil {
  364. return m.ProposerAddress
  365. }
  366. return nil
  367. }
  368. // Data contains the set of transactions included in the block
  369. type Data struct {
  370. // Txs that will be applied by state @ block.Height+1.
  371. // NOTE: not all txs here are valid. We're just agreeing on the order first.
  372. // This means that block.AppHash does not include these txs.
  373. Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"`
  374. }
  375. func (m *Data) Reset() { *m = Data{} }
  376. func (m *Data) String() string { return proto.CompactTextString(m) }
  377. func (*Data) ProtoMessage() {}
  378. func (*Data) Descriptor() ([]byte, []int) {
  379. return fileDescriptor_d3a6e55e2345de56, []int{4}
  380. }
  381. func (m *Data) XXX_Unmarshal(b []byte) error {
  382. return m.Unmarshal(b)
  383. }
  384. func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  385. if deterministic {
  386. return xxx_messageInfo_Data.Marshal(b, m, deterministic)
  387. } else {
  388. b = b[:cap(b)]
  389. n, err := m.MarshalToSizedBuffer(b)
  390. if err != nil {
  391. return nil, err
  392. }
  393. return b[:n], nil
  394. }
  395. }
  396. func (m *Data) XXX_Merge(src proto.Message) {
  397. xxx_messageInfo_Data.Merge(m, src)
  398. }
  399. func (m *Data) XXX_Size() int {
  400. return m.Size()
  401. }
  402. func (m *Data) XXX_DiscardUnknown() {
  403. xxx_messageInfo_Data.DiscardUnknown(m)
  404. }
  405. var xxx_messageInfo_Data proto.InternalMessageInfo
  406. func (m *Data) GetTxs() [][]byte {
  407. if m != nil {
  408. return m.Txs
  409. }
  410. return nil
  411. }
  412. // Vote represents a prevote, precommit, or commit vote from validators for
  413. // consensus.
  414. type Vote struct {
  415. Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"`
  416. Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
  417. Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"`
  418. BlockID BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"`
  419. Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
  420. ValidatorAddress []byte `protobuf:"bytes,6,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
  421. ValidatorIndex int32 `protobuf:"varint,7,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"`
  422. Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"`
  423. VoteExtension *VoteExtension `protobuf:"bytes,9,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,omitempty"`
  424. }
  425. func (m *Vote) Reset() { *m = Vote{} }
  426. func (m *Vote) String() string { return proto.CompactTextString(m) }
  427. func (*Vote) ProtoMessage() {}
  428. func (*Vote) Descriptor() ([]byte, []int) {
  429. return fileDescriptor_d3a6e55e2345de56, []int{5}
  430. }
  431. func (m *Vote) XXX_Unmarshal(b []byte) error {
  432. return m.Unmarshal(b)
  433. }
  434. func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  435. if deterministic {
  436. return xxx_messageInfo_Vote.Marshal(b, m, deterministic)
  437. } else {
  438. b = b[:cap(b)]
  439. n, err := m.MarshalToSizedBuffer(b)
  440. if err != nil {
  441. return nil, err
  442. }
  443. return b[:n], nil
  444. }
  445. }
  446. func (m *Vote) XXX_Merge(src proto.Message) {
  447. xxx_messageInfo_Vote.Merge(m, src)
  448. }
  449. func (m *Vote) XXX_Size() int {
  450. return m.Size()
  451. }
  452. func (m *Vote) XXX_DiscardUnknown() {
  453. xxx_messageInfo_Vote.DiscardUnknown(m)
  454. }
  455. var xxx_messageInfo_Vote proto.InternalMessageInfo
  456. func (m *Vote) GetType() SignedMsgType {
  457. if m != nil {
  458. return m.Type
  459. }
  460. return UnknownType
  461. }
  462. func (m *Vote) GetHeight() int64 {
  463. if m != nil {
  464. return m.Height
  465. }
  466. return 0
  467. }
  468. func (m *Vote) GetRound() int32 {
  469. if m != nil {
  470. return m.Round
  471. }
  472. return 0
  473. }
  474. func (m *Vote) GetBlockID() BlockID {
  475. if m != nil {
  476. return m.BlockID
  477. }
  478. return BlockID{}
  479. }
  480. func (m *Vote) GetTimestamp() time.Time {
  481. if m != nil {
  482. return m.Timestamp
  483. }
  484. return time.Time{}
  485. }
  486. func (m *Vote) GetValidatorAddress() []byte {
  487. if m != nil {
  488. return m.ValidatorAddress
  489. }
  490. return nil
  491. }
  492. func (m *Vote) GetValidatorIndex() int32 {
  493. if m != nil {
  494. return m.ValidatorIndex
  495. }
  496. return 0
  497. }
  498. func (m *Vote) GetSignature() []byte {
  499. if m != nil {
  500. return m.Signature
  501. }
  502. return nil
  503. }
  504. func (m *Vote) GetVoteExtension() *VoteExtension {
  505. if m != nil {
  506. return m.VoteExtension
  507. }
  508. return nil
  509. }
  510. // VoteExtension is app-defined additional information to the validator votes.
  511. type VoteExtension struct {
  512. AppDataToSign []byte `protobuf:"bytes,1,opt,name=app_data_to_sign,json=appDataToSign,proto3" json:"app_data_to_sign,omitempty"`
  513. AppDataSelfAuthenticating []byte `protobuf:"bytes,2,opt,name=app_data_self_authenticating,json=appDataSelfAuthenticating,proto3" json:"app_data_self_authenticating,omitempty"`
  514. }
  515. func (m *VoteExtension) Reset() { *m = VoteExtension{} }
  516. func (m *VoteExtension) String() string { return proto.CompactTextString(m) }
  517. func (*VoteExtension) ProtoMessage() {}
  518. func (*VoteExtension) Descriptor() ([]byte, []int) {
  519. return fileDescriptor_d3a6e55e2345de56, []int{6}
  520. }
  521. func (m *VoteExtension) XXX_Unmarshal(b []byte) error {
  522. return m.Unmarshal(b)
  523. }
  524. func (m *VoteExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  525. if deterministic {
  526. return xxx_messageInfo_VoteExtension.Marshal(b, m, deterministic)
  527. } else {
  528. b = b[:cap(b)]
  529. n, err := m.MarshalToSizedBuffer(b)
  530. if err != nil {
  531. return nil, err
  532. }
  533. return b[:n], nil
  534. }
  535. }
  536. func (m *VoteExtension) XXX_Merge(src proto.Message) {
  537. xxx_messageInfo_VoteExtension.Merge(m, src)
  538. }
  539. func (m *VoteExtension) XXX_Size() int {
  540. return m.Size()
  541. }
  542. func (m *VoteExtension) XXX_DiscardUnknown() {
  543. xxx_messageInfo_VoteExtension.DiscardUnknown(m)
  544. }
  545. var xxx_messageInfo_VoteExtension proto.InternalMessageInfo
  546. func (m *VoteExtension) GetAppDataToSign() []byte {
  547. if m != nil {
  548. return m.AppDataToSign
  549. }
  550. return nil
  551. }
  552. func (m *VoteExtension) GetAppDataSelfAuthenticating() []byte {
  553. if m != nil {
  554. return m.AppDataSelfAuthenticating
  555. }
  556. return nil
  557. }
  558. // VoteExtensionToSign is a subset of VoteExtension that is signed by the validators private key.
  559. // VoteExtensionToSign is extracted from an existing VoteExtension.
  560. type VoteExtensionToSign struct {
  561. AppDataToSign []byte `protobuf:"bytes,1,opt,name=app_data_to_sign,json=appDataToSign,proto3" json:"app_data_to_sign,omitempty"`
  562. }
  563. func (m *VoteExtensionToSign) Reset() { *m = VoteExtensionToSign{} }
  564. func (m *VoteExtensionToSign) String() string { return proto.CompactTextString(m) }
  565. func (*VoteExtensionToSign) ProtoMessage() {}
  566. func (*VoteExtensionToSign) Descriptor() ([]byte, []int) {
  567. return fileDescriptor_d3a6e55e2345de56, []int{7}
  568. }
  569. func (m *VoteExtensionToSign) XXX_Unmarshal(b []byte) error {
  570. return m.Unmarshal(b)
  571. }
  572. func (m *VoteExtensionToSign) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  573. if deterministic {
  574. return xxx_messageInfo_VoteExtensionToSign.Marshal(b, m, deterministic)
  575. } else {
  576. b = b[:cap(b)]
  577. n, err := m.MarshalToSizedBuffer(b)
  578. if err != nil {
  579. return nil, err
  580. }
  581. return b[:n], nil
  582. }
  583. }
  584. func (m *VoteExtensionToSign) XXX_Merge(src proto.Message) {
  585. xxx_messageInfo_VoteExtensionToSign.Merge(m, src)
  586. }
  587. func (m *VoteExtensionToSign) XXX_Size() int {
  588. return m.Size()
  589. }
  590. func (m *VoteExtensionToSign) XXX_DiscardUnknown() {
  591. xxx_messageInfo_VoteExtensionToSign.DiscardUnknown(m)
  592. }
  593. var xxx_messageInfo_VoteExtensionToSign proto.InternalMessageInfo
  594. func (m *VoteExtensionToSign) GetAppDataToSign() []byte {
  595. if m != nil {
  596. return m.AppDataToSign
  597. }
  598. return nil
  599. }
  600. // Commit contains the evidence that a block was committed by a set of
  601. // validators.
  602. type Commit struct {
  603. Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
  604. Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
  605. BlockID BlockID `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id"`
  606. Signatures []CommitSig `protobuf:"bytes,4,rep,name=signatures,proto3" json:"signatures"`
  607. }
  608. func (m *Commit) Reset() { *m = Commit{} }
  609. func (m *Commit) String() string { return proto.CompactTextString(m) }
  610. func (*Commit) ProtoMessage() {}
  611. func (*Commit) Descriptor() ([]byte, []int) {
  612. return fileDescriptor_d3a6e55e2345de56, []int{8}
  613. }
  614. func (m *Commit) XXX_Unmarshal(b []byte) error {
  615. return m.Unmarshal(b)
  616. }
  617. func (m *Commit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  618. if deterministic {
  619. return xxx_messageInfo_Commit.Marshal(b, m, deterministic)
  620. } else {
  621. b = b[:cap(b)]
  622. n, err := m.MarshalToSizedBuffer(b)
  623. if err != nil {
  624. return nil, err
  625. }
  626. return b[:n], nil
  627. }
  628. }
  629. func (m *Commit) XXX_Merge(src proto.Message) {
  630. xxx_messageInfo_Commit.Merge(m, src)
  631. }
  632. func (m *Commit) XXX_Size() int {
  633. return m.Size()
  634. }
  635. func (m *Commit) XXX_DiscardUnknown() {
  636. xxx_messageInfo_Commit.DiscardUnknown(m)
  637. }
  638. var xxx_messageInfo_Commit proto.InternalMessageInfo
  639. func (m *Commit) GetHeight() int64 {
  640. if m != nil {
  641. return m.Height
  642. }
  643. return 0
  644. }
  645. func (m *Commit) GetRound() int32 {
  646. if m != nil {
  647. return m.Round
  648. }
  649. return 0
  650. }
  651. func (m *Commit) GetBlockID() BlockID {
  652. if m != nil {
  653. return m.BlockID
  654. }
  655. return BlockID{}
  656. }
  657. func (m *Commit) GetSignatures() []CommitSig {
  658. if m != nil {
  659. return m.Signatures
  660. }
  661. return nil
  662. }
  663. // CommitSig is a part of the Vote included in a Commit.
  664. type CommitSig struct {
  665. BlockIdFlag BlockIDFlag `protobuf:"varint,1,opt,name=block_id_flag,json=blockIdFlag,proto3,enum=tendermint.types.BlockIDFlag" json:"block_id_flag,omitempty"`
  666. ValidatorAddress []byte `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
  667. Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
  668. Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
  669. VoteExtension *VoteExtensionToSign `protobuf:"bytes,5,opt,name=vote_extension,json=voteExtension,proto3" json:"vote_extension,omitempty"`
  670. }
  671. func (m *CommitSig) Reset() { *m = CommitSig{} }
  672. func (m *CommitSig) String() string { return proto.CompactTextString(m) }
  673. func (*CommitSig) ProtoMessage() {}
  674. func (*CommitSig) Descriptor() ([]byte, []int) {
  675. return fileDescriptor_d3a6e55e2345de56, []int{9}
  676. }
  677. func (m *CommitSig) XXX_Unmarshal(b []byte) error {
  678. return m.Unmarshal(b)
  679. }
  680. func (m *CommitSig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  681. if deterministic {
  682. return xxx_messageInfo_CommitSig.Marshal(b, m, deterministic)
  683. } else {
  684. b = b[:cap(b)]
  685. n, err := m.MarshalToSizedBuffer(b)
  686. if err != nil {
  687. return nil, err
  688. }
  689. return b[:n], nil
  690. }
  691. }
  692. func (m *CommitSig) XXX_Merge(src proto.Message) {
  693. xxx_messageInfo_CommitSig.Merge(m, src)
  694. }
  695. func (m *CommitSig) XXX_Size() int {
  696. return m.Size()
  697. }
  698. func (m *CommitSig) XXX_DiscardUnknown() {
  699. xxx_messageInfo_CommitSig.DiscardUnknown(m)
  700. }
  701. var xxx_messageInfo_CommitSig proto.InternalMessageInfo
  702. func (m *CommitSig) GetBlockIdFlag() BlockIDFlag {
  703. if m != nil {
  704. return m.BlockIdFlag
  705. }
  706. return BlockIDFlagUnknown
  707. }
  708. func (m *CommitSig) GetValidatorAddress() []byte {
  709. if m != nil {
  710. return m.ValidatorAddress
  711. }
  712. return nil
  713. }
  714. func (m *CommitSig) GetTimestamp() time.Time {
  715. if m != nil {
  716. return m.Timestamp
  717. }
  718. return time.Time{}
  719. }
  720. func (m *CommitSig) GetSignature() []byte {
  721. if m != nil {
  722. return m.Signature
  723. }
  724. return nil
  725. }
  726. func (m *CommitSig) GetVoteExtension() *VoteExtensionToSign {
  727. if m != nil {
  728. return m.VoteExtension
  729. }
  730. return nil
  731. }
  732. type Proposal struct {
  733. Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"`
  734. Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
  735. Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"`
  736. PolRound int32 `protobuf:"varint,4,opt,name=pol_round,json=polRound,proto3" json:"pol_round,omitempty"`
  737. BlockID BlockID `protobuf:"bytes,5,opt,name=block_id,json=blockId,proto3" json:"block_id"`
  738. Timestamp time.Time `protobuf:"bytes,6,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
  739. Signature []byte `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"`
  740. }
  741. func (m *Proposal) Reset() { *m = Proposal{} }
  742. func (m *Proposal) String() string { return proto.CompactTextString(m) }
  743. func (*Proposal) ProtoMessage() {}
  744. func (*Proposal) Descriptor() ([]byte, []int) {
  745. return fileDescriptor_d3a6e55e2345de56, []int{10}
  746. }
  747. func (m *Proposal) XXX_Unmarshal(b []byte) error {
  748. return m.Unmarshal(b)
  749. }
  750. func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  751. if deterministic {
  752. return xxx_messageInfo_Proposal.Marshal(b, m, deterministic)
  753. } else {
  754. b = b[:cap(b)]
  755. n, err := m.MarshalToSizedBuffer(b)
  756. if err != nil {
  757. return nil, err
  758. }
  759. return b[:n], nil
  760. }
  761. }
  762. func (m *Proposal) XXX_Merge(src proto.Message) {
  763. xxx_messageInfo_Proposal.Merge(m, src)
  764. }
  765. func (m *Proposal) XXX_Size() int {
  766. return m.Size()
  767. }
  768. func (m *Proposal) XXX_DiscardUnknown() {
  769. xxx_messageInfo_Proposal.DiscardUnknown(m)
  770. }
  771. var xxx_messageInfo_Proposal proto.InternalMessageInfo
  772. func (m *Proposal) GetType() SignedMsgType {
  773. if m != nil {
  774. return m.Type
  775. }
  776. return UnknownType
  777. }
  778. func (m *Proposal) GetHeight() int64 {
  779. if m != nil {
  780. return m.Height
  781. }
  782. return 0
  783. }
  784. func (m *Proposal) GetRound() int32 {
  785. if m != nil {
  786. return m.Round
  787. }
  788. return 0
  789. }
  790. func (m *Proposal) GetPolRound() int32 {
  791. if m != nil {
  792. return m.PolRound
  793. }
  794. return 0
  795. }
  796. func (m *Proposal) GetBlockID() BlockID {
  797. if m != nil {
  798. return m.BlockID
  799. }
  800. return BlockID{}
  801. }
  802. func (m *Proposal) GetTimestamp() time.Time {
  803. if m != nil {
  804. return m.Timestamp
  805. }
  806. return time.Time{}
  807. }
  808. func (m *Proposal) GetSignature() []byte {
  809. if m != nil {
  810. return m.Signature
  811. }
  812. return nil
  813. }
  814. type SignedHeader struct {
  815. Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
  816. Commit *Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"`
  817. }
  818. func (m *SignedHeader) Reset() { *m = SignedHeader{} }
  819. func (m *SignedHeader) String() string { return proto.CompactTextString(m) }
  820. func (*SignedHeader) ProtoMessage() {}
  821. func (*SignedHeader) Descriptor() ([]byte, []int) {
  822. return fileDescriptor_d3a6e55e2345de56, []int{11}
  823. }
  824. func (m *SignedHeader) XXX_Unmarshal(b []byte) error {
  825. return m.Unmarshal(b)
  826. }
  827. func (m *SignedHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  828. if deterministic {
  829. return xxx_messageInfo_SignedHeader.Marshal(b, m, deterministic)
  830. } else {
  831. b = b[:cap(b)]
  832. n, err := m.MarshalToSizedBuffer(b)
  833. if err != nil {
  834. return nil, err
  835. }
  836. return b[:n], nil
  837. }
  838. }
  839. func (m *SignedHeader) XXX_Merge(src proto.Message) {
  840. xxx_messageInfo_SignedHeader.Merge(m, src)
  841. }
  842. func (m *SignedHeader) XXX_Size() int {
  843. return m.Size()
  844. }
  845. func (m *SignedHeader) XXX_DiscardUnknown() {
  846. xxx_messageInfo_SignedHeader.DiscardUnknown(m)
  847. }
  848. var xxx_messageInfo_SignedHeader proto.InternalMessageInfo
  849. func (m *SignedHeader) GetHeader() *Header {
  850. if m != nil {
  851. return m.Header
  852. }
  853. return nil
  854. }
  855. func (m *SignedHeader) GetCommit() *Commit {
  856. if m != nil {
  857. return m.Commit
  858. }
  859. return nil
  860. }
  861. type LightBlock struct {
  862. SignedHeader *SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3" json:"signed_header,omitempty"`
  863. ValidatorSet *ValidatorSet `protobuf:"bytes,2,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"`
  864. }
  865. func (m *LightBlock) Reset() { *m = LightBlock{} }
  866. func (m *LightBlock) String() string { return proto.CompactTextString(m) }
  867. func (*LightBlock) ProtoMessage() {}
  868. func (*LightBlock) Descriptor() ([]byte, []int) {
  869. return fileDescriptor_d3a6e55e2345de56, []int{12}
  870. }
  871. func (m *LightBlock) XXX_Unmarshal(b []byte) error {
  872. return m.Unmarshal(b)
  873. }
  874. func (m *LightBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  875. if deterministic {
  876. return xxx_messageInfo_LightBlock.Marshal(b, m, deterministic)
  877. } else {
  878. b = b[:cap(b)]
  879. n, err := m.MarshalToSizedBuffer(b)
  880. if err != nil {
  881. return nil, err
  882. }
  883. return b[:n], nil
  884. }
  885. }
  886. func (m *LightBlock) XXX_Merge(src proto.Message) {
  887. xxx_messageInfo_LightBlock.Merge(m, src)
  888. }
  889. func (m *LightBlock) XXX_Size() int {
  890. return m.Size()
  891. }
  892. func (m *LightBlock) XXX_DiscardUnknown() {
  893. xxx_messageInfo_LightBlock.DiscardUnknown(m)
  894. }
  895. var xxx_messageInfo_LightBlock proto.InternalMessageInfo
  896. func (m *LightBlock) GetSignedHeader() *SignedHeader {
  897. if m != nil {
  898. return m.SignedHeader
  899. }
  900. return nil
  901. }
  902. func (m *LightBlock) GetValidatorSet() *ValidatorSet {
  903. if m != nil {
  904. return m.ValidatorSet
  905. }
  906. return nil
  907. }
  908. type BlockMeta struct {
  909. BlockID BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id"`
  910. BlockSize int64 `protobuf:"varint,2,opt,name=block_size,json=blockSize,proto3" json:"block_size,omitempty"`
  911. Header Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header"`
  912. NumTxs int64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"`
  913. }
  914. func (m *BlockMeta) Reset() { *m = BlockMeta{} }
  915. func (m *BlockMeta) String() string { return proto.CompactTextString(m) }
  916. func (*BlockMeta) ProtoMessage() {}
  917. func (*BlockMeta) Descriptor() ([]byte, []int) {
  918. return fileDescriptor_d3a6e55e2345de56, []int{13}
  919. }
  920. func (m *BlockMeta) XXX_Unmarshal(b []byte) error {
  921. return m.Unmarshal(b)
  922. }
  923. func (m *BlockMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  924. if deterministic {
  925. return xxx_messageInfo_BlockMeta.Marshal(b, m, deterministic)
  926. } else {
  927. b = b[:cap(b)]
  928. n, err := m.MarshalToSizedBuffer(b)
  929. if err != nil {
  930. return nil, err
  931. }
  932. return b[:n], nil
  933. }
  934. }
  935. func (m *BlockMeta) XXX_Merge(src proto.Message) {
  936. xxx_messageInfo_BlockMeta.Merge(m, src)
  937. }
  938. func (m *BlockMeta) XXX_Size() int {
  939. return m.Size()
  940. }
  941. func (m *BlockMeta) XXX_DiscardUnknown() {
  942. xxx_messageInfo_BlockMeta.DiscardUnknown(m)
  943. }
  944. var xxx_messageInfo_BlockMeta proto.InternalMessageInfo
  945. func (m *BlockMeta) GetBlockID() BlockID {
  946. if m != nil {
  947. return m.BlockID
  948. }
  949. return BlockID{}
  950. }
  951. func (m *BlockMeta) GetBlockSize() int64 {
  952. if m != nil {
  953. return m.BlockSize
  954. }
  955. return 0
  956. }
  957. func (m *BlockMeta) GetHeader() Header {
  958. if m != nil {
  959. return m.Header
  960. }
  961. return Header{}
  962. }
  963. func (m *BlockMeta) GetNumTxs() int64 {
  964. if m != nil {
  965. return m.NumTxs
  966. }
  967. return 0
  968. }
  969. // TxProof represents a Merkle proof of the presence of a transaction in the
  970. // Merkle tree.
  971. type TxProof struct {
  972. RootHash []byte `protobuf:"bytes,1,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"`
  973. Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
  974. Proof *crypto.Proof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"`
  975. }
  976. func (m *TxProof) Reset() { *m = TxProof{} }
  977. func (m *TxProof) String() string { return proto.CompactTextString(m) }
  978. func (*TxProof) ProtoMessage() {}
  979. func (*TxProof) Descriptor() ([]byte, []int) {
  980. return fileDescriptor_d3a6e55e2345de56, []int{14}
  981. }
  982. func (m *TxProof) XXX_Unmarshal(b []byte) error {
  983. return m.Unmarshal(b)
  984. }
  985. func (m *TxProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  986. if deterministic {
  987. return xxx_messageInfo_TxProof.Marshal(b, m, deterministic)
  988. } else {
  989. b = b[:cap(b)]
  990. n, err := m.MarshalToSizedBuffer(b)
  991. if err != nil {
  992. return nil, err
  993. }
  994. return b[:n], nil
  995. }
  996. }
  997. func (m *TxProof) XXX_Merge(src proto.Message) {
  998. xxx_messageInfo_TxProof.Merge(m, src)
  999. }
  1000. func (m *TxProof) XXX_Size() int {
  1001. return m.Size()
  1002. }
  1003. func (m *TxProof) XXX_DiscardUnknown() {
  1004. xxx_messageInfo_TxProof.DiscardUnknown(m)
  1005. }
  1006. var xxx_messageInfo_TxProof proto.InternalMessageInfo
  1007. func (m *TxProof) GetRootHash() []byte {
  1008. if m != nil {
  1009. return m.RootHash
  1010. }
  1011. return nil
  1012. }
  1013. func (m *TxProof) GetData() []byte {
  1014. if m != nil {
  1015. return m.Data
  1016. }
  1017. return nil
  1018. }
  1019. func (m *TxProof) GetProof() *crypto.Proof {
  1020. if m != nil {
  1021. return m.Proof
  1022. }
  1023. return nil
  1024. }
  1025. func init() {
  1026. proto.RegisterEnum("tendermint.types.BlockIDFlag", BlockIDFlag_name, BlockIDFlag_value)
  1027. proto.RegisterEnum("tendermint.types.SignedMsgType", SignedMsgType_name, SignedMsgType_value)
  1028. proto.RegisterType((*PartSetHeader)(nil), "tendermint.types.PartSetHeader")
  1029. proto.RegisterType((*Part)(nil), "tendermint.types.Part")
  1030. proto.RegisterType((*BlockID)(nil), "tendermint.types.BlockID")
  1031. proto.RegisterType((*Header)(nil), "tendermint.types.Header")
  1032. proto.RegisterType((*Data)(nil), "tendermint.types.Data")
  1033. proto.RegisterType((*Vote)(nil), "tendermint.types.Vote")
  1034. proto.RegisterType((*VoteExtension)(nil), "tendermint.types.VoteExtension")
  1035. proto.RegisterType((*VoteExtensionToSign)(nil), "tendermint.types.VoteExtensionToSign")
  1036. proto.RegisterType((*Commit)(nil), "tendermint.types.Commit")
  1037. proto.RegisterType((*CommitSig)(nil), "tendermint.types.CommitSig")
  1038. proto.RegisterType((*Proposal)(nil), "tendermint.types.Proposal")
  1039. proto.RegisterType((*SignedHeader)(nil), "tendermint.types.SignedHeader")
  1040. proto.RegisterType((*LightBlock)(nil), "tendermint.types.LightBlock")
  1041. proto.RegisterType((*BlockMeta)(nil), "tendermint.types.BlockMeta")
  1042. proto.RegisterType((*TxProof)(nil), "tendermint.types.TxProof")
  1043. }
  1044. func init() { proto.RegisterFile("tendermint/types/types.proto", fileDescriptor_d3a6e55e2345de56) }
  1045. var fileDescriptor_d3a6e55e2345de56 = []byte{
  1046. // 1423 bytes of a gzipped FileDescriptorProto
  1047. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0xdb, 0x64,
  1048. 0x18, 0xaf, 0x13, 0xb7, 0x49, 0x9e, 0xc4, 0x6d, 0xfa, 0xd2, 0x6d, 0x69, 0xb6, 0xa6, 0x91, 0xd1,
  1049. 0x58, 0x37, 0x50, 0x3a, 0x3a, 0xc4, 0x9f, 0x03, 0xa0, 0x24, 0xcd, 0xb6, 0x68, 0x6d, 0x1a, 0x9c,
  1050. 0x6c, 0x08, 0x2e, 0x96, 0x93, 0xbc, 0x4d, 0xcc, 0x1c, 0xdb, 0xb2, 0xdf, 0x94, 0x76, 0x9f, 0x00,
  1051. 0xf5, 0xb4, 0x13, 0xb7, 0x9e, 0xe0, 0x80, 0xc4, 0x05, 0x89, 0x2f, 0x80, 0x38, 0xed, 0xb8, 0x1b,
  1052. 0x9c, 0x06, 0xea, 0x24, 0x3e, 0x07, 0x7a, 0xff, 0xc4, 0xb1, 0x9b, 0x86, 0x4d, 0xd5, 0xc4, 0x25,
  1053. 0xf2, 0xfb, 0x3c, 0xbf, 0xe7, 0xff, 0xcf, 0x8f, 0xdf, 0xc0, 0x35, 0x82, 0xed, 0x1e, 0xf6, 0x86,
  1054. 0xa6, 0x4d, 0x36, 0xc9, 0x91, 0x8b, 0x7d, 0xfe, 0x5b, 0x72, 0x3d, 0x87, 0x38, 0x28, 0x3b, 0xd1,
  1055. 0x96, 0x98, 0x3c, 0xbf, 0xd2, 0x77, 0xfa, 0x0e, 0x53, 0x6e, 0xd2, 0x27, 0x8e, 0xcb, 0xaf, 0xf7,
  1056. 0x1d, 0xa7, 0x6f, 0xe1, 0x4d, 0x76, 0xea, 0x8c, 0xf6, 0x37, 0x89, 0x39, 0xc4, 0x3e, 0x31, 0x86,
  1057. 0xae, 0x00, 0xac, 0x85, 0xc2, 0x74, 0xbd, 0x23, 0x97, 0x38, 0x14, 0xeb, 0xec, 0x0b, 0x75, 0x21,
  1058. 0xa4, 0x3e, 0xc0, 0x9e, 0x6f, 0x3a, 0x76, 0x38, 0x8f, 0x7c, 0x71, 0x2a, 0xcb, 0x03, 0xc3, 0x32,
  1059. 0x7b, 0x06, 0x71, 0x3c, 0x8e, 0x50, 0x3f, 0x01, 0xa5, 0x69, 0x78, 0xa4, 0x85, 0xc9, 0x7d, 0x6c,
  1060. 0xf4, 0xb0, 0x87, 0x56, 0x60, 0x9e, 0x38, 0xc4, 0xb0, 0x72, 0x52, 0x51, 0xda, 0x50, 0x34, 0x7e,
  1061. 0x40, 0x08, 0xe4, 0x81, 0xe1, 0x0f, 0x72, 0xb1, 0xa2, 0xb4, 0x91, 0xd1, 0xd8, 0xb3, 0x3a, 0x00,
  1062. 0x99, 0x9a, 0x52, 0x0b, 0xd3, 0xee, 0xe1, 0xc3, 0xb1, 0x05, 0x3b, 0x50, 0x69, 0xe7, 0x88, 0x60,
  1063. 0x5f, 0x98, 0xf0, 0x03, 0xfa, 0x00, 0xe6, 0x59, 0xfe, 0xb9, 0x78, 0x51, 0xda, 0x48, 0x6f, 0xe5,
  1064. 0x4a, 0xa1, 0x46, 0xf1, 0xfa, 0x4a, 0x4d, 0xaa, 0xaf, 0xc8, 0xcf, 0x5e, 0xac, 0xcf, 0x69, 0x1c,
  1065. 0xac, 0x5a, 0x90, 0xa8, 0x58, 0x4e, 0xf7, 0x71, 0x7d, 0x3b, 0x48, 0x44, 0x9a, 0x24, 0x82, 0x76,
  1066. 0x61, 0xc9, 0x35, 0x3c, 0xa2, 0xfb, 0x98, 0xe8, 0x03, 0x56, 0x05, 0x0b, 0x9a, 0xde, 0x5a, 0x2f,
  1067. 0x9d, 0x9d, 0x43, 0x29, 0x52, 0xac, 0x88, 0xa2, 0xb8, 0x61, 0xa1, 0xfa, 0x8f, 0x0c, 0x0b, 0xa2,
  1068. 0x19, 0x9f, 0x42, 0x42, 0xb4, 0x95, 0x05, 0x4c, 0x6f, 0xad, 0x85, 0x3d, 0x0a, 0x55, 0xa9, 0xea,
  1069. 0xd8, 0x3e, 0xb6, 0xfd, 0x91, 0x2f, 0xfc, 0x8d, 0x6d, 0xd0, 0x3b, 0x90, 0xec, 0x0e, 0x0c, 0xd3,
  1070. 0xd6, 0xcd, 0x1e, 0xcb, 0x28, 0x55, 0x49, 0x9f, 0xbe, 0x58, 0x4f, 0x54, 0xa9, 0xac, 0xbe, 0xad,
  1071. 0x25, 0x98, 0xb2, 0xde, 0x43, 0x97, 0x61, 0x61, 0x80, 0xcd, 0xfe, 0x80, 0xb0, 0xb6, 0xc4, 0x35,
  1072. 0x71, 0x42, 0x1f, 0x83, 0x4c, 0x09, 0x91, 0x93, 0x59, 0xec, 0x7c, 0x89, 0xb3, 0xa5, 0x34, 0x66,
  1073. 0x4b, 0xa9, 0x3d, 0x66, 0x4b, 0x25, 0x49, 0x03, 0x3f, 0xfd, 0x6b, 0x5d, 0xd2, 0x98, 0x05, 0xaa,
  1074. 0x82, 0x62, 0x19, 0x3e, 0xd1, 0x3b, 0xb4, 0x6d, 0x34, 0xfc, 0x3c, 0x73, 0xb1, 0x3a, 0xdd, 0x10,
  1075. 0xd1, 0x58, 0x91, 0x7a, 0x9a, 0x5a, 0x71, 0x51, 0x0f, 0x6d, 0x40, 0x96, 0x39, 0xe9, 0x3a, 0xc3,
  1076. 0xa1, 0x49, 0x74, 0xd6, 0xf7, 0x05, 0xd6, 0xf7, 0x45, 0x2a, 0xaf, 0x32, 0xf1, 0x7d, 0x3a, 0x81,
  1077. 0xab, 0x90, 0xea, 0x19, 0xc4, 0xe0, 0x90, 0x04, 0x83, 0x24, 0xa9, 0x80, 0x29, 0x6f, 0xc0, 0x52,
  1078. 0xc0, 0x3a, 0x9f, 0x43, 0x92, 0xdc, 0xcb, 0x44, 0xcc, 0x80, 0xb7, 0x61, 0xc5, 0xc6, 0x87, 0x44,
  1079. 0x3f, 0x8b, 0x4e, 0x31, 0x34, 0xa2, 0xba, 0x47, 0x51, 0x8b, 0xeb, 0xb0, 0xd8, 0x1d, 0x37, 0x9f,
  1080. 0x63, 0x81, 0x61, 0x95, 0x40, 0xca, 0x60, 0xab, 0x90, 0x34, 0x5c, 0x97, 0x03, 0xd2, 0x0c, 0x90,
  1081. 0x30, 0x5c, 0x97, 0xa9, 0x6e, 0xc1, 0x32, 0xab, 0xd1, 0xc3, 0xfe, 0xc8, 0x22, 0xc2, 0x49, 0x86,
  1082. 0x61, 0x96, 0xa8, 0x42, 0xe3, 0x72, 0x86, 0x7d, 0x1b, 0x14, 0x7c, 0x60, 0xf6, 0xb0, 0xdd, 0xc5,
  1083. 0x1c, 0xa7, 0x30, 0x5c, 0x66, 0x2c, 0x64, 0xa0, 0x9b, 0x90, 0x75, 0x3d, 0xc7, 0x75, 0x7c, 0xec,
  1084. 0xe9, 0x46, 0xaf, 0xe7, 0x61, 0xdf, 0xcf, 0x2d, 0x72, 0x7f, 0x63, 0x79, 0x99, 0x8b, 0xd5, 0x1c,
  1085. 0xc8, 0xdb, 0x06, 0x31, 0x50, 0x16, 0xe2, 0xe4, 0xd0, 0xcf, 0x49, 0xc5, 0xf8, 0x46, 0x46, 0xa3,
  1086. 0x8f, 0xea, 0x2f, 0x71, 0x90, 0x1f, 0x39, 0x04, 0xa3, 0x3b, 0x20, 0xd3, 0x31, 0x31, 0xf6, 0x2d,
  1087. 0x9e, 0xc7, 0xe7, 0x96, 0xd9, 0xb7, 0x71, 0x6f, 0xd7, 0xef, 0xb7, 0x8f, 0x5c, 0xac, 0x31, 0x70,
  1088. 0x88, 0x4e, 0xb1, 0x08, 0x9d, 0x56, 0x60, 0xde, 0x73, 0x46, 0x76, 0x8f, 0xb1, 0x6c, 0x5e, 0xe3,
  1089. 0x07, 0x54, 0x83, 0x64, 0xc0, 0x12, 0xf9, 0x55, 0x2c, 0x59, 0xa2, 0x2c, 0xa1, 0x1c, 0x16, 0x02,
  1090. 0x2d, 0xd1, 0x11, 0x64, 0xa9, 0x40, 0x2a, 0x58, 0x5e, 0x82, 0x6d, 0xaf, 0x47, 0xd8, 0x89, 0x19,
  1091. 0x7a, 0x17, 0x96, 0x83, 0xd9, 0x07, 0xcd, 0xe3, 0x8c, 0xcb, 0x06, 0x0a, 0xd1, 0xbd, 0x08, 0xad,
  1092. 0x74, 0xbe, 0x80, 0x12, 0xac, 0xae, 0x09, 0xad, 0xea, 0x6c, 0x13, 0x5d, 0x83, 0x94, 0x6f, 0xf6,
  1093. 0x6d, 0x83, 0x8c, 0x3c, 0x2c, 0x98, 0x37, 0x11, 0xa0, 0xbb, 0xb0, 0x78, 0xe0, 0x10, 0xac, 0xe3,
  1094. 0x43, 0x82, 0x6d, 0xf6, 0xa6, 0xa7, 0x66, 0xed, 0x0e, 0x3a, 0x91, 0xda, 0x18, 0xa6, 0x29, 0x07,
  1095. 0xe1, 0xa3, 0x7a, 0x04, 0x4a, 0x44, 0x8f, 0x6e, 0x40, 0x96, 0x92, 0x8e, 0xbd, 0x17, 0xc4, 0xd1,
  1096. 0x69, 0x44, 0xb1, 0xb5, 0x14, 0xc3, 0x75, 0xe9, 0xe0, 0xdb, 0x0e, 0x9d, 0x1e, 0xfa, 0x1c, 0xae,
  1097. 0x05, 0x40, 0x1f, 0x5b, 0xfb, 0xba, 0x31, 0x22, 0x03, 0x6c, 0x13, 0xb3, 0x6b, 0x10, 0xd3, 0xee,
  1098. 0x8b, 0x05, 0xba, 0x2a, 0x8c, 0x5a, 0xd8, 0xda, 0x2f, 0x47, 0x00, 0xea, 0x67, 0xf0, 0x56, 0x24,
  1099. 0xb4, 0xf0, 0xfb, 0xba, 0x09, 0xa8, 0xbf, 0x49, 0xb0, 0xc0, 0x5f, 0xe6, 0x10, 0x75, 0xa4, 0xf3,
  1100. 0xa9, 0x13, 0x9b, 0x45, 0x9d, 0xf8, 0xc5, 0xa9, 0x53, 0x06, 0x08, 0xe6, 0xe1, 0xe7, 0xe4, 0x62,
  1101. 0x7c, 0x23, 0xbd, 0x75, 0x75, 0xda, 0x11, 0x4f, 0xb1, 0x65, 0xf6, 0xc5, 0xae, 0x0a, 0x19, 0xa9,
  1102. 0x3f, 0xc7, 0x20, 0x15, 0xe8, 0x51, 0x19, 0x94, 0x71, 0x5e, 0xfa, 0xbe, 0x65, 0xf4, 0xc5, 0xeb,
  1103. 0xb3, 0x36, 0x33, 0xb9, 0xbb, 0x96, 0xd1, 0xd7, 0xd2, 0x22, 0x1f, 0x7a, 0x38, 0x9f, 0x8a, 0xb1,
  1104. 0x19, 0x54, 0x8c, 0x70, 0x3f, 0x7e, 0x31, 0xee, 0x47, 0x58, 0x2a, 0x9f, 0x65, 0xe9, 0xce, 0x14,
  1105. 0x4b, 0xf9, 0x2b, 0x76, 0xfd, 0x15, 0x2c, 0xe5, 0x13, 0x3e, 0xcb, 0xd5, 0x5f, 0x63, 0x90, 0x6c,
  1106. 0xb2, 0x65, 0x64, 0x58, 0xff, 0xc7, 0x8a, 0xb9, 0x0a, 0x29, 0xd7, 0xb1, 0x74, 0xae, 0x91, 0x99,
  1107. 0x26, 0xe9, 0x3a, 0x96, 0x36, 0x45, 0xa2, 0xf9, 0x37, 0xb4, 0x7f, 0x16, 0xde, 0xc0, 0x0c, 0x12,
  1108. 0x67, 0x66, 0xa0, 0x7a, 0x90, 0xe1, 0xad, 0x10, 0x97, 0x83, 0xdb, 0xb4, 0x07, 0xec, 0xb6, 0x21,
  1109. 0x4d, 0x5f, 0x66, 0x78, 0xda, 0x1c, 0xa9, 0x09, 0x1c, 0xb5, 0xe0, 0xdf, 0x52, 0x71, 0x3f, 0xc9,
  1110. 0xcd, 0x22, 0xb9, 0x26, 0x70, 0xea, 0xf7, 0x12, 0xc0, 0x0e, 0xed, 0x2c, 0xab, 0x97, 0x7e, 0xd6,
  1111. 0x7d, 0x96, 0x82, 0x1e, 0x89, 0x5c, 0x98, 0x35, 0x34, 0x11, 0x3f, 0xe3, 0x87, 0xf3, 0xae, 0x82,
  1112. 0x32, 0xa1, 0xb6, 0x8f, 0xc7, 0xc9, 0x9c, 0xe3, 0x24, 0xf8, 0xda, 0xb6, 0x30, 0xd1, 0x32, 0x07,
  1113. 0xa1, 0x93, 0xfa, 0xbb, 0x04, 0x29, 0x96, 0xd3, 0x2e, 0x26, 0x46, 0x64, 0x86, 0xd2, 0xc5, 0x67,
  1114. 0xb8, 0x06, 0xc0, 0xdd, 0xf8, 0xe6, 0x13, 0x2c, 0x98, 0x95, 0x62, 0x92, 0x96, 0xf9, 0x04, 0xa3,
  1115. 0x0f, 0x83, 0x86, 0xc7, 0xff, 0xbb, 0xe1, 0x62, 0x41, 0x8c, 0xdb, 0x7e, 0x05, 0x12, 0xf6, 0x68,
  1116. 0xa8, 0xd3, 0x6f, 0xac, 0xcc, 0xd9, 0x6a, 0x8f, 0x86, 0xed, 0x43, 0x5f, 0xfd, 0x06, 0x12, 0xed,
  1117. 0x43, 0x76, 0xdf, 0xa4, 0x14, 0xf5, 0x1c, 0x47, 0x5c, 0x72, 0xf8, 0x96, 0x4c, 0x52, 0x01, 0xfb,
  1118. 0xa6, 0x23, 0x90, 0xe9, 0x16, 0x1d, 0xdf, 0x7e, 0xe9, 0x33, 0x2a, 0xbd, 0xe6, 0x4d, 0x56, 0xdc,
  1119. 0x61, 0x6f, 0xfd, 0x21, 0x41, 0x3a, 0xb4, 0x6d, 0xd0, 0xfb, 0x70, 0xa9, 0xb2, 0xb3, 0x57, 0x7d,
  1120. 0xa0, 0xd7, 0xb7, 0xf5, 0xbb, 0x3b, 0xe5, 0x7b, 0xfa, 0xc3, 0xc6, 0x83, 0xc6, 0xde, 0x97, 0x8d,
  1121. 0xec, 0x5c, 0xfe, 0xf2, 0xf1, 0x49, 0x11, 0x85, 0xb0, 0x0f, 0xed, 0xc7, 0xb6, 0xf3, 0xad, 0x8d,
  1122. 0x36, 0x61, 0x25, 0x6a, 0x52, 0xae, 0xb4, 0x6a, 0x8d, 0x76, 0x56, 0xca, 0x5f, 0x3a, 0x3e, 0x29,
  1123. 0x2e, 0x87, 0x2c, 0xca, 0x1d, 0x1f, 0xdb, 0x64, 0xda, 0xa0, 0xba, 0xb7, 0xbb, 0x5b, 0x6f, 0x67,
  1124. 0x63, 0x53, 0x06, 0x62, 0xfd, 0xdf, 0x84, 0xe5, 0xa8, 0x41, 0xa3, 0xbe, 0x93, 0x8d, 0xe7, 0xd1,
  1125. 0xf1, 0x49, 0x71, 0x31, 0x84, 0x6e, 0x98, 0x56, 0x3e, 0xf9, 0xdd, 0x0f, 0x85, 0xb9, 0x9f, 0x7e,
  1126. 0x2c, 0x48, 0xb4, 0x32, 0x25, 0xb2, 0x23, 0xd0, 0x7b, 0x70, 0xa5, 0x55, 0xbf, 0xd7, 0xa8, 0x6d,
  1127. 0xeb, 0xbb, 0xad, 0x7b, 0x7a, 0xfb, 0xab, 0x66, 0x2d, 0x54, 0xdd, 0xd2, 0xf1, 0x49, 0x31, 0x2d,
  1128. 0x4a, 0x9a, 0x85, 0x6e, 0x6a, 0xb5, 0x47, 0x7b, 0xed, 0x5a, 0x56, 0xe2, 0xe8, 0xa6, 0x87, 0xe9,
  1129. 0x02, 0x63, 0xe8, 0xdb, 0xb0, 0x7a, 0x0e, 0x3a, 0x28, 0x6c, 0xf9, 0xf8, 0xa4, 0xa8, 0x34, 0x3d,
  1130. 0xcc, 0xdf, 0x1f, 0x66, 0x51, 0x82, 0xdc, 0xb4, 0xc5, 0x5e, 0x73, 0xaf, 0x55, 0xde, 0xc9, 0x16,
  1131. 0xf3, 0xd9, 0xe3, 0x93, 0x62, 0x66, 0xbc, 0x0c, 0x29, 0x7e, 0x52, 0x59, 0xe5, 0x8b, 0x67, 0xa7,
  1132. 0x05, 0xe9, 0xf9, 0x69, 0x41, 0xfa, 0xfb, 0xb4, 0x20, 0x3d, 0x7d, 0x59, 0x98, 0x7b, 0xfe, 0xb2,
  1133. 0x30, 0xf7, 0xe7, 0xcb, 0xc2, 0xdc, 0xd7, 0x1f, 0xf5, 0x4d, 0x32, 0x18, 0x75, 0x4a, 0x5d, 0x67,
  1134. 0xb8, 0x19, 0xfe, 0x8f, 0x35, 0x79, 0xe4, 0xff, 0xf5, 0xce, 0xfe, 0xff, 0xea, 0x2c, 0x30, 0xf9,
  1135. 0x9d, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x38, 0xfc, 0x14, 0xb1, 0x40, 0x0e, 0x00, 0x00,
  1136. }
  1137. func (m *PartSetHeader) Marshal() (dAtA []byte, err error) {
  1138. size := m.Size()
  1139. dAtA = make([]byte, size)
  1140. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1141. if err != nil {
  1142. return nil, err
  1143. }
  1144. return dAtA[:n], nil
  1145. }
  1146. func (m *PartSetHeader) MarshalTo(dAtA []byte) (int, error) {
  1147. size := m.Size()
  1148. return m.MarshalToSizedBuffer(dAtA[:size])
  1149. }
  1150. func (m *PartSetHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1151. i := len(dAtA)
  1152. _ = i
  1153. var l int
  1154. _ = l
  1155. if len(m.Hash) > 0 {
  1156. i -= len(m.Hash)
  1157. copy(dAtA[i:], m.Hash)
  1158. i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash)))
  1159. i--
  1160. dAtA[i] = 0x12
  1161. }
  1162. if m.Total != 0 {
  1163. i = encodeVarintTypes(dAtA, i, uint64(m.Total))
  1164. i--
  1165. dAtA[i] = 0x8
  1166. }
  1167. return len(dAtA) - i, nil
  1168. }
  1169. func (m *Part) Marshal() (dAtA []byte, err error) {
  1170. size := m.Size()
  1171. dAtA = make([]byte, size)
  1172. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1173. if err != nil {
  1174. return nil, err
  1175. }
  1176. return dAtA[:n], nil
  1177. }
  1178. func (m *Part) MarshalTo(dAtA []byte) (int, error) {
  1179. size := m.Size()
  1180. return m.MarshalToSizedBuffer(dAtA[:size])
  1181. }
  1182. func (m *Part) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1183. i := len(dAtA)
  1184. _ = i
  1185. var l int
  1186. _ = l
  1187. {
  1188. size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i])
  1189. if err != nil {
  1190. return 0, err
  1191. }
  1192. i -= size
  1193. i = encodeVarintTypes(dAtA, i, uint64(size))
  1194. }
  1195. i--
  1196. dAtA[i] = 0x1a
  1197. if len(m.Bytes) > 0 {
  1198. i -= len(m.Bytes)
  1199. copy(dAtA[i:], m.Bytes)
  1200. i = encodeVarintTypes(dAtA, i, uint64(len(m.Bytes)))
  1201. i--
  1202. dAtA[i] = 0x12
  1203. }
  1204. if m.Index != 0 {
  1205. i = encodeVarintTypes(dAtA, i, uint64(m.Index))
  1206. i--
  1207. dAtA[i] = 0x8
  1208. }
  1209. return len(dAtA) - i, nil
  1210. }
  1211. func (m *BlockID) Marshal() (dAtA []byte, err error) {
  1212. size := m.Size()
  1213. dAtA = make([]byte, size)
  1214. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1215. if err != nil {
  1216. return nil, err
  1217. }
  1218. return dAtA[:n], nil
  1219. }
  1220. func (m *BlockID) MarshalTo(dAtA []byte) (int, error) {
  1221. size := m.Size()
  1222. return m.MarshalToSizedBuffer(dAtA[:size])
  1223. }
  1224. func (m *BlockID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1225. i := len(dAtA)
  1226. _ = i
  1227. var l int
  1228. _ = l
  1229. {
  1230. size, err := m.PartSetHeader.MarshalToSizedBuffer(dAtA[:i])
  1231. if err != nil {
  1232. return 0, err
  1233. }
  1234. i -= size
  1235. i = encodeVarintTypes(dAtA, i, uint64(size))
  1236. }
  1237. i--
  1238. dAtA[i] = 0x12
  1239. if len(m.Hash) > 0 {
  1240. i -= len(m.Hash)
  1241. copy(dAtA[i:], m.Hash)
  1242. i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash)))
  1243. i--
  1244. dAtA[i] = 0xa
  1245. }
  1246. return len(dAtA) - i, nil
  1247. }
  1248. func (m *Header) Marshal() (dAtA []byte, err error) {
  1249. size := m.Size()
  1250. dAtA = make([]byte, size)
  1251. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1252. if err != nil {
  1253. return nil, err
  1254. }
  1255. return dAtA[:n], nil
  1256. }
  1257. func (m *Header) MarshalTo(dAtA []byte) (int, error) {
  1258. size := m.Size()
  1259. return m.MarshalToSizedBuffer(dAtA[:size])
  1260. }
  1261. func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1262. i := len(dAtA)
  1263. _ = i
  1264. var l int
  1265. _ = l
  1266. if len(m.ProposerAddress) > 0 {
  1267. i -= len(m.ProposerAddress)
  1268. copy(dAtA[i:], m.ProposerAddress)
  1269. i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress)))
  1270. i--
  1271. dAtA[i] = 0x72
  1272. }
  1273. if len(m.EvidenceHash) > 0 {
  1274. i -= len(m.EvidenceHash)
  1275. copy(dAtA[i:], m.EvidenceHash)
  1276. i = encodeVarintTypes(dAtA, i, uint64(len(m.EvidenceHash)))
  1277. i--
  1278. dAtA[i] = 0x6a
  1279. }
  1280. if len(m.LastResultsHash) > 0 {
  1281. i -= len(m.LastResultsHash)
  1282. copy(dAtA[i:], m.LastResultsHash)
  1283. i = encodeVarintTypes(dAtA, i, uint64(len(m.LastResultsHash)))
  1284. i--
  1285. dAtA[i] = 0x62
  1286. }
  1287. if len(m.AppHash) > 0 {
  1288. i -= len(m.AppHash)
  1289. copy(dAtA[i:], m.AppHash)
  1290. i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash)))
  1291. i--
  1292. dAtA[i] = 0x5a
  1293. }
  1294. if len(m.ConsensusHash) > 0 {
  1295. i -= len(m.ConsensusHash)
  1296. copy(dAtA[i:], m.ConsensusHash)
  1297. i = encodeVarintTypes(dAtA, i, uint64(len(m.ConsensusHash)))
  1298. i--
  1299. dAtA[i] = 0x52
  1300. }
  1301. if len(m.NextValidatorsHash) > 0 {
  1302. i -= len(m.NextValidatorsHash)
  1303. copy(dAtA[i:], m.NextValidatorsHash)
  1304. i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash)))
  1305. i--
  1306. dAtA[i] = 0x4a
  1307. }
  1308. if len(m.ValidatorsHash) > 0 {
  1309. i -= len(m.ValidatorsHash)
  1310. copy(dAtA[i:], m.ValidatorsHash)
  1311. i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorsHash)))
  1312. i--
  1313. dAtA[i] = 0x42
  1314. }
  1315. if len(m.DataHash) > 0 {
  1316. i -= len(m.DataHash)
  1317. copy(dAtA[i:], m.DataHash)
  1318. i = encodeVarintTypes(dAtA, i, uint64(len(m.DataHash)))
  1319. i--
  1320. dAtA[i] = 0x3a
  1321. }
  1322. if len(m.LastCommitHash) > 0 {
  1323. i -= len(m.LastCommitHash)
  1324. copy(dAtA[i:], m.LastCommitHash)
  1325. i = encodeVarintTypes(dAtA, i, uint64(len(m.LastCommitHash)))
  1326. i--
  1327. dAtA[i] = 0x32
  1328. }
  1329. {
  1330. size, err := m.LastBlockId.MarshalToSizedBuffer(dAtA[:i])
  1331. if err != nil {
  1332. return 0, err
  1333. }
  1334. i -= size
  1335. i = encodeVarintTypes(dAtA, i, uint64(size))
  1336. }
  1337. i--
  1338. dAtA[i] = 0x2a
  1339. n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):])
  1340. if err4 != nil {
  1341. return 0, err4
  1342. }
  1343. i -= n4
  1344. i = encodeVarintTypes(dAtA, i, uint64(n4))
  1345. i--
  1346. dAtA[i] = 0x22
  1347. if m.Height != 0 {
  1348. i = encodeVarintTypes(dAtA, i, uint64(m.Height))
  1349. i--
  1350. dAtA[i] = 0x18
  1351. }
  1352. if len(m.ChainID) > 0 {
  1353. i -= len(m.ChainID)
  1354. copy(dAtA[i:], m.ChainID)
  1355. i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainID)))
  1356. i--
  1357. dAtA[i] = 0x12
  1358. }
  1359. {
  1360. size, err := m.Version.MarshalToSizedBuffer(dAtA[:i])
  1361. if err != nil {
  1362. return 0, err
  1363. }
  1364. i -= size
  1365. i = encodeVarintTypes(dAtA, i, uint64(size))
  1366. }
  1367. i--
  1368. dAtA[i] = 0xa
  1369. return len(dAtA) - i, nil
  1370. }
  1371. func (m *Data) Marshal() (dAtA []byte, err error) {
  1372. size := m.Size()
  1373. dAtA = make([]byte, size)
  1374. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1375. if err != nil {
  1376. return nil, err
  1377. }
  1378. return dAtA[:n], nil
  1379. }
  1380. func (m *Data) MarshalTo(dAtA []byte) (int, error) {
  1381. size := m.Size()
  1382. return m.MarshalToSizedBuffer(dAtA[:size])
  1383. }
  1384. func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1385. i := len(dAtA)
  1386. _ = i
  1387. var l int
  1388. _ = l
  1389. if len(m.Txs) > 0 {
  1390. for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- {
  1391. i -= len(m.Txs[iNdEx])
  1392. copy(dAtA[i:], m.Txs[iNdEx])
  1393. i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx])))
  1394. i--
  1395. dAtA[i] = 0xa
  1396. }
  1397. }
  1398. return len(dAtA) - i, nil
  1399. }
  1400. func (m *Vote) Marshal() (dAtA []byte, err error) {
  1401. size := m.Size()
  1402. dAtA = make([]byte, size)
  1403. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1404. if err != nil {
  1405. return nil, err
  1406. }
  1407. return dAtA[:n], nil
  1408. }
  1409. func (m *Vote) MarshalTo(dAtA []byte) (int, error) {
  1410. size := m.Size()
  1411. return m.MarshalToSizedBuffer(dAtA[:size])
  1412. }
  1413. func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1414. i := len(dAtA)
  1415. _ = i
  1416. var l int
  1417. _ = l
  1418. if m.VoteExtension != nil {
  1419. {
  1420. size, err := m.VoteExtension.MarshalToSizedBuffer(dAtA[:i])
  1421. if err != nil {
  1422. return 0, err
  1423. }
  1424. i -= size
  1425. i = encodeVarintTypes(dAtA, i, uint64(size))
  1426. }
  1427. i--
  1428. dAtA[i] = 0x4a
  1429. }
  1430. if len(m.Signature) > 0 {
  1431. i -= len(m.Signature)
  1432. copy(dAtA[i:], m.Signature)
  1433. i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature)))
  1434. i--
  1435. dAtA[i] = 0x42
  1436. }
  1437. if m.ValidatorIndex != 0 {
  1438. i = encodeVarintTypes(dAtA, i, uint64(m.ValidatorIndex))
  1439. i--
  1440. dAtA[i] = 0x38
  1441. }
  1442. if len(m.ValidatorAddress) > 0 {
  1443. i -= len(m.ValidatorAddress)
  1444. copy(dAtA[i:], m.ValidatorAddress)
  1445. i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorAddress)))
  1446. i--
  1447. dAtA[i] = 0x32
  1448. }
  1449. n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
  1450. if err7 != nil {
  1451. return 0, err7
  1452. }
  1453. i -= n7
  1454. i = encodeVarintTypes(dAtA, i, uint64(n7))
  1455. i--
  1456. dAtA[i] = 0x2a
  1457. {
  1458. size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i])
  1459. if err != nil {
  1460. return 0, err
  1461. }
  1462. i -= size
  1463. i = encodeVarintTypes(dAtA, i, uint64(size))
  1464. }
  1465. i--
  1466. dAtA[i] = 0x22
  1467. if m.Round != 0 {
  1468. i = encodeVarintTypes(dAtA, i, uint64(m.Round))
  1469. i--
  1470. dAtA[i] = 0x18
  1471. }
  1472. if m.Height != 0 {
  1473. i = encodeVarintTypes(dAtA, i, uint64(m.Height))
  1474. i--
  1475. dAtA[i] = 0x10
  1476. }
  1477. if m.Type != 0 {
  1478. i = encodeVarintTypes(dAtA, i, uint64(m.Type))
  1479. i--
  1480. dAtA[i] = 0x8
  1481. }
  1482. return len(dAtA) - i, nil
  1483. }
  1484. func (m *VoteExtension) Marshal() (dAtA []byte, err error) {
  1485. size := m.Size()
  1486. dAtA = make([]byte, size)
  1487. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1488. if err != nil {
  1489. return nil, err
  1490. }
  1491. return dAtA[:n], nil
  1492. }
  1493. func (m *VoteExtension) MarshalTo(dAtA []byte) (int, error) {
  1494. size := m.Size()
  1495. return m.MarshalToSizedBuffer(dAtA[:size])
  1496. }
  1497. func (m *VoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1498. i := len(dAtA)
  1499. _ = i
  1500. var l int
  1501. _ = l
  1502. if len(m.AppDataSelfAuthenticating) > 0 {
  1503. i -= len(m.AppDataSelfAuthenticating)
  1504. copy(dAtA[i:], m.AppDataSelfAuthenticating)
  1505. i = encodeVarintTypes(dAtA, i, uint64(len(m.AppDataSelfAuthenticating)))
  1506. i--
  1507. dAtA[i] = 0x12
  1508. }
  1509. if len(m.AppDataToSign) > 0 {
  1510. i -= len(m.AppDataToSign)
  1511. copy(dAtA[i:], m.AppDataToSign)
  1512. i = encodeVarintTypes(dAtA, i, uint64(len(m.AppDataToSign)))
  1513. i--
  1514. dAtA[i] = 0xa
  1515. }
  1516. return len(dAtA) - i, nil
  1517. }
  1518. func (m *VoteExtensionToSign) Marshal() (dAtA []byte, err error) {
  1519. size := m.Size()
  1520. dAtA = make([]byte, size)
  1521. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1522. if err != nil {
  1523. return nil, err
  1524. }
  1525. return dAtA[:n], nil
  1526. }
  1527. func (m *VoteExtensionToSign) MarshalTo(dAtA []byte) (int, error) {
  1528. size := m.Size()
  1529. return m.MarshalToSizedBuffer(dAtA[:size])
  1530. }
  1531. func (m *VoteExtensionToSign) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1532. i := len(dAtA)
  1533. _ = i
  1534. var l int
  1535. _ = l
  1536. if len(m.AppDataToSign) > 0 {
  1537. i -= len(m.AppDataToSign)
  1538. copy(dAtA[i:], m.AppDataToSign)
  1539. i = encodeVarintTypes(dAtA, i, uint64(len(m.AppDataToSign)))
  1540. i--
  1541. dAtA[i] = 0xa
  1542. }
  1543. return len(dAtA) - i, nil
  1544. }
  1545. func (m *Commit) Marshal() (dAtA []byte, err error) {
  1546. size := m.Size()
  1547. dAtA = make([]byte, size)
  1548. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1549. if err != nil {
  1550. return nil, err
  1551. }
  1552. return dAtA[:n], nil
  1553. }
  1554. func (m *Commit) MarshalTo(dAtA []byte) (int, error) {
  1555. size := m.Size()
  1556. return m.MarshalToSizedBuffer(dAtA[:size])
  1557. }
  1558. func (m *Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1559. i := len(dAtA)
  1560. _ = i
  1561. var l int
  1562. _ = l
  1563. if len(m.Signatures) > 0 {
  1564. for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- {
  1565. {
  1566. size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  1567. if err != nil {
  1568. return 0, err
  1569. }
  1570. i -= size
  1571. i = encodeVarintTypes(dAtA, i, uint64(size))
  1572. }
  1573. i--
  1574. dAtA[i] = 0x22
  1575. }
  1576. }
  1577. {
  1578. size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i])
  1579. if err != nil {
  1580. return 0, err
  1581. }
  1582. i -= size
  1583. i = encodeVarintTypes(dAtA, i, uint64(size))
  1584. }
  1585. i--
  1586. dAtA[i] = 0x1a
  1587. if m.Round != 0 {
  1588. i = encodeVarintTypes(dAtA, i, uint64(m.Round))
  1589. i--
  1590. dAtA[i] = 0x10
  1591. }
  1592. if m.Height != 0 {
  1593. i = encodeVarintTypes(dAtA, i, uint64(m.Height))
  1594. i--
  1595. dAtA[i] = 0x8
  1596. }
  1597. return len(dAtA) - i, nil
  1598. }
  1599. func (m *CommitSig) Marshal() (dAtA []byte, err error) {
  1600. size := m.Size()
  1601. dAtA = make([]byte, size)
  1602. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1603. if err != nil {
  1604. return nil, err
  1605. }
  1606. return dAtA[:n], nil
  1607. }
  1608. func (m *CommitSig) MarshalTo(dAtA []byte) (int, error) {
  1609. size := m.Size()
  1610. return m.MarshalToSizedBuffer(dAtA[:size])
  1611. }
  1612. func (m *CommitSig) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1613. i := len(dAtA)
  1614. _ = i
  1615. var l int
  1616. _ = l
  1617. if m.VoteExtension != nil {
  1618. {
  1619. size, err := m.VoteExtension.MarshalToSizedBuffer(dAtA[:i])
  1620. if err != nil {
  1621. return 0, err
  1622. }
  1623. i -= size
  1624. i = encodeVarintTypes(dAtA, i, uint64(size))
  1625. }
  1626. i--
  1627. dAtA[i] = 0x2a
  1628. }
  1629. if len(m.Signature) > 0 {
  1630. i -= len(m.Signature)
  1631. copy(dAtA[i:], m.Signature)
  1632. i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature)))
  1633. i--
  1634. dAtA[i] = 0x22
  1635. }
  1636. n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
  1637. if err11 != nil {
  1638. return 0, err11
  1639. }
  1640. i -= n11
  1641. i = encodeVarintTypes(dAtA, i, uint64(n11))
  1642. i--
  1643. dAtA[i] = 0x1a
  1644. if len(m.ValidatorAddress) > 0 {
  1645. i -= len(m.ValidatorAddress)
  1646. copy(dAtA[i:], m.ValidatorAddress)
  1647. i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorAddress)))
  1648. i--
  1649. dAtA[i] = 0x12
  1650. }
  1651. if m.BlockIdFlag != 0 {
  1652. i = encodeVarintTypes(dAtA, i, uint64(m.BlockIdFlag))
  1653. i--
  1654. dAtA[i] = 0x8
  1655. }
  1656. return len(dAtA) - i, nil
  1657. }
  1658. func (m *Proposal) Marshal() (dAtA []byte, err error) {
  1659. size := m.Size()
  1660. dAtA = make([]byte, size)
  1661. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1662. if err != nil {
  1663. return nil, err
  1664. }
  1665. return dAtA[:n], nil
  1666. }
  1667. func (m *Proposal) MarshalTo(dAtA []byte) (int, error) {
  1668. size := m.Size()
  1669. return m.MarshalToSizedBuffer(dAtA[:size])
  1670. }
  1671. func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1672. i := len(dAtA)
  1673. _ = i
  1674. var l int
  1675. _ = l
  1676. if len(m.Signature) > 0 {
  1677. i -= len(m.Signature)
  1678. copy(dAtA[i:], m.Signature)
  1679. i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature)))
  1680. i--
  1681. dAtA[i] = 0x3a
  1682. }
  1683. n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
  1684. if err12 != nil {
  1685. return 0, err12
  1686. }
  1687. i -= n12
  1688. i = encodeVarintTypes(dAtA, i, uint64(n12))
  1689. i--
  1690. dAtA[i] = 0x32
  1691. {
  1692. size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i])
  1693. if err != nil {
  1694. return 0, err
  1695. }
  1696. i -= size
  1697. i = encodeVarintTypes(dAtA, i, uint64(size))
  1698. }
  1699. i--
  1700. dAtA[i] = 0x2a
  1701. if m.PolRound != 0 {
  1702. i = encodeVarintTypes(dAtA, i, uint64(m.PolRound))
  1703. i--
  1704. dAtA[i] = 0x20
  1705. }
  1706. if m.Round != 0 {
  1707. i = encodeVarintTypes(dAtA, i, uint64(m.Round))
  1708. i--
  1709. dAtA[i] = 0x18
  1710. }
  1711. if m.Height != 0 {
  1712. i = encodeVarintTypes(dAtA, i, uint64(m.Height))
  1713. i--
  1714. dAtA[i] = 0x10
  1715. }
  1716. if m.Type != 0 {
  1717. i = encodeVarintTypes(dAtA, i, uint64(m.Type))
  1718. i--
  1719. dAtA[i] = 0x8
  1720. }
  1721. return len(dAtA) - i, nil
  1722. }
  1723. func (m *SignedHeader) Marshal() (dAtA []byte, err error) {
  1724. size := m.Size()
  1725. dAtA = make([]byte, size)
  1726. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1727. if err != nil {
  1728. return nil, err
  1729. }
  1730. return dAtA[:n], nil
  1731. }
  1732. func (m *SignedHeader) MarshalTo(dAtA []byte) (int, error) {
  1733. size := m.Size()
  1734. return m.MarshalToSizedBuffer(dAtA[:size])
  1735. }
  1736. func (m *SignedHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1737. i := len(dAtA)
  1738. _ = i
  1739. var l int
  1740. _ = l
  1741. if m.Commit != nil {
  1742. {
  1743. size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i])
  1744. if err != nil {
  1745. return 0, err
  1746. }
  1747. i -= size
  1748. i = encodeVarintTypes(dAtA, i, uint64(size))
  1749. }
  1750. i--
  1751. dAtA[i] = 0x12
  1752. }
  1753. if m.Header != nil {
  1754. {
  1755. size, err := m.Header.MarshalToSizedBuffer(dAtA[:i])
  1756. if err != nil {
  1757. return 0, err
  1758. }
  1759. i -= size
  1760. i = encodeVarintTypes(dAtA, i, uint64(size))
  1761. }
  1762. i--
  1763. dAtA[i] = 0xa
  1764. }
  1765. return len(dAtA) - i, nil
  1766. }
  1767. func (m *LightBlock) Marshal() (dAtA []byte, err error) {
  1768. size := m.Size()
  1769. dAtA = make([]byte, size)
  1770. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1771. if err != nil {
  1772. return nil, err
  1773. }
  1774. return dAtA[:n], nil
  1775. }
  1776. func (m *LightBlock) MarshalTo(dAtA []byte) (int, error) {
  1777. size := m.Size()
  1778. return m.MarshalToSizedBuffer(dAtA[:size])
  1779. }
  1780. func (m *LightBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1781. i := len(dAtA)
  1782. _ = i
  1783. var l int
  1784. _ = l
  1785. if m.ValidatorSet != nil {
  1786. {
  1787. size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i])
  1788. if err != nil {
  1789. return 0, err
  1790. }
  1791. i -= size
  1792. i = encodeVarintTypes(dAtA, i, uint64(size))
  1793. }
  1794. i--
  1795. dAtA[i] = 0x12
  1796. }
  1797. if m.SignedHeader != nil {
  1798. {
  1799. size, err := m.SignedHeader.MarshalToSizedBuffer(dAtA[:i])
  1800. if err != nil {
  1801. return 0, err
  1802. }
  1803. i -= size
  1804. i = encodeVarintTypes(dAtA, i, uint64(size))
  1805. }
  1806. i--
  1807. dAtA[i] = 0xa
  1808. }
  1809. return len(dAtA) - i, nil
  1810. }
  1811. func (m *BlockMeta) Marshal() (dAtA []byte, err error) {
  1812. size := m.Size()
  1813. dAtA = make([]byte, size)
  1814. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1815. if err != nil {
  1816. return nil, err
  1817. }
  1818. return dAtA[:n], nil
  1819. }
  1820. func (m *BlockMeta) MarshalTo(dAtA []byte) (int, error) {
  1821. size := m.Size()
  1822. return m.MarshalToSizedBuffer(dAtA[:size])
  1823. }
  1824. func (m *BlockMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1825. i := len(dAtA)
  1826. _ = i
  1827. var l int
  1828. _ = l
  1829. if m.NumTxs != 0 {
  1830. i = encodeVarintTypes(dAtA, i, uint64(m.NumTxs))
  1831. i--
  1832. dAtA[i] = 0x20
  1833. }
  1834. {
  1835. size, err := m.Header.MarshalToSizedBuffer(dAtA[:i])
  1836. if err != nil {
  1837. return 0, err
  1838. }
  1839. i -= size
  1840. i = encodeVarintTypes(dAtA, i, uint64(size))
  1841. }
  1842. i--
  1843. dAtA[i] = 0x1a
  1844. if m.BlockSize != 0 {
  1845. i = encodeVarintTypes(dAtA, i, uint64(m.BlockSize))
  1846. i--
  1847. dAtA[i] = 0x10
  1848. }
  1849. {
  1850. size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i])
  1851. if err != nil {
  1852. return 0, err
  1853. }
  1854. i -= size
  1855. i = encodeVarintTypes(dAtA, i, uint64(size))
  1856. }
  1857. i--
  1858. dAtA[i] = 0xa
  1859. return len(dAtA) - i, nil
  1860. }
  1861. func (m *TxProof) Marshal() (dAtA []byte, err error) {
  1862. size := m.Size()
  1863. dAtA = make([]byte, size)
  1864. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1865. if err != nil {
  1866. return nil, err
  1867. }
  1868. return dAtA[:n], nil
  1869. }
  1870. func (m *TxProof) MarshalTo(dAtA []byte) (int, error) {
  1871. size := m.Size()
  1872. return m.MarshalToSizedBuffer(dAtA[:size])
  1873. }
  1874. func (m *TxProof) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1875. i := len(dAtA)
  1876. _ = i
  1877. var l int
  1878. _ = l
  1879. if m.Proof != nil {
  1880. {
  1881. size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i])
  1882. if err != nil {
  1883. return 0, err
  1884. }
  1885. i -= size
  1886. i = encodeVarintTypes(dAtA, i, uint64(size))
  1887. }
  1888. i--
  1889. dAtA[i] = 0x1a
  1890. }
  1891. if len(m.Data) > 0 {
  1892. i -= len(m.Data)
  1893. copy(dAtA[i:], m.Data)
  1894. i = encodeVarintTypes(dAtA, i, uint64(len(m.Data)))
  1895. i--
  1896. dAtA[i] = 0x12
  1897. }
  1898. if len(m.RootHash) > 0 {
  1899. i -= len(m.RootHash)
  1900. copy(dAtA[i:], m.RootHash)
  1901. i = encodeVarintTypes(dAtA, i, uint64(len(m.RootHash)))
  1902. i--
  1903. dAtA[i] = 0xa
  1904. }
  1905. return len(dAtA) - i, nil
  1906. }
  1907. func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
  1908. offset -= sovTypes(v)
  1909. base := offset
  1910. for v >= 1<<7 {
  1911. dAtA[offset] = uint8(v&0x7f | 0x80)
  1912. v >>= 7
  1913. offset++
  1914. }
  1915. dAtA[offset] = uint8(v)
  1916. return base
  1917. }
  1918. func (m *PartSetHeader) Size() (n int) {
  1919. if m == nil {
  1920. return 0
  1921. }
  1922. var l int
  1923. _ = l
  1924. if m.Total != 0 {
  1925. n += 1 + sovTypes(uint64(m.Total))
  1926. }
  1927. l = len(m.Hash)
  1928. if l > 0 {
  1929. n += 1 + l + sovTypes(uint64(l))
  1930. }
  1931. return n
  1932. }
  1933. func (m *Part) Size() (n int) {
  1934. if m == nil {
  1935. return 0
  1936. }
  1937. var l int
  1938. _ = l
  1939. if m.Index != 0 {
  1940. n += 1 + sovTypes(uint64(m.Index))
  1941. }
  1942. l = len(m.Bytes)
  1943. if l > 0 {
  1944. n += 1 + l + sovTypes(uint64(l))
  1945. }
  1946. l = m.Proof.Size()
  1947. n += 1 + l + sovTypes(uint64(l))
  1948. return n
  1949. }
  1950. func (m *BlockID) Size() (n int) {
  1951. if m == nil {
  1952. return 0
  1953. }
  1954. var l int
  1955. _ = l
  1956. l = len(m.Hash)
  1957. if l > 0 {
  1958. n += 1 + l + sovTypes(uint64(l))
  1959. }
  1960. l = m.PartSetHeader.Size()
  1961. n += 1 + l + sovTypes(uint64(l))
  1962. return n
  1963. }
  1964. func (m *Header) Size() (n int) {
  1965. if m == nil {
  1966. return 0
  1967. }
  1968. var l int
  1969. _ = l
  1970. l = m.Version.Size()
  1971. n += 1 + l + sovTypes(uint64(l))
  1972. l = len(m.ChainID)
  1973. if l > 0 {
  1974. n += 1 + l + sovTypes(uint64(l))
  1975. }
  1976. if m.Height != 0 {
  1977. n += 1 + sovTypes(uint64(m.Height))
  1978. }
  1979. l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time)
  1980. n += 1 + l + sovTypes(uint64(l))
  1981. l = m.LastBlockId.Size()
  1982. n += 1 + l + sovTypes(uint64(l))
  1983. l = len(m.LastCommitHash)
  1984. if l > 0 {
  1985. n += 1 + l + sovTypes(uint64(l))
  1986. }
  1987. l = len(m.DataHash)
  1988. if l > 0 {
  1989. n += 1 + l + sovTypes(uint64(l))
  1990. }
  1991. l = len(m.ValidatorsHash)
  1992. if l > 0 {
  1993. n += 1 + l + sovTypes(uint64(l))
  1994. }
  1995. l = len(m.NextValidatorsHash)
  1996. if l > 0 {
  1997. n += 1 + l + sovTypes(uint64(l))
  1998. }
  1999. l = len(m.ConsensusHash)
  2000. if l > 0 {
  2001. n += 1 + l + sovTypes(uint64(l))
  2002. }
  2003. l = len(m.AppHash)
  2004. if l > 0 {
  2005. n += 1 + l + sovTypes(uint64(l))
  2006. }
  2007. l = len(m.LastResultsHash)
  2008. if l > 0 {
  2009. n += 1 + l + sovTypes(uint64(l))
  2010. }
  2011. l = len(m.EvidenceHash)
  2012. if l > 0 {
  2013. n += 1 + l + sovTypes(uint64(l))
  2014. }
  2015. l = len(m.ProposerAddress)
  2016. if l > 0 {
  2017. n += 1 + l + sovTypes(uint64(l))
  2018. }
  2019. return n
  2020. }
  2021. func (m *Data) Size() (n int) {
  2022. if m == nil {
  2023. return 0
  2024. }
  2025. var l int
  2026. _ = l
  2027. if len(m.Txs) > 0 {
  2028. for _, b := range m.Txs {
  2029. l = len(b)
  2030. n += 1 + l + sovTypes(uint64(l))
  2031. }
  2032. }
  2033. return n
  2034. }
  2035. func (m *Vote) Size() (n int) {
  2036. if m == nil {
  2037. return 0
  2038. }
  2039. var l int
  2040. _ = l
  2041. if m.Type != 0 {
  2042. n += 1 + sovTypes(uint64(m.Type))
  2043. }
  2044. if m.Height != 0 {
  2045. n += 1 + sovTypes(uint64(m.Height))
  2046. }
  2047. if m.Round != 0 {
  2048. n += 1 + sovTypes(uint64(m.Round))
  2049. }
  2050. l = m.BlockID.Size()
  2051. n += 1 + l + sovTypes(uint64(l))
  2052. l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
  2053. n += 1 + l + sovTypes(uint64(l))
  2054. l = len(m.ValidatorAddress)
  2055. if l > 0 {
  2056. n += 1 + l + sovTypes(uint64(l))
  2057. }
  2058. if m.ValidatorIndex != 0 {
  2059. n += 1 + sovTypes(uint64(m.ValidatorIndex))
  2060. }
  2061. l = len(m.Signature)
  2062. if l > 0 {
  2063. n += 1 + l + sovTypes(uint64(l))
  2064. }
  2065. if m.VoteExtension != nil {
  2066. l = m.VoteExtension.Size()
  2067. n += 1 + l + sovTypes(uint64(l))
  2068. }
  2069. return n
  2070. }
  2071. func (m *VoteExtension) Size() (n int) {
  2072. if m == nil {
  2073. return 0
  2074. }
  2075. var l int
  2076. _ = l
  2077. l = len(m.AppDataToSign)
  2078. if l > 0 {
  2079. n += 1 + l + sovTypes(uint64(l))
  2080. }
  2081. l = len(m.AppDataSelfAuthenticating)
  2082. if l > 0 {
  2083. n += 1 + l + sovTypes(uint64(l))
  2084. }
  2085. return n
  2086. }
  2087. func (m *VoteExtensionToSign) Size() (n int) {
  2088. if m == nil {
  2089. return 0
  2090. }
  2091. var l int
  2092. _ = l
  2093. l = len(m.AppDataToSign)
  2094. if l > 0 {
  2095. n += 1 + l + sovTypes(uint64(l))
  2096. }
  2097. return n
  2098. }
  2099. func (m *Commit) Size() (n int) {
  2100. if m == nil {
  2101. return 0
  2102. }
  2103. var l int
  2104. _ = l
  2105. if m.Height != 0 {
  2106. n += 1 + sovTypes(uint64(m.Height))
  2107. }
  2108. if m.Round != 0 {
  2109. n += 1 + sovTypes(uint64(m.Round))
  2110. }
  2111. l = m.BlockID.Size()
  2112. n += 1 + l + sovTypes(uint64(l))
  2113. if len(m.Signatures) > 0 {
  2114. for _, e := range m.Signatures {
  2115. l = e.Size()
  2116. n += 1 + l + sovTypes(uint64(l))
  2117. }
  2118. }
  2119. return n
  2120. }
  2121. func (m *CommitSig) Size() (n int) {
  2122. if m == nil {
  2123. return 0
  2124. }
  2125. var l int
  2126. _ = l
  2127. if m.BlockIdFlag != 0 {
  2128. n += 1 + sovTypes(uint64(m.BlockIdFlag))
  2129. }
  2130. l = len(m.ValidatorAddress)
  2131. if l > 0 {
  2132. n += 1 + l + sovTypes(uint64(l))
  2133. }
  2134. l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
  2135. n += 1 + l + sovTypes(uint64(l))
  2136. l = len(m.Signature)
  2137. if l > 0 {
  2138. n += 1 + l + sovTypes(uint64(l))
  2139. }
  2140. if m.VoteExtension != nil {
  2141. l = m.VoteExtension.Size()
  2142. n += 1 + l + sovTypes(uint64(l))
  2143. }
  2144. return n
  2145. }
  2146. func (m *Proposal) Size() (n int) {
  2147. if m == nil {
  2148. return 0
  2149. }
  2150. var l int
  2151. _ = l
  2152. if m.Type != 0 {
  2153. n += 1 + sovTypes(uint64(m.Type))
  2154. }
  2155. if m.Height != 0 {
  2156. n += 1 + sovTypes(uint64(m.Height))
  2157. }
  2158. if m.Round != 0 {
  2159. n += 1 + sovTypes(uint64(m.Round))
  2160. }
  2161. if m.PolRound != 0 {
  2162. n += 1 + sovTypes(uint64(m.PolRound))
  2163. }
  2164. l = m.BlockID.Size()
  2165. n += 1 + l + sovTypes(uint64(l))
  2166. l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
  2167. n += 1 + l + sovTypes(uint64(l))
  2168. l = len(m.Signature)
  2169. if l > 0 {
  2170. n += 1 + l + sovTypes(uint64(l))
  2171. }
  2172. return n
  2173. }
  2174. func (m *SignedHeader) Size() (n int) {
  2175. if m == nil {
  2176. return 0
  2177. }
  2178. var l int
  2179. _ = l
  2180. if m.Header != nil {
  2181. l = m.Header.Size()
  2182. n += 1 + l + sovTypes(uint64(l))
  2183. }
  2184. if m.Commit != nil {
  2185. l = m.Commit.Size()
  2186. n += 1 + l + sovTypes(uint64(l))
  2187. }
  2188. return n
  2189. }
  2190. func (m *LightBlock) Size() (n int) {
  2191. if m == nil {
  2192. return 0
  2193. }
  2194. var l int
  2195. _ = l
  2196. if m.SignedHeader != nil {
  2197. l = m.SignedHeader.Size()
  2198. n += 1 + l + sovTypes(uint64(l))
  2199. }
  2200. if m.ValidatorSet != nil {
  2201. l = m.ValidatorSet.Size()
  2202. n += 1 + l + sovTypes(uint64(l))
  2203. }
  2204. return n
  2205. }
  2206. func (m *BlockMeta) Size() (n int) {
  2207. if m == nil {
  2208. return 0
  2209. }
  2210. var l int
  2211. _ = l
  2212. l = m.BlockID.Size()
  2213. n += 1 + l + sovTypes(uint64(l))
  2214. if m.BlockSize != 0 {
  2215. n += 1 + sovTypes(uint64(m.BlockSize))
  2216. }
  2217. l = m.Header.Size()
  2218. n += 1 + l + sovTypes(uint64(l))
  2219. if m.NumTxs != 0 {
  2220. n += 1 + sovTypes(uint64(m.NumTxs))
  2221. }
  2222. return n
  2223. }
  2224. func (m *TxProof) Size() (n int) {
  2225. if m == nil {
  2226. return 0
  2227. }
  2228. var l int
  2229. _ = l
  2230. l = len(m.RootHash)
  2231. if l > 0 {
  2232. n += 1 + l + sovTypes(uint64(l))
  2233. }
  2234. l = len(m.Data)
  2235. if l > 0 {
  2236. n += 1 + l + sovTypes(uint64(l))
  2237. }
  2238. if m.Proof != nil {
  2239. l = m.Proof.Size()
  2240. n += 1 + l + sovTypes(uint64(l))
  2241. }
  2242. return n
  2243. }
  2244. func sovTypes(x uint64) (n int) {
  2245. return (math_bits.Len64(x|1) + 6) / 7
  2246. }
  2247. func sozTypes(x uint64) (n int) {
  2248. return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  2249. }
  2250. func (m *PartSetHeader) Unmarshal(dAtA []byte) error {
  2251. l := len(dAtA)
  2252. iNdEx := 0
  2253. for iNdEx < l {
  2254. preIndex := iNdEx
  2255. var wire uint64
  2256. for shift := uint(0); ; shift += 7 {
  2257. if shift >= 64 {
  2258. return ErrIntOverflowTypes
  2259. }
  2260. if iNdEx >= l {
  2261. return io.ErrUnexpectedEOF
  2262. }
  2263. b := dAtA[iNdEx]
  2264. iNdEx++
  2265. wire |= uint64(b&0x7F) << shift
  2266. if b < 0x80 {
  2267. break
  2268. }
  2269. }
  2270. fieldNum := int32(wire >> 3)
  2271. wireType := int(wire & 0x7)
  2272. if wireType == 4 {
  2273. return fmt.Errorf("proto: PartSetHeader: wiretype end group for non-group")
  2274. }
  2275. if fieldNum <= 0 {
  2276. return fmt.Errorf("proto: PartSetHeader: illegal tag %d (wire type %d)", fieldNum, wire)
  2277. }
  2278. switch fieldNum {
  2279. case 1:
  2280. if wireType != 0 {
  2281. return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
  2282. }
  2283. m.Total = 0
  2284. for shift := uint(0); ; shift += 7 {
  2285. if shift >= 64 {
  2286. return ErrIntOverflowTypes
  2287. }
  2288. if iNdEx >= l {
  2289. return io.ErrUnexpectedEOF
  2290. }
  2291. b := dAtA[iNdEx]
  2292. iNdEx++
  2293. m.Total |= uint32(b&0x7F) << shift
  2294. if b < 0x80 {
  2295. break
  2296. }
  2297. }
  2298. case 2:
  2299. if wireType != 2 {
  2300. return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType)
  2301. }
  2302. var byteLen int
  2303. for shift := uint(0); ; shift += 7 {
  2304. if shift >= 64 {
  2305. return ErrIntOverflowTypes
  2306. }
  2307. if iNdEx >= l {
  2308. return io.ErrUnexpectedEOF
  2309. }
  2310. b := dAtA[iNdEx]
  2311. iNdEx++
  2312. byteLen |= int(b&0x7F) << shift
  2313. if b < 0x80 {
  2314. break
  2315. }
  2316. }
  2317. if byteLen < 0 {
  2318. return ErrInvalidLengthTypes
  2319. }
  2320. postIndex := iNdEx + byteLen
  2321. if postIndex < 0 {
  2322. return ErrInvalidLengthTypes
  2323. }
  2324. if postIndex > l {
  2325. return io.ErrUnexpectedEOF
  2326. }
  2327. m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...)
  2328. if m.Hash == nil {
  2329. m.Hash = []byte{}
  2330. }
  2331. iNdEx = postIndex
  2332. default:
  2333. iNdEx = preIndex
  2334. skippy, err := skipTypes(dAtA[iNdEx:])
  2335. if err != nil {
  2336. return err
  2337. }
  2338. if (skippy < 0) || (iNdEx+skippy) < 0 {
  2339. return ErrInvalidLengthTypes
  2340. }
  2341. if (iNdEx + skippy) > l {
  2342. return io.ErrUnexpectedEOF
  2343. }
  2344. iNdEx += skippy
  2345. }
  2346. }
  2347. if iNdEx > l {
  2348. return io.ErrUnexpectedEOF
  2349. }
  2350. return nil
  2351. }
  2352. func (m *Part) Unmarshal(dAtA []byte) error {
  2353. l := len(dAtA)
  2354. iNdEx := 0
  2355. for iNdEx < l {
  2356. preIndex := iNdEx
  2357. var wire uint64
  2358. for shift := uint(0); ; shift += 7 {
  2359. if shift >= 64 {
  2360. return ErrIntOverflowTypes
  2361. }
  2362. if iNdEx >= l {
  2363. return io.ErrUnexpectedEOF
  2364. }
  2365. b := dAtA[iNdEx]
  2366. iNdEx++
  2367. wire |= uint64(b&0x7F) << shift
  2368. if b < 0x80 {
  2369. break
  2370. }
  2371. }
  2372. fieldNum := int32(wire >> 3)
  2373. wireType := int(wire & 0x7)
  2374. if wireType == 4 {
  2375. return fmt.Errorf("proto: Part: wiretype end group for non-group")
  2376. }
  2377. if fieldNum <= 0 {
  2378. return fmt.Errorf("proto: Part: illegal tag %d (wire type %d)", fieldNum, wire)
  2379. }
  2380. switch fieldNum {
  2381. case 1:
  2382. if wireType != 0 {
  2383. return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  2384. }
  2385. m.Index = 0
  2386. for shift := uint(0); ; shift += 7 {
  2387. if shift >= 64 {
  2388. return ErrIntOverflowTypes
  2389. }
  2390. if iNdEx >= l {
  2391. return io.ErrUnexpectedEOF
  2392. }
  2393. b := dAtA[iNdEx]
  2394. iNdEx++
  2395. m.Index |= uint32(b&0x7F) << shift
  2396. if b < 0x80 {
  2397. break
  2398. }
  2399. }
  2400. case 2:
  2401. if wireType != 2 {
  2402. return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType)
  2403. }
  2404. var byteLen int
  2405. for shift := uint(0); ; shift += 7 {
  2406. if shift >= 64 {
  2407. return ErrIntOverflowTypes
  2408. }
  2409. if iNdEx >= l {
  2410. return io.ErrUnexpectedEOF
  2411. }
  2412. b := dAtA[iNdEx]
  2413. iNdEx++
  2414. byteLen |= int(b&0x7F) << shift
  2415. if b < 0x80 {
  2416. break
  2417. }
  2418. }
  2419. if byteLen < 0 {
  2420. return ErrInvalidLengthTypes
  2421. }
  2422. postIndex := iNdEx + byteLen
  2423. if postIndex < 0 {
  2424. return ErrInvalidLengthTypes
  2425. }
  2426. if postIndex > l {
  2427. return io.ErrUnexpectedEOF
  2428. }
  2429. m.Bytes = append(m.Bytes[:0], dAtA[iNdEx:postIndex]...)
  2430. if m.Bytes == nil {
  2431. m.Bytes = []byte{}
  2432. }
  2433. iNdEx = postIndex
  2434. case 3:
  2435. if wireType != 2 {
  2436. return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType)
  2437. }
  2438. var msglen int
  2439. for shift := uint(0); ; shift += 7 {
  2440. if shift >= 64 {
  2441. return ErrIntOverflowTypes
  2442. }
  2443. if iNdEx >= l {
  2444. return io.ErrUnexpectedEOF
  2445. }
  2446. b := dAtA[iNdEx]
  2447. iNdEx++
  2448. msglen |= int(b&0x7F) << shift
  2449. if b < 0x80 {
  2450. break
  2451. }
  2452. }
  2453. if msglen < 0 {
  2454. return ErrInvalidLengthTypes
  2455. }
  2456. postIndex := iNdEx + msglen
  2457. if postIndex < 0 {
  2458. return ErrInvalidLengthTypes
  2459. }
  2460. if postIndex > l {
  2461. return io.ErrUnexpectedEOF
  2462. }
  2463. if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2464. return err
  2465. }
  2466. iNdEx = postIndex
  2467. default:
  2468. iNdEx = preIndex
  2469. skippy, err := skipTypes(dAtA[iNdEx:])
  2470. if err != nil {
  2471. return err
  2472. }
  2473. if (skippy < 0) || (iNdEx+skippy) < 0 {
  2474. return ErrInvalidLengthTypes
  2475. }
  2476. if (iNdEx + skippy) > l {
  2477. return io.ErrUnexpectedEOF
  2478. }
  2479. iNdEx += skippy
  2480. }
  2481. }
  2482. if iNdEx > l {
  2483. return io.ErrUnexpectedEOF
  2484. }
  2485. return nil
  2486. }
  2487. func (m *BlockID) Unmarshal(dAtA []byte) error {
  2488. l := len(dAtA)
  2489. iNdEx := 0
  2490. for iNdEx < l {
  2491. preIndex := iNdEx
  2492. var wire uint64
  2493. for shift := uint(0); ; shift += 7 {
  2494. if shift >= 64 {
  2495. return ErrIntOverflowTypes
  2496. }
  2497. if iNdEx >= l {
  2498. return io.ErrUnexpectedEOF
  2499. }
  2500. b := dAtA[iNdEx]
  2501. iNdEx++
  2502. wire |= uint64(b&0x7F) << shift
  2503. if b < 0x80 {
  2504. break
  2505. }
  2506. }
  2507. fieldNum := int32(wire >> 3)
  2508. wireType := int(wire & 0x7)
  2509. if wireType == 4 {
  2510. return fmt.Errorf("proto: BlockID: wiretype end group for non-group")
  2511. }
  2512. if fieldNum <= 0 {
  2513. return fmt.Errorf("proto: BlockID: illegal tag %d (wire type %d)", fieldNum, wire)
  2514. }
  2515. switch fieldNum {
  2516. case 1:
  2517. if wireType != 2 {
  2518. return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType)
  2519. }
  2520. var byteLen int
  2521. for shift := uint(0); ; shift += 7 {
  2522. if shift >= 64 {
  2523. return ErrIntOverflowTypes
  2524. }
  2525. if iNdEx >= l {
  2526. return io.ErrUnexpectedEOF
  2527. }
  2528. b := dAtA[iNdEx]
  2529. iNdEx++
  2530. byteLen |= int(b&0x7F) << shift
  2531. if b < 0x80 {
  2532. break
  2533. }
  2534. }
  2535. if byteLen < 0 {
  2536. return ErrInvalidLengthTypes
  2537. }
  2538. postIndex := iNdEx + byteLen
  2539. if postIndex < 0 {
  2540. return ErrInvalidLengthTypes
  2541. }
  2542. if postIndex > l {
  2543. return io.ErrUnexpectedEOF
  2544. }
  2545. m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...)
  2546. if m.Hash == nil {
  2547. m.Hash = []byte{}
  2548. }
  2549. iNdEx = postIndex
  2550. case 2:
  2551. if wireType != 2 {
  2552. return fmt.Errorf("proto: wrong wireType = %d for field PartSetHeader", wireType)
  2553. }
  2554. var msglen int
  2555. for shift := uint(0); ; shift += 7 {
  2556. if shift >= 64 {
  2557. return ErrIntOverflowTypes
  2558. }
  2559. if iNdEx >= l {
  2560. return io.ErrUnexpectedEOF
  2561. }
  2562. b := dAtA[iNdEx]
  2563. iNdEx++
  2564. msglen |= int(b&0x7F) << shift
  2565. if b < 0x80 {
  2566. break
  2567. }
  2568. }
  2569. if msglen < 0 {
  2570. return ErrInvalidLengthTypes
  2571. }
  2572. postIndex := iNdEx + msglen
  2573. if postIndex < 0 {
  2574. return ErrInvalidLengthTypes
  2575. }
  2576. if postIndex > l {
  2577. return io.ErrUnexpectedEOF
  2578. }
  2579. if err := m.PartSetHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2580. return err
  2581. }
  2582. iNdEx = postIndex
  2583. default:
  2584. iNdEx = preIndex
  2585. skippy, err := skipTypes(dAtA[iNdEx:])
  2586. if err != nil {
  2587. return err
  2588. }
  2589. if (skippy < 0) || (iNdEx+skippy) < 0 {
  2590. return ErrInvalidLengthTypes
  2591. }
  2592. if (iNdEx + skippy) > l {
  2593. return io.ErrUnexpectedEOF
  2594. }
  2595. iNdEx += skippy
  2596. }
  2597. }
  2598. if iNdEx > l {
  2599. return io.ErrUnexpectedEOF
  2600. }
  2601. return nil
  2602. }
  2603. func (m *Header) Unmarshal(dAtA []byte) error {
  2604. l := len(dAtA)
  2605. iNdEx := 0
  2606. for iNdEx < l {
  2607. preIndex := iNdEx
  2608. var wire uint64
  2609. for shift := uint(0); ; shift += 7 {
  2610. if shift >= 64 {
  2611. return ErrIntOverflowTypes
  2612. }
  2613. if iNdEx >= l {
  2614. return io.ErrUnexpectedEOF
  2615. }
  2616. b := dAtA[iNdEx]
  2617. iNdEx++
  2618. wire |= uint64(b&0x7F) << shift
  2619. if b < 0x80 {
  2620. break
  2621. }
  2622. }
  2623. fieldNum := int32(wire >> 3)
  2624. wireType := int(wire & 0x7)
  2625. if wireType == 4 {
  2626. return fmt.Errorf("proto: Header: wiretype end group for non-group")
  2627. }
  2628. if fieldNum <= 0 {
  2629. return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire)
  2630. }
  2631. switch fieldNum {
  2632. case 1:
  2633. if wireType != 2 {
  2634. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  2635. }
  2636. var msglen int
  2637. for shift := uint(0); ; shift += 7 {
  2638. if shift >= 64 {
  2639. return ErrIntOverflowTypes
  2640. }
  2641. if iNdEx >= l {
  2642. return io.ErrUnexpectedEOF
  2643. }
  2644. b := dAtA[iNdEx]
  2645. iNdEx++
  2646. msglen |= int(b&0x7F) << shift
  2647. if b < 0x80 {
  2648. break
  2649. }
  2650. }
  2651. if msglen < 0 {
  2652. return ErrInvalidLengthTypes
  2653. }
  2654. postIndex := iNdEx + msglen
  2655. if postIndex < 0 {
  2656. return ErrInvalidLengthTypes
  2657. }
  2658. if postIndex > l {
  2659. return io.ErrUnexpectedEOF
  2660. }
  2661. if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2662. return err
  2663. }
  2664. iNdEx = postIndex
  2665. case 2:
  2666. if wireType != 2 {
  2667. return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType)
  2668. }
  2669. var stringLen uint64
  2670. for shift := uint(0); ; shift += 7 {
  2671. if shift >= 64 {
  2672. return ErrIntOverflowTypes
  2673. }
  2674. if iNdEx >= l {
  2675. return io.ErrUnexpectedEOF
  2676. }
  2677. b := dAtA[iNdEx]
  2678. iNdEx++
  2679. stringLen |= uint64(b&0x7F) << shift
  2680. if b < 0x80 {
  2681. break
  2682. }
  2683. }
  2684. intStringLen := int(stringLen)
  2685. if intStringLen < 0 {
  2686. return ErrInvalidLengthTypes
  2687. }
  2688. postIndex := iNdEx + intStringLen
  2689. if postIndex < 0 {
  2690. return ErrInvalidLengthTypes
  2691. }
  2692. if postIndex > l {
  2693. return io.ErrUnexpectedEOF
  2694. }
  2695. m.ChainID = string(dAtA[iNdEx:postIndex])
  2696. iNdEx = postIndex
  2697. case 3:
  2698. if wireType != 0 {
  2699. return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
  2700. }
  2701. m.Height = 0
  2702. for shift := uint(0); ; shift += 7 {
  2703. if shift >= 64 {
  2704. return ErrIntOverflowTypes
  2705. }
  2706. if iNdEx >= l {
  2707. return io.ErrUnexpectedEOF
  2708. }
  2709. b := dAtA[iNdEx]
  2710. iNdEx++
  2711. m.Height |= int64(b&0x7F) << shift
  2712. if b < 0x80 {
  2713. break
  2714. }
  2715. }
  2716. case 4:
  2717. if wireType != 2 {
  2718. return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
  2719. }
  2720. var msglen int
  2721. for shift := uint(0); ; shift += 7 {
  2722. if shift >= 64 {
  2723. return ErrIntOverflowTypes
  2724. }
  2725. if iNdEx >= l {
  2726. return io.ErrUnexpectedEOF
  2727. }
  2728. b := dAtA[iNdEx]
  2729. iNdEx++
  2730. msglen |= int(b&0x7F) << shift
  2731. if b < 0x80 {
  2732. break
  2733. }
  2734. }
  2735. if msglen < 0 {
  2736. return ErrInvalidLengthTypes
  2737. }
  2738. postIndex := iNdEx + msglen
  2739. if postIndex < 0 {
  2740. return ErrInvalidLengthTypes
  2741. }
  2742. if postIndex > l {
  2743. return io.ErrUnexpectedEOF
  2744. }
  2745. if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil {
  2746. return err
  2747. }
  2748. iNdEx = postIndex
  2749. case 5:
  2750. if wireType != 2 {
  2751. return fmt.Errorf("proto: wrong wireType = %d for field LastBlockId", wireType)
  2752. }
  2753. var msglen int
  2754. for shift := uint(0); ; shift += 7 {
  2755. if shift >= 64 {
  2756. return ErrIntOverflowTypes
  2757. }
  2758. if iNdEx >= l {
  2759. return io.ErrUnexpectedEOF
  2760. }
  2761. b := dAtA[iNdEx]
  2762. iNdEx++
  2763. msglen |= int(b&0x7F) << shift
  2764. if b < 0x80 {
  2765. break
  2766. }
  2767. }
  2768. if msglen < 0 {
  2769. return ErrInvalidLengthTypes
  2770. }
  2771. postIndex := iNdEx + msglen
  2772. if postIndex < 0 {
  2773. return ErrInvalidLengthTypes
  2774. }
  2775. if postIndex > l {
  2776. return io.ErrUnexpectedEOF
  2777. }
  2778. if err := m.LastBlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2779. return err
  2780. }
  2781. iNdEx = postIndex
  2782. case 6:
  2783. if wireType != 2 {
  2784. return fmt.Errorf("proto: wrong wireType = %d for field LastCommitHash", wireType)
  2785. }
  2786. var byteLen int
  2787. for shift := uint(0); ; shift += 7 {
  2788. if shift >= 64 {
  2789. return ErrIntOverflowTypes
  2790. }
  2791. if iNdEx >= l {
  2792. return io.ErrUnexpectedEOF
  2793. }
  2794. b := dAtA[iNdEx]
  2795. iNdEx++
  2796. byteLen |= int(b&0x7F) << shift
  2797. if b < 0x80 {
  2798. break
  2799. }
  2800. }
  2801. if byteLen < 0 {
  2802. return ErrInvalidLengthTypes
  2803. }
  2804. postIndex := iNdEx + byteLen
  2805. if postIndex < 0 {
  2806. return ErrInvalidLengthTypes
  2807. }
  2808. if postIndex > l {
  2809. return io.ErrUnexpectedEOF
  2810. }
  2811. m.LastCommitHash = append(m.LastCommitHash[:0], dAtA[iNdEx:postIndex]...)
  2812. if m.LastCommitHash == nil {
  2813. m.LastCommitHash = []byte{}
  2814. }
  2815. iNdEx = postIndex
  2816. case 7:
  2817. if wireType != 2 {
  2818. return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType)
  2819. }
  2820. var byteLen int
  2821. for shift := uint(0); ; shift += 7 {
  2822. if shift >= 64 {
  2823. return ErrIntOverflowTypes
  2824. }
  2825. if iNdEx >= l {
  2826. return io.ErrUnexpectedEOF
  2827. }
  2828. b := dAtA[iNdEx]
  2829. iNdEx++
  2830. byteLen |= int(b&0x7F) << shift
  2831. if b < 0x80 {
  2832. break
  2833. }
  2834. }
  2835. if byteLen < 0 {
  2836. return ErrInvalidLengthTypes
  2837. }
  2838. postIndex := iNdEx + byteLen
  2839. if postIndex < 0 {
  2840. return ErrInvalidLengthTypes
  2841. }
  2842. if postIndex > l {
  2843. return io.ErrUnexpectedEOF
  2844. }
  2845. m.DataHash = append(m.DataHash[:0], dAtA[iNdEx:postIndex]...)
  2846. if m.DataHash == nil {
  2847. m.DataHash = []byte{}
  2848. }
  2849. iNdEx = postIndex
  2850. case 8:
  2851. if wireType != 2 {
  2852. return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType)
  2853. }
  2854. var byteLen int
  2855. for shift := uint(0); ; shift += 7 {
  2856. if shift >= 64 {
  2857. return ErrIntOverflowTypes
  2858. }
  2859. if iNdEx >= l {
  2860. return io.ErrUnexpectedEOF
  2861. }
  2862. b := dAtA[iNdEx]
  2863. iNdEx++
  2864. byteLen |= int(b&0x7F) << shift
  2865. if b < 0x80 {
  2866. break
  2867. }
  2868. }
  2869. if byteLen < 0 {
  2870. return ErrInvalidLengthTypes
  2871. }
  2872. postIndex := iNdEx + byteLen
  2873. if postIndex < 0 {
  2874. return ErrInvalidLengthTypes
  2875. }
  2876. if postIndex > l {
  2877. return io.ErrUnexpectedEOF
  2878. }
  2879. m.ValidatorsHash = append(m.ValidatorsHash[:0], dAtA[iNdEx:postIndex]...)
  2880. if m.ValidatorsHash == nil {
  2881. m.ValidatorsHash = []byte{}
  2882. }
  2883. iNdEx = postIndex
  2884. case 9:
  2885. if wireType != 2 {
  2886. return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType)
  2887. }
  2888. var byteLen int
  2889. for shift := uint(0); ; shift += 7 {
  2890. if shift >= 64 {
  2891. return ErrIntOverflowTypes
  2892. }
  2893. if iNdEx >= l {
  2894. return io.ErrUnexpectedEOF
  2895. }
  2896. b := dAtA[iNdEx]
  2897. iNdEx++
  2898. byteLen |= int(b&0x7F) << shift
  2899. if b < 0x80 {
  2900. break
  2901. }
  2902. }
  2903. if byteLen < 0 {
  2904. return ErrInvalidLengthTypes
  2905. }
  2906. postIndex := iNdEx + byteLen
  2907. if postIndex < 0 {
  2908. return ErrInvalidLengthTypes
  2909. }
  2910. if postIndex > l {
  2911. return io.ErrUnexpectedEOF
  2912. }
  2913. m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...)
  2914. if m.NextValidatorsHash == nil {
  2915. m.NextValidatorsHash = []byte{}
  2916. }
  2917. iNdEx = postIndex
  2918. case 10:
  2919. if wireType != 2 {
  2920. return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType)
  2921. }
  2922. var byteLen int
  2923. for shift := uint(0); ; shift += 7 {
  2924. if shift >= 64 {
  2925. return ErrIntOverflowTypes
  2926. }
  2927. if iNdEx >= l {
  2928. return io.ErrUnexpectedEOF
  2929. }
  2930. b := dAtA[iNdEx]
  2931. iNdEx++
  2932. byteLen |= int(b&0x7F) << shift
  2933. if b < 0x80 {
  2934. break
  2935. }
  2936. }
  2937. if byteLen < 0 {
  2938. return ErrInvalidLengthTypes
  2939. }
  2940. postIndex := iNdEx + byteLen
  2941. if postIndex < 0 {
  2942. return ErrInvalidLengthTypes
  2943. }
  2944. if postIndex > l {
  2945. return io.ErrUnexpectedEOF
  2946. }
  2947. m.ConsensusHash = append(m.ConsensusHash[:0], dAtA[iNdEx:postIndex]...)
  2948. if m.ConsensusHash == nil {
  2949. m.ConsensusHash = []byte{}
  2950. }
  2951. iNdEx = postIndex
  2952. case 11:
  2953. if wireType != 2 {
  2954. return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType)
  2955. }
  2956. var byteLen int
  2957. for shift := uint(0); ; shift += 7 {
  2958. if shift >= 64 {
  2959. return ErrIntOverflowTypes
  2960. }
  2961. if iNdEx >= l {
  2962. return io.ErrUnexpectedEOF
  2963. }
  2964. b := dAtA[iNdEx]
  2965. iNdEx++
  2966. byteLen |= int(b&0x7F) << shift
  2967. if b < 0x80 {
  2968. break
  2969. }
  2970. }
  2971. if byteLen < 0 {
  2972. return ErrInvalidLengthTypes
  2973. }
  2974. postIndex := iNdEx + byteLen
  2975. if postIndex < 0 {
  2976. return ErrInvalidLengthTypes
  2977. }
  2978. if postIndex > l {
  2979. return io.ErrUnexpectedEOF
  2980. }
  2981. m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...)
  2982. if m.AppHash == nil {
  2983. m.AppHash = []byte{}
  2984. }
  2985. iNdEx = postIndex
  2986. case 12:
  2987. if wireType != 2 {
  2988. return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType)
  2989. }
  2990. var byteLen int
  2991. for shift := uint(0); ; shift += 7 {
  2992. if shift >= 64 {
  2993. return ErrIntOverflowTypes
  2994. }
  2995. if iNdEx >= l {
  2996. return io.ErrUnexpectedEOF
  2997. }
  2998. b := dAtA[iNdEx]
  2999. iNdEx++
  3000. byteLen |= int(b&0x7F) << shift
  3001. if b < 0x80 {
  3002. break
  3003. }
  3004. }
  3005. if byteLen < 0 {
  3006. return ErrInvalidLengthTypes
  3007. }
  3008. postIndex := iNdEx + byteLen
  3009. if postIndex < 0 {
  3010. return ErrInvalidLengthTypes
  3011. }
  3012. if postIndex > l {
  3013. return io.ErrUnexpectedEOF
  3014. }
  3015. m.LastResultsHash = append(m.LastResultsHash[:0], dAtA[iNdEx:postIndex]...)
  3016. if m.LastResultsHash == nil {
  3017. m.LastResultsHash = []byte{}
  3018. }
  3019. iNdEx = postIndex
  3020. case 13:
  3021. if wireType != 2 {
  3022. return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType)
  3023. }
  3024. var byteLen int
  3025. for shift := uint(0); ; shift += 7 {
  3026. if shift >= 64 {
  3027. return ErrIntOverflowTypes
  3028. }
  3029. if iNdEx >= l {
  3030. return io.ErrUnexpectedEOF
  3031. }
  3032. b := dAtA[iNdEx]
  3033. iNdEx++
  3034. byteLen |= int(b&0x7F) << shift
  3035. if b < 0x80 {
  3036. break
  3037. }
  3038. }
  3039. if byteLen < 0 {
  3040. return ErrInvalidLengthTypes
  3041. }
  3042. postIndex := iNdEx + byteLen
  3043. if postIndex < 0 {
  3044. return ErrInvalidLengthTypes
  3045. }
  3046. if postIndex > l {
  3047. return io.ErrUnexpectedEOF
  3048. }
  3049. m.EvidenceHash = append(m.EvidenceHash[:0], dAtA[iNdEx:postIndex]...)
  3050. if m.EvidenceHash == nil {
  3051. m.EvidenceHash = []byte{}
  3052. }
  3053. iNdEx = postIndex
  3054. case 14:
  3055. if wireType != 2 {
  3056. return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType)
  3057. }
  3058. var byteLen int
  3059. for shift := uint(0); ; shift += 7 {
  3060. if shift >= 64 {
  3061. return ErrIntOverflowTypes
  3062. }
  3063. if iNdEx >= l {
  3064. return io.ErrUnexpectedEOF
  3065. }
  3066. b := dAtA[iNdEx]
  3067. iNdEx++
  3068. byteLen |= int(b&0x7F) << shift
  3069. if b < 0x80 {
  3070. break
  3071. }
  3072. }
  3073. if byteLen < 0 {
  3074. return ErrInvalidLengthTypes
  3075. }
  3076. postIndex := iNdEx + byteLen
  3077. if postIndex < 0 {
  3078. return ErrInvalidLengthTypes
  3079. }
  3080. if postIndex > l {
  3081. return io.ErrUnexpectedEOF
  3082. }
  3083. m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...)
  3084. if m.ProposerAddress == nil {
  3085. m.ProposerAddress = []byte{}
  3086. }
  3087. iNdEx = postIndex
  3088. default:
  3089. iNdEx = preIndex
  3090. skippy, err := skipTypes(dAtA[iNdEx:])
  3091. if err != nil {
  3092. return err
  3093. }
  3094. if (skippy < 0) || (iNdEx+skippy) < 0 {
  3095. return ErrInvalidLengthTypes
  3096. }
  3097. if (iNdEx + skippy) > l {
  3098. return io.ErrUnexpectedEOF
  3099. }
  3100. iNdEx += skippy
  3101. }
  3102. }
  3103. if iNdEx > l {
  3104. return io.ErrUnexpectedEOF
  3105. }
  3106. return nil
  3107. }
  3108. func (m *Data) Unmarshal(dAtA []byte) error {
  3109. l := len(dAtA)
  3110. iNdEx := 0
  3111. for iNdEx < l {
  3112. preIndex := iNdEx
  3113. var wire uint64
  3114. for shift := uint(0); ; shift += 7 {
  3115. if shift >= 64 {
  3116. return ErrIntOverflowTypes
  3117. }
  3118. if iNdEx >= l {
  3119. return io.ErrUnexpectedEOF
  3120. }
  3121. b := dAtA[iNdEx]
  3122. iNdEx++
  3123. wire |= uint64(b&0x7F) << shift
  3124. if b < 0x80 {
  3125. break
  3126. }
  3127. }
  3128. fieldNum := int32(wire >> 3)
  3129. wireType := int(wire & 0x7)
  3130. if wireType == 4 {
  3131. return fmt.Errorf("proto: Data: wiretype end group for non-group")
  3132. }
  3133. if fieldNum <= 0 {
  3134. return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire)
  3135. }
  3136. switch fieldNum {
  3137. case 1:
  3138. if wireType != 2 {
  3139. return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType)
  3140. }
  3141. var byteLen int
  3142. for shift := uint(0); ; shift += 7 {
  3143. if shift >= 64 {
  3144. return ErrIntOverflowTypes
  3145. }
  3146. if iNdEx >= l {
  3147. return io.ErrUnexpectedEOF
  3148. }
  3149. b := dAtA[iNdEx]
  3150. iNdEx++
  3151. byteLen |= int(b&0x7F) << shift
  3152. if b < 0x80 {
  3153. break
  3154. }
  3155. }
  3156. if byteLen < 0 {
  3157. return ErrInvalidLengthTypes
  3158. }
  3159. postIndex := iNdEx + byteLen
  3160. if postIndex < 0 {
  3161. return ErrInvalidLengthTypes
  3162. }
  3163. if postIndex > l {
  3164. return io.ErrUnexpectedEOF
  3165. }
  3166. m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx))
  3167. copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex])
  3168. iNdEx = postIndex
  3169. default:
  3170. iNdEx = preIndex
  3171. skippy, err := skipTypes(dAtA[iNdEx:])
  3172. if err != nil {
  3173. return err
  3174. }
  3175. if (skippy < 0) || (iNdEx+skippy) < 0 {
  3176. return ErrInvalidLengthTypes
  3177. }
  3178. if (iNdEx + skippy) > l {
  3179. return io.ErrUnexpectedEOF
  3180. }
  3181. iNdEx += skippy
  3182. }
  3183. }
  3184. if iNdEx > l {
  3185. return io.ErrUnexpectedEOF
  3186. }
  3187. return nil
  3188. }
  3189. func (m *Vote) Unmarshal(dAtA []byte) error {
  3190. l := len(dAtA)
  3191. iNdEx := 0
  3192. for iNdEx < l {
  3193. preIndex := iNdEx
  3194. var wire uint64
  3195. for shift := uint(0); ; shift += 7 {
  3196. if shift >= 64 {
  3197. return ErrIntOverflowTypes
  3198. }
  3199. if iNdEx >= l {
  3200. return io.ErrUnexpectedEOF
  3201. }
  3202. b := dAtA[iNdEx]
  3203. iNdEx++
  3204. wire |= uint64(b&0x7F) << shift
  3205. if b < 0x80 {
  3206. break
  3207. }
  3208. }
  3209. fieldNum := int32(wire >> 3)
  3210. wireType := int(wire & 0x7)
  3211. if wireType == 4 {
  3212. return fmt.Errorf("proto: Vote: wiretype end group for non-group")
  3213. }
  3214. if fieldNum <= 0 {
  3215. return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire)
  3216. }
  3217. switch fieldNum {
  3218. case 1:
  3219. if wireType != 0 {
  3220. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  3221. }
  3222. m.Type = 0
  3223. for shift := uint(0); ; shift += 7 {
  3224. if shift >= 64 {
  3225. return ErrIntOverflowTypes
  3226. }
  3227. if iNdEx >= l {
  3228. return io.ErrUnexpectedEOF
  3229. }
  3230. b := dAtA[iNdEx]
  3231. iNdEx++
  3232. m.Type |= SignedMsgType(b&0x7F) << shift
  3233. if b < 0x80 {
  3234. break
  3235. }
  3236. }
  3237. case 2:
  3238. if wireType != 0 {
  3239. return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
  3240. }
  3241. m.Height = 0
  3242. for shift := uint(0); ; shift += 7 {
  3243. if shift >= 64 {
  3244. return ErrIntOverflowTypes
  3245. }
  3246. if iNdEx >= l {
  3247. return io.ErrUnexpectedEOF
  3248. }
  3249. b := dAtA[iNdEx]
  3250. iNdEx++
  3251. m.Height |= int64(b&0x7F) << shift
  3252. if b < 0x80 {
  3253. break
  3254. }
  3255. }
  3256. case 3:
  3257. if wireType != 0 {
  3258. return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType)
  3259. }
  3260. m.Round = 0
  3261. for shift := uint(0); ; shift += 7 {
  3262. if shift >= 64 {
  3263. return ErrIntOverflowTypes
  3264. }
  3265. if iNdEx >= l {
  3266. return io.ErrUnexpectedEOF
  3267. }
  3268. b := dAtA[iNdEx]
  3269. iNdEx++
  3270. m.Round |= int32(b&0x7F) << shift
  3271. if b < 0x80 {
  3272. break
  3273. }
  3274. }
  3275. case 4:
  3276. if wireType != 2 {
  3277. return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType)
  3278. }
  3279. var msglen int
  3280. for shift := uint(0); ; shift += 7 {
  3281. if shift >= 64 {
  3282. return ErrIntOverflowTypes
  3283. }
  3284. if iNdEx >= l {
  3285. return io.ErrUnexpectedEOF
  3286. }
  3287. b := dAtA[iNdEx]
  3288. iNdEx++
  3289. msglen |= int(b&0x7F) << shift
  3290. if b < 0x80 {
  3291. break
  3292. }
  3293. }
  3294. if msglen < 0 {
  3295. return ErrInvalidLengthTypes
  3296. }
  3297. postIndex := iNdEx + msglen
  3298. if postIndex < 0 {
  3299. return ErrInvalidLengthTypes
  3300. }
  3301. if postIndex > l {
  3302. return io.ErrUnexpectedEOF
  3303. }
  3304. if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3305. return err
  3306. }
  3307. iNdEx = postIndex
  3308. case 5:
  3309. if wireType != 2 {
  3310. return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
  3311. }
  3312. var msglen int
  3313. for shift := uint(0); ; shift += 7 {
  3314. if shift >= 64 {
  3315. return ErrIntOverflowTypes
  3316. }
  3317. if iNdEx >= l {
  3318. return io.ErrUnexpectedEOF
  3319. }
  3320. b := dAtA[iNdEx]
  3321. iNdEx++
  3322. msglen |= int(b&0x7F) << shift
  3323. if b < 0x80 {
  3324. break
  3325. }
  3326. }
  3327. if msglen < 0 {
  3328. return ErrInvalidLengthTypes
  3329. }
  3330. postIndex := iNdEx + msglen
  3331. if postIndex < 0 {
  3332. return ErrInvalidLengthTypes
  3333. }
  3334. if postIndex > l {
  3335. return io.ErrUnexpectedEOF
  3336. }
  3337. if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
  3338. return err
  3339. }
  3340. iNdEx = postIndex
  3341. case 6:
  3342. if wireType != 2 {
  3343. return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType)
  3344. }
  3345. var byteLen int
  3346. for shift := uint(0); ; shift += 7 {
  3347. if shift >= 64 {
  3348. return ErrIntOverflowTypes
  3349. }
  3350. if iNdEx >= l {
  3351. return io.ErrUnexpectedEOF
  3352. }
  3353. b := dAtA[iNdEx]
  3354. iNdEx++
  3355. byteLen |= int(b&0x7F) << shift
  3356. if b < 0x80 {
  3357. break
  3358. }
  3359. }
  3360. if byteLen < 0 {
  3361. return ErrInvalidLengthTypes
  3362. }
  3363. postIndex := iNdEx + byteLen
  3364. if postIndex < 0 {
  3365. return ErrInvalidLengthTypes
  3366. }
  3367. if postIndex > l {
  3368. return io.ErrUnexpectedEOF
  3369. }
  3370. m.ValidatorAddress = append(m.ValidatorAddress[:0], dAtA[iNdEx:postIndex]...)
  3371. if m.ValidatorAddress == nil {
  3372. m.ValidatorAddress = []byte{}
  3373. }
  3374. iNdEx = postIndex
  3375. case 7:
  3376. if wireType != 0 {
  3377. return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIndex", wireType)
  3378. }
  3379. m.ValidatorIndex = 0
  3380. for shift := uint(0); ; shift += 7 {
  3381. if shift >= 64 {
  3382. return ErrIntOverflowTypes
  3383. }
  3384. if iNdEx >= l {
  3385. return io.ErrUnexpectedEOF
  3386. }
  3387. b := dAtA[iNdEx]
  3388. iNdEx++
  3389. m.ValidatorIndex |= int32(b&0x7F) << shift
  3390. if b < 0x80 {
  3391. break
  3392. }
  3393. }
  3394. case 8:
  3395. if wireType != 2 {
  3396. return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType)
  3397. }
  3398. var byteLen int
  3399. for shift := uint(0); ; shift += 7 {
  3400. if shift >= 64 {
  3401. return ErrIntOverflowTypes
  3402. }
  3403. if iNdEx >= l {
  3404. return io.ErrUnexpectedEOF
  3405. }
  3406. b := dAtA[iNdEx]
  3407. iNdEx++
  3408. byteLen |= int(b&0x7F) << shift
  3409. if b < 0x80 {
  3410. break
  3411. }
  3412. }
  3413. if byteLen < 0 {
  3414. return ErrInvalidLengthTypes
  3415. }
  3416. postIndex := iNdEx + byteLen
  3417. if postIndex < 0 {
  3418. return ErrInvalidLengthTypes
  3419. }
  3420. if postIndex > l {
  3421. return io.ErrUnexpectedEOF
  3422. }
  3423. m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...)
  3424. if m.Signature == nil {
  3425. m.Signature = []byte{}
  3426. }
  3427. iNdEx = postIndex
  3428. case 9:
  3429. if wireType != 2 {
  3430. return fmt.Errorf("proto: wrong wireType = %d for field VoteExtension", wireType)
  3431. }
  3432. var msglen int
  3433. for shift := uint(0); ; shift += 7 {
  3434. if shift >= 64 {
  3435. return ErrIntOverflowTypes
  3436. }
  3437. if iNdEx >= l {
  3438. return io.ErrUnexpectedEOF
  3439. }
  3440. b := dAtA[iNdEx]
  3441. iNdEx++
  3442. msglen |= int(b&0x7F) << shift
  3443. if b < 0x80 {
  3444. break
  3445. }
  3446. }
  3447. if msglen < 0 {
  3448. return ErrInvalidLengthTypes
  3449. }
  3450. postIndex := iNdEx + msglen
  3451. if postIndex < 0 {
  3452. return ErrInvalidLengthTypes
  3453. }
  3454. if postIndex > l {
  3455. return io.ErrUnexpectedEOF
  3456. }
  3457. if m.VoteExtension == nil {
  3458. m.VoteExtension = &VoteExtension{}
  3459. }
  3460. if err := m.VoteExtension.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3461. return err
  3462. }
  3463. iNdEx = postIndex
  3464. default:
  3465. iNdEx = preIndex
  3466. skippy, err := skipTypes(dAtA[iNdEx:])
  3467. if err != nil {
  3468. return err
  3469. }
  3470. if (skippy < 0) || (iNdEx+skippy) < 0 {
  3471. return ErrInvalidLengthTypes
  3472. }
  3473. if (iNdEx + skippy) > l {
  3474. return io.ErrUnexpectedEOF
  3475. }
  3476. iNdEx += skippy
  3477. }
  3478. }
  3479. if iNdEx > l {
  3480. return io.ErrUnexpectedEOF
  3481. }
  3482. return nil
  3483. }
  3484. func (m *VoteExtension) Unmarshal(dAtA []byte) error {
  3485. l := len(dAtA)
  3486. iNdEx := 0
  3487. for iNdEx < l {
  3488. preIndex := iNdEx
  3489. var wire uint64
  3490. for shift := uint(0); ; shift += 7 {
  3491. if shift >= 64 {
  3492. return ErrIntOverflowTypes
  3493. }
  3494. if iNdEx >= l {
  3495. return io.ErrUnexpectedEOF
  3496. }
  3497. b := dAtA[iNdEx]
  3498. iNdEx++
  3499. wire |= uint64(b&0x7F) << shift
  3500. if b < 0x80 {
  3501. break
  3502. }
  3503. }
  3504. fieldNum := int32(wire >> 3)
  3505. wireType := int(wire & 0x7)
  3506. if wireType == 4 {
  3507. return fmt.Errorf("proto: VoteExtension: wiretype end group for non-group")
  3508. }
  3509. if fieldNum <= 0 {
  3510. return fmt.Errorf("proto: VoteExtension: illegal tag %d (wire type %d)", fieldNum, wire)
  3511. }
  3512. switch fieldNum {
  3513. case 1:
  3514. if wireType != 2 {
  3515. return fmt.Errorf("proto: wrong wireType = %d for field AppDataToSign", wireType)
  3516. }
  3517. var byteLen int
  3518. for shift := uint(0); ; shift += 7 {
  3519. if shift >= 64 {
  3520. return ErrIntOverflowTypes
  3521. }
  3522. if iNdEx >= l {
  3523. return io.ErrUnexpectedEOF
  3524. }
  3525. b := dAtA[iNdEx]
  3526. iNdEx++
  3527. byteLen |= int(b&0x7F) << shift
  3528. if b < 0x80 {
  3529. break
  3530. }
  3531. }
  3532. if byteLen < 0 {
  3533. return ErrInvalidLengthTypes
  3534. }
  3535. postIndex := iNdEx + byteLen
  3536. if postIndex < 0 {
  3537. return ErrInvalidLengthTypes
  3538. }
  3539. if postIndex > l {
  3540. return io.ErrUnexpectedEOF
  3541. }
  3542. m.AppDataToSign = append(m.AppDataToSign[:0], dAtA[iNdEx:postIndex]...)
  3543. if m.AppDataToSign == nil {
  3544. m.AppDataToSign = []byte{}
  3545. }
  3546. iNdEx = postIndex
  3547. case 2:
  3548. if wireType != 2 {
  3549. return fmt.Errorf("proto: wrong wireType = %d for field AppDataSelfAuthenticating", wireType)
  3550. }
  3551. var byteLen int
  3552. for shift := uint(0); ; shift += 7 {
  3553. if shift >= 64 {
  3554. return ErrIntOverflowTypes
  3555. }
  3556. if iNdEx >= l {
  3557. return io.ErrUnexpectedEOF
  3558. }
  3559. b := dAtA[iNdEx]
  3560. iNdEx++
  3561. byteLen |= int(b&0x7F) << shift
  3562. if b < 0x80 {
  3563. break
  3564. }
  3565. }
  3566. if byteLen < 0 {
  3567. return ErrInvalidLengthTypes
  3568. }
  3569. postIndex := iNdEx + byteLen
  3570. if postIndex < 0 {
  3571. return ErrInvalidLengthTypes
  3572. }
  3573. if postIndex > l {
  3574. return io.ErrUnexpectedEOF
  3575. }
  3576. m.AppDataSelfAuthenticating = append(m.AppDataSelfAuthenticating[:0], dAtA[iNdEx:postIndex]...)
  3577. if m.AppDataSelfAuthenticating == nil {
  3578. m.AppDataSelfAuthenticating = []byte{}
  3579. }
  3580. iNdEx = postIndex
  3581. default:
  3582. iNdEx = preIndex
  3583. skippy, err := skipTypes(dAtA[iNdEx:])
  3584. if err != nil {
  3585. return err
  3586. }
  3587. if (skippy < 0) || (iNdEx+skippy) < 0 {
  3588. return ErrInvalidLengthTypes
  3589. }
  3590. if (iNdEx + skippy) > l {
  3591. return io.ErrUnexpectedEOF
  3592. }
  3593. iNdEx += skippy
  3594. }
  3595. }
  3596. if iNdEx > l {
  3597. return io.ErrUnexpectedEOF
  3598. }
  3599. return nil
  3600. }
  3601. func (m *VoteExtensionToSign) Unmarshal(dAtA []byte) error {
  3602. l := len(dAtA)
  3603. iNdEx := 0
  3604. for iNdEx < l {
  3605. preIndex := iNdEx
  3606. var wire uint64
  3607. for shift := uint(0); ; shift += 7 {
  3608. if shift >= 64 {
  3609. return ErrIntOverflowTypes
  3610. }
  3611. if iNdEx >= l {
  3612. return io.ErrUnexpectedEOF
  3613. }
  3614. b := dAtA[iNdEx]
  3615. iNdEx++
  3616. wire |= uint64(b&0x7F) << shift
  3617. if b < 0x80 {
  3618. break
  3619. }
  3620. }
  3621. fieldNum := int32(wire >> 3)
  3622. wireType := int(wire & 0x7)
  3623. if wireType == 4 {
  3624. return fmt.Errorf("proto: VoteExtensionToSign: wiretype end group for non-group")
  3625. }
  3626. if fieldNum <= 0 {
  3627. return fmt.Errorf("proto: VoteExtensionToSign: illegal tag %d (wire type %d)", fieldNum, wire)
  3628. }
  3629. switch fieldNum {
  3630. case 1:
  3631. if wireType != 2 {
  3632. return fmt.Errorf("proto: wrong wireType = %d for field AppDataToSign", wireType)
  3633. }
  3634. var byteLen int
  3635. for shift := uint(0); ; shift += 7 {
  3636. if shift >= 64 {
  3637. return ErrIntOverflowTypes
  3638. }
  3639. if iNdEx >= l {
  3640. return io.ErrUnexpectedEOF
  3641. }
  3642. b := dAtA[iNdEx]
  3643. iNdEx++
  3644. byteLen |= int(b&0x7F) << shift
  3645. if b < 0x80 {
  3646. break
  3647. }
  3648. }
  3649. if byteLen < 0 {
  3650. return ErrInvalidLengthTypes
  3651. }
  3652. postIndex := iNdEx + byteLen
  3653. if postIndex < 0 {
  3654. return ErrInvalidLengthTypes
  3655. }
  3656. if postIndex > l {
  3657. return io.ErrUnexpectedEOF
  3658. }
  3659. m.AppDataToSign = append(m.AppDataToSign[:0], dAtA[iNdEx:postIndex]...)
  3660. if m.AppDataToSign == nil {
  3661. m.AppDataToSign = []byte{}
  3662. }
  3663. iNdEx = postIndex
  3664. default:
  3665. iNdEx = preIndex
  3666. skippy, err := skipTypes(dAtA[iNdEx:])
  3667. if err != nil {
  3668. return err
  3669. }
  3670. if (skippy < 0) || (iNdEx+skippy) < 0 {
  3671. return ErrInvalidLengthTypes
  3672. }
  3673. if (iNdEx + skippy) > l {
  3674. return io.ErrUnexpectedEOF
  3675. }
  3676. iNdEx += skippy
  3677. }
  3678. }
  3679. if iNdEx > l {
  3680. return io.ErrUnexpectedEOF
  3681. }
  3682. return nil
  3683. }
  3684. func (m *Commit) Unmarshal(dAtA []byte) error {
  3685. l := len(dAtA)
  3686. iNdEx := 0
  3687. for iNdEx < l {
  3688. preIndex := iNdEx
  3689. var wire uint64
  3690. for shift := uint(0); ; shift += 7 {
  3691. if shift >= 64 {
  3692. return ErrIntOverflowTypes
  3693. }
  3694. if iNdEx >= l {
  3695. return io.ErrUnexpectedEOF
  3696. }
  3697. b := dAtA[iNdEx]
  3698. iNdEx++
  3699. wire |= uint64(b&0x7F) << shift
  3700. if b < 0x80 {
  3701. break
  3702. }
  3703. }
  3704. fieldNum := int32(wire >> 3)
  3705. wireType := int(wire & 0x7)
  3706. if wireType == 4 {
  3707. return fmt.Errorf("proto: Commit: wiretype end group for non-group")
  3708. }
  3709. if fieldNum <= 0 {
  3710. return fmt.Errorf("proto: Commit: illegal tag %d (wire type %d)", fieldNum, wire)
  3711. }
  3712. switch fieldNum {
  3713. case 1:
  3714. if wireType != 0 {
  3715. return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
  3716. }
  3717. m.Height = 0
  3718. for shift := uint(0); ; shift += 7 {
  3719. if shift >= 64 {
  3720. return ErrIntOverflowTypes
  3721. }
  3722. if iNdEx >= l {
  3723. return io.ErrUnexpectedEOF
  3724. }
  3725. b := dAtA[iNdEx]
  3726. iNdEx++
  3727. m.Height |= int64(b&0x7F) << shift
  3728. if b < 0x80 {
  3729. break
  3730. }
  3731. }
  3732. case 2:
  3733. if wireType != 0 {
  3734. return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType)
  3735. }
  3736. m.Round = 0
  3737. for shift := uint(0); ; shift += 7 {
  3738. if shift >= 64 {
  3739. return ErrIntOverflowTypes
  3740. }
  3741. if iNdEx >= l {
  3742. return io.ErrUnexpectedEOF
  3743. }
  3744. b := dAtA[iNdEx]
  3745. iNdEx++
  3746. m.Round |= int32(b&0x7F) << shift
  3747. if b < 0x80 {
  3748. break
  3749. }
  3750. }
  3751. case 3:
  3752. if wireType != 2 {
  3753. return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType)
  3754. }
  3755. var msglen int
  3756. for shift := uint(0); ; shift += 7 {
  3757. if shift >= 64 {
  3758. return ErrIntOverflowTypes
  3759. }
  3760. if iNdEx >= l {
  3761. return io.ErrUnexpectedEOF
  3762. }
  3763. b := dAtA[iNdEx]
  3764. iNdEx++
  3765. msglen |= int(b&0x7F) << shift
  3766. if b < 0x80 {
  3767. break
  3768. }
  3769. }
  3770. if msglen < 0 {
  3771. return ErrInvalidLengthTypes
  3772. }
  3773. postIndex := iNdEx + msglen
  3774. if postIndex < 0 {
  3775. return ErrInvalidLengthTypes
  3776. }
  3777. if postIndex > l {
  3778. return io.ErrUnexpectedEOF
  3779. }
  3780. if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3781. return err
  3782. }
  3783. iNdEx = postIndex
  3784. case 4:
  3785. if wireType != 2 {
  3786. return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType)
  3787. }
  3788. var msglen int
  3789. for shift := uint(0); ; shift += 7 {
  3790. if shift >= 64 {
  3791. return ErrIntOverflowTypes
  3792. }
  3793. if iNdEx >= l {
  3794. return io.ErrUnexpectedEOF
  3795. }
  3796. b := dAtA[iNdEx]
  3797. iNdEx++
  3798. msglen |= int(b&0x7F) << shift
  3799. if b < 0x80 {
  3800. break
  3801. }
  3802. }
  3803. if msglen < 0 {
  3804. return ErrInvalidLengthTypes
  3805. }
  3806. postIndex := iNdEx + msglen
  3807. if postIndex < 0 {
  3808. return ErrInvalidLengthTypes
  3809. }
  3810. if postIndex > l {
  3811. return io.ErrUnexpectedEOF
  3812. }
  3813. m.Signatures = append(m.Signatures, CommitSig{})
  3814. if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3815. return err
  3816. }
  3817. iNdEx = postIndex
  3818. default:
  3819. iNdEx = preIndex
  3820. skippy, err := skipTypes(dAtA[iNdEx:])
  3821. if err != nil {
  3822. return err
  3823. }
  3824. if (skippy < 0) || (iNdEx+skippy) < 0 {
  3825. return ErrInvalidLengthTypes
  3826. }
  3827. if (iNdEx + skippy) > l {
  3828. return io.ErrUnexpectedEOF
  3829. }
  3830. iNdEx += skippy
  3831. }
  3832. }
  3833. if iNdEx > l {
  3834. return io.ErrUnexpectedEOF
  3835. }
  3836. return nil
  3837. }
  3838. func (m *CommitSig) Unmarshal(dAtA []byte) error {
  3839. l := len(dAtA)
  3840. iNdEx := 0
  3841. for iNdEx < l {
  3842. preIndex := iNdEx
  3843. var wire uint64
  3844. for shift := uint(0); ; shift += 7 {
  3845. if shift >= 64 {
  3846. return ErrIntOverflowTypes
  3847. }
  3848. if iNdEx >= l {
  3849. return io.ErrUnexpectedEOF
  3850. }
  3851. b := dAtA[iNdEx]
  3852. iNdEx++
  3853. wire |= uint64(b&0x7F) << shift
  3854. if b < 0x80 {
  3855. break
  3856. }
  3857. }
  3858. fieldNum := int32(wire >> 3)
  3859. wireType := int(wire & 0x7)
  3860. if wireType == 4 {
  3861. return fmt.Errorf("proto: CommitSig: wiretype end group for non-group")
  3862. }
  3863. if fieldNum <= 0 {
  3864. return fmt.Errorf("proto: CommitSig: illegal tag %d (wire type %d)", fieldNum, wire)
  3865. }
  3866. switch fieldNum {
  3867. case 1:
  3868. if wireType != 0 {
  3869. return fmt.Errorf("proto: wrong wireType = %d for field BlockIdFlag", wireType)
  3870. }
  3871. m.BlockIdFlag = 0
  3872. for shift := uint(0); ; shift += 7 {
  3873. if shift >= 64 {
  3874. return ErrIntOverflowTypes
  3875. }
  3876. if iNdEx >= l {
  3877. return io.ErrUnexpectedEOF
  3878. }
  3879. b := dAtA[iNdEx]
  3880. iNdEx++
  3881. m.BlockIdFlag |= BlockIDFlag(b&0x7F) << shift
  3882. if b < 0x80 {
  3883. break
  3884. }
  3885. }
  3886. case 2:
  3887. if wireType != 2 {
  3888. return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType)
  3889. }
  3890. var byteLen int
  3891. for shift := uint(0); ; shift += 7 {
  3892. if shift >= 64 {
  3893. return ErrIntOverflowTypes
  3894. }
  3895. if iNdEx >= l {
  3896. return io.ErrUnexpectedEOF
  3897. }
  3898. b := dAtA[iNdEx]
  3899. iNdEx++
  3900. byteLen |= int(b&0x7F) << shift
  3901. if b < 0x80 {
  3902. break
  3903. }
  3904. }
  3905. if byteLen < 0 {
  3906. return ErrInvalidLengthTypes
  3907. }
  3908. postIndex := iNdEx + byteLen
  3909. if postIndex < 0 {
  3910. return ErrInvalidLengthTypes
  3911. }
  3912. if postIndex > l {
  3913. return io.ErrUnexpectedEOF
  3914. }
  3915. m.ValidatorAddress = append(m.ValidatorAddress[:0], dAtA[iNdEx:postIndex]...)
  3916. if m.ValidatorAddress == nil {
  3917. m.ValidatorAddress = []byte{}
  3918. }
  3919. iNdEx = postIndex
  3920. case 3:
  3921. if wireType != 2 {
  3922. return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
  3923. }
  3924. var msglen int
  3925. for shift := uint(0); ; shift += 7 {
  3926. if shift >= 64 {
  3927. return ErrIntOverflowTypes
  3928. }
  3929. if iNdEx >= l {
  3930. return io.ErrUnexpectedEOF
  3931. }
  3932. b := dAtA[iNdEx]
  3933. iNdEx++
  3934. msglen |= int(b&0x7F) << shift
  3935. if b < 0x80 {
  3936. break
  3937. }
  3938. }
  3939. if msglen < 0 {
  3940. return ErrInvalidLengthTypes
  3941. }
  3942. postIndex := iNdEx + msglen
  3943. if postIndex < 0 {
  3944. return ErrInvalidLengthTypes
  3945. }
  3946. if postIndex > l {
  3947. return io.ErrUnexpectedEOF
  3948. }
  3949. if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
  3950. return err
  3951. }
  3952. iNdEx = postIndex
  3953. case 4:
  3954. if wireType != 2 {
  3955. return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType)
  3956. }
  3957. var byteLen int
  3958. for shift := uint(0); ; shift += 7 {
  3959. if shift >= 64 {
  3960. return ErrIntOverflowTypes
  3961. }
  3962. if iNdEx >= l {
  3963. return io.ErrUnexpectedEOF
  3964. }
  3965. b := dAtA[iNdEx]
  3966. iNdEx++
  3967. byteLen |= int(b&0x7F) << shift
  3968. if b < 0x80 {
  3969. break
  3970. }
  3971. }
  3972. if byteLen < 0 {
  3973. return ErrInvalidLengthTypes
  3974. }
  3975. postIndex := iNdEx + byteLen
  3976. if postIndex < 0 {
  3977. return ErrInvalidLengthTypes
  3978. }
  3979. if postIndex > l {
  3980. return io.ErrUnexpectedEOF
  3981. }
  3982. m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...)
  3983. if m.Signature == nil {
  3984. m.Signature = []byte{}
  3985. }
  3986. iNdEx = postIndex
  3987. case 5:
  3988. if wireType != 2 {
  3989. return fmt.Errorf("proto: wrong wireType = %d for field VoteExtension", wireType)
  3990. }
  3991. var msglen int
  3992. for shift := uint(0); ; shift += 7 {
  3993. if shift >= 64 {
  3994. return ErrIntOverflowTypes
  3995. }
  3996. if iNdEx >= l {
  3997. return io.ErrUnexpectedEOF
  3998. }
  3999. b := dAtA[iNdEx]
  4000. iNdEx++
  4001. msglen |= int(b&0x7F) << shift
  4002. if b < 0x80 {
  4003. break
  4004. }
  4005. }
  4006. if msglen < 0 {
  4007. return ErrInvalidLengthTypes
  4008. }
  4009. postIndex := iNdEx + msglen
  4010. if postIndex < 0 {
  4011. return ErrInvalidLengthTypes
  4012. }
  4013. if postIndex > l {
  4014. return io.ErrUnexpectedEOF
  4015. }
  4016. if m.VoteExtension == nil {
  4017. m.VoteExtension = &VoteExtensionToSign{}
  4018. }
  4019. if err := m.VoteExtension.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4020. return err
  4021. }
  4022. iNdEx = postIndex
  4023. default:
  4024. iNdEx = preIndex
  4025. skippy, err := skipTypes(dAtA[iNdEx:])
  4026. if err != nil {
  4027. return err
  4028. }
  4029. if (skippy < 0) || (iNdEx+skippy) < 0 {
  4030. return ErrInvalidLengthTypes
  4031. }
  4032. if (iNdEx + skippy) > l {
  4033. return io.ErrUnexpectedEOF
  4034. }
  4035. iNdEx += skippy
  4036. }
  4037. }
  4038. if iNdEx > l {
  4039. return io.ErrUnexpectedEOF
  4040. }
  4041. return nil
  4042. }
  4043. func (m *Proposal) Unmarshal(dAtA []byte) error {
  4044. l := len(dAtA)
  4045. iNdEx := 0
  4046. for iNdEx < l {
  4047. preIndex := iNdEx
  4048. var wire uint64
  4049. for shift := uint(0); ; shift += 7 {
  4050. if shift >= 64 {
  4051. return ErrIntOverflowTypes
  4052. }
  4053. if iNdEx >= l {
  4054. return io.ErrUnexpectedEOF
  4055. }
  4056. b := dAtA[iNdEx]
  4057. iNdEx++
  4058. wire |= uint64(b&0x7F) << shift
  4059. if b < 0x80 {
  4060. break
  4061. }
  4062. }
  4063. fieldNum := int32(wire >> 3)
  4064. wireType := int(wire & 0x7)
  4065. if wireType == 4 {
  4066. return fmt.Errorf("proto: Proposal: wiretype end group for non-group")
  4067. }
  4068. if fieldNum <= 0 {
  4069. return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire)
  4070. }
  4071. switch fieldNum {
  4072. case 1:
  4073. if wireType != 0 {
  4074. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  4075. }
  4076. m.Type = 0
  4077. for shift := uint(0); ; shift += 7 {
  4078. if shift >= 64 {
  4079. return ErrIntOverflowTypes
  4080. }
  4081. if iNdEx >= l {
  4082. return io.ErrUnexpectedEOF
  4083. }
  4084. b := dAtA[iNdEx]
  4085. iNdEx++
  4086. m.Type |= SignedMsgType(b&0x7F) << shift
  4087. if b < 0x80 {
  4088. break
  4089. }
  4090. }
  4091. case 2:
  4092. if wireType != 0 {
  4093. return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
  4094. }
  4095. m.Height = 0
  4096. for shift := uint(0); ; shift += 7 {
  4097. if shift >= 64 {
  4098. return ErrIntOverflowTypes
  4099. }
  4100. if iNdEx >= l {
  4101. return io.ErrUnexpectedEOF
  4102. }
  4103. b := dAtA[iNdEx]
  4104. iNdEx++
  4105. m.Height |= int64(b&0x7F) << shift
  4106. if b < 0x80 {
  4107. break
  4108. }
  4109. }
  4110. case 3:
  4111. if wireType != 0 {
  4112. return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType)
  4113. }
  4114. m.Round = 0
  4115. for shift := uint(0); ; shift += 7 {
  4116. if shift >= 64 {
  4117. return ErrIntOverflowTypes
  4118. }
  4119. if iNdEx >= l {
  4120. return io.ErrUnexpectedEOF
  4121. }
  4122. b := dAtA[iNdEx]
  4123. iNdEx++
  4124. m.Round |= int32(b&0x7F) << shift
  4125. if b < 0x80 {
  4126. break
  4127. }
  4128. }
  4129. case 4:
  4130. if wireType != 0 {
  4131. return fmt.Errorf("proto: wrong wireType = %d for field PolRound", wireType)
  4132. }
  4133. m.PolRound = 0
  4134. for shift := uint(0); ; shift += 7 {
  4135. if shift >= 64 {
  4136. return ErrIntOverflowTypes
  4137. }
  4138. if iNdEx >= l {
  4139. return io.ErrUnexpectedEOF
  4140. }
  4141. b := dAtA[iNdEx]
  4142. iNdEx++
  4143. m.PolRound |= int32(b&0x7F) << shift
  4144. if b < 0x80 {
  4145. break
  4146. }
  4147. }
  4148. case 5:
  4149. if wireType != 2 {
  4150. return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType)
  4151. }
  4152. var msglen int
  4153. for shift := uint(0); ; shift += 7 {
  4154. if shift >= 64 {
  4155. return ErrIntOverflowTypes
  4156. }
  4157. if iNdEx >= l {
  4158. return io.ErrUnexpectedEOF
  4159. }
  4160. b := dAtA[iNdEx]
  4161. iNdEx++
  4162. msglen |= int(b&0x7F) << shift
  4163. if b < 0x80 {
  4164. break
  4165. }
  4166. }
  4167. if msglen < 0 {
  4168. return ErrInvalidLengthTypes
  4169. }
  4170. postIndex := iNdEx + msglen
  4171. if postIndex < 0 {
  4172. return ErrInvalidLengthTypes
  4173. }
  4174. if postIndex > l {
  4175. return io.ErrUnexpectedEOF
  4176. }
  4177. if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4178. return err
  4179. }
  4180. iNdEx = postIndex
  4181. case 6:
  4182. if wireType != 2 {
  4183. return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
  4184. }
  4185. var msglen int
  4186. for shift := uint(0); ; shift += 7 {
  4187. if shift >= 64 {
  4188. return ErrIntOverflowTypes
  4189. }
  4190. if iNdEx >= l {
  4191. return io.ErrUnexpectedEOF
  4192. }
  4193. b := dAtA[iNdEx]
  4194. iNdEx++
  4195. msglen |= int(b&0x7F) << shift
  4196. if b < 0x80 {
  4197. break
  4198. }
  4199. }
  4200. if msglen < 0 {
  4201. return ErrInvalidLengthTypes
  4202. }
  4203. postIndex := iNdEx + msglen
  4204. if postIndex < 0 {
  4205. return ErrInvalidLengthTypes
  4206. }
  4207. if postIndex > l {
  4208. return io.ErrUnexpectedEOF
  4209. }
  4210. if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
  4211. return err
  4212. }
  4213. iNdEx = postIndex
  4214. case 7:
  4215. if wireType != 2 {
  4216. return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType)
  4217. }
  4218. var byteLen int
  4219. for shift := uint(0); ; shift += 7 {
  4220. if shift >= 64 {
  4221. return ErrIntOverflowTypes
  4222. }
  4223. if iNdEx >= l {
  4224. return io.ErrUnexpectedEOF
  4225. }
  4226. b := dAtA[iNdEx]
  4227. iNdEx++
  4228. byteLen |= int(b&0x7F) << shift
  4229. if b < 0x80 {
  4230. break
  4231. }
  4232. }
  4233. if byteLen < 0 {
  4234. return ErrInvalidLengthTypes
  4235. }
  4236. postIndex := iNdEx + byteLen
  4237. if postIndex < 0 {
  4238. return ErrInvalidLengthTypes
  4239. }
  4240. if postIndex > l {
  4241. return io.ErrUnexpectedEOF
  4242. }
  4243. m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...)
  4244. if m.Signature == nil {
  4245. m.Signature = []byte{}
  4246. }
  4247. iNdEx = postIndex
  4248. default:
  4249. iNdEx = preIndex
  4250. skippy, err := skipTypes(dAtA[iNdEx:])
  4251. if err != nil {
  4252. return err
  4253. }
  4254. if (skippy < 0) || (iNdEx+skippy) < 0 {
  4255. return ErrInvalidLengthTypes
  4256. }
  4257. if (iNdEx + skippy) > l {
  4258. return io.ErrUnexpectedEOF
  4259. }
  4260. iNdEx += skippy
  4261. }
  4262. }
  4263. if iNdEx > l {
  4264. return io.ErrUnexpectedEOF
  4265. }
  4266. return nil
  4267. }
  4268. func (m *SignedHeader) Unmarshal(dAtA []byte) error {
  4269. l := len(dAtA)
  4270. iNdEx := 0
  4271. for iNdEx < l {
  4272. preIndex := iNdEx
  4273. var wire uint64
  4274. for shift := uint(0); ; shift += 7 {
  4275. if shift >= 64 {
  4276. return ErrIntOverflowTypes
  4277. }
  4278. if iNdEx >= l {
  4279. return io.ErrUnexpectedEOF
  4280. }
  4281. b := dAtA[iNdEx]
  4282. iNdEx++
  4283. wire |= uint64(b&0x7F) << shift
  4284. if b < 0x80 {
  4285. break
  4286. }
  4287. }
  4288. fieldNum := int32(wire >> 3)
  4289. wireType := int(wire & 0x7)
  4290. if wireType == 4 {
  4291. return fmt.Errorf("proto: SignedHeader: wiretype end group for non-group")
  4292. }
  4293. if fieldNum <= 0 {
  4294. return fmt.Errorf("proto: SignedHeader: illegal tag %d (wire type %d)", fieldNum, wire)
  4295. }
  4296. switch fieldNum {
  4297. case 1:
  4298. if wireType != 2 {
  4299. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  4300. }
  4301. var msglen int
  4302. for shift := uint(0); ; shift += 7 {
  4303. if shift >= 64 {
  4304. return ErrIntOverflowTypes
  4305. }
  4306. if iNdEx >= l {
  4307. return io.ErrUnexpectedEOF
  4308. }
  4309. b := dAtA[iNdEx]
  4310. iNdEx++
  4311. msglen |= int(b&0x7F) << shift
  4312. if b < 0x80 {
  4313. break
  4314. }
  4315. }
  4316. if msglen < 0 {
  4317. return ErrInvalidLengthTypes
  4318. }
  4319. postIndex := iNdEx + msglen
  4320. if postIndex < 0 {
  4321. return ErrInvalidLengthTypes
  4322. }
  4323. if postIndex > l {
  4324. return io.ErrUnexpectedEOF
  4325. }
  4326. if m.Header == nil {
  4327. m.Header = &Header{}
  4328. }
  4329. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4330. return err
  4331. }
  4332. iNdEx = postIndex
  4333. case 2:
  4334. if wireType != 2 {
  4335. return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
  4336. }
  4337. var msglen int
  4338. for shift := uint(0); ; shift += 7 {
  4339. if shift >= 64 {
  4340. return ErrIntOverflowTypes
  4341. }
  4342. if iNdEx >= l {
  4343. return io.ErrUnexpectedEOF
  4344. }
  4345. b := dAtA[iNdEx]
  4346. iNdEx++
  4347. msglen |= int(b&0x7F) << shift
  4348. if b < 0x80 {
  4349. break
  4350. }
  4351. }
  4352. if msglen < 0 {
  4353. return ErrInvalidLengthTypes
  4354. }
  4355. postIndex := iNdEx + msglen
  4356. if postIndex < 0 {
  4357. return ErrInvalidLengthTypes
  4358. }
  4359. if postIndex > l {
  4360. return io.ErrUnexpectedEOF
  4361. }
  4362. if m.Commit == nil {
  4363. m.Commit = &Commit{}
  4364. }
  4365. if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4366. return err
  4367. }
  4368. iNdEx = postIndex
  4369. default:
  4370. iNdEx = preIndex
  4371. skippy, err := skipTypes(dAtA[iNdEx:])
  4372. if err != nil {
  4373. return err
  4374. }
  4375. if (skippy < 0) || (iNdEx+skippy) < 0 {
  4376. return ErrInvalidLengthTypes
  4377. }
  4378. if (iNdEx + skippy) > l {
  4379. return io.ErrUnexpectedEOF
  4380. }
  4381. iNdEx += skippy
  4382. }
  4383. }
  4384. if iNdEx > l {
  4385. return io.ErrUnexpectedEOF
  4386. }
  4387. return nil
  4388. }
  4389. func (m *LightBlock) Unmarshal(dAtA []byte) error {
  4390. l := len(dAtA)
  4391. iNdEx := 0
  4392. for iNdEx < l {
  4393. preIndex := iNdEx
  4394. var wire uint64
  4395. for shift := uint(0); ; shift += 7 {
  4396. if shift >= 64 {
  4397. return ErrIntOverflowTypes
  4398. }
  4399. if iNdEx >= l {
  4400. return io.ErrUnexpectedEOF
  4401. }
  4402. b := dAtA[iNdEx]
  4403. iNdEx++
  4404. wire |= uint64(b&0x7F) << shift
  4405. if b < 0x80 {
  4406. break
  4407. }
  4408. }
  4409. fieldNum := int32(wire >> 3)
  4410. wireType := int(wire & 0x7)
  4411. if wireType == 4 {
  4412. return fmt.Errorf("proto: LightBlock: wiretype end group for non-group")
  4413. }
  4414. if fieldNum <= 0 {
  4415. return fmt.Errorf("proto: LightBlock: illegal tag %d (wire type %d)", fieldNum, wire)
  4416. }
  4417. switch fieldNum {
  4418. case 1:
  4419. if wireType != 2 {
  4420. return fmt.Errorf("proto: wrong wireType = %d for field SignedHeader", wireType)
  4421. }
  4422. var msglen int
  4423. for shift := uint(0); ; shift += 7 {
  4424. if shift >= 64 {
  4425. return ErrIntOverflowTypes
  4426. }
  4427. if iNdEx >= l {
  4428. return io.ErrUnexpectedEOF
  4429. }
  4430. b := dAtA[iNdEx]
  4431. iNdEx++
  4432. msglen |= int(b&0x7F) << shift
  4433. if b < 0x80 {
  4434. break
  4435. }
  4436. }
  4437. if msglen < 0 {
  4438. return ErrInvalidLengthTypes
  4439. }
  4440. postIndex := iNdEx + msglen
  4441. if postIndex < 0 {
  4442. return ErrInvalidLengthTypes
  4443. }
  4444. if postIndex > l {
  4445. return io.ErrUnexpectedEOF
  4446. }
  4447. if m.SignedHeader == nil {
  4448. m.SignedHeader = &SignedHeader{}
  4449. }
  4450. if err := m.SignedHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4451. return err
  4452. }
  4453. iNdEx = postIndex
  4454. case 2:
  4455. if wireType != 2 {
  4456. return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType)
  4457. }
  4458. var msglen int
  4459. for shift := uint(0); ; shift += 7 {
  4460. if shift >= 64 {
  4461. return ErrIntOverflowTypes
  4462. }
  4463. if iNdEx >= l {
  4464. return io.ErrUnexpectedEOF
  4465. }
  4466. b := dAtA[iNdEx]
  4467. iNdEx++
  4468. msglen |= int(b&0x7F) << shift
  4469. if b < 0x80 {
  4470. break
  4471. }
  4472. }
  4473. if msglen < 0 {
  4474. return ErrInvalidLengthTypes
  4475. }
  4476. postIndex := iNdEx + msglen
  4477. if postIndex < 0 {
  4478. return ErrInvalidLengthTypes
  4479. }
  4480. if postIndex > l {
  4481. return io.ErrUnexpectedEOF
  4482. }
  4483. if m.ValidatorSet == nil {
  4484. m.ValidatorSet = &ValidatorSet{}
  4485. }
  4486. if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4487. return err
  4488. }
  4489. iNdEx = postIndex
  4490. default:
  4491. iNdEx = preIndex
  4492. skippy, err := skipTypes(dAtA[iNdEx:])
  4493. if err != nil {
  4494. return err
  4495. }
  4496. if (skippy < 0) || (iNdEx+skippy) < 0 {
  4497. return ErrInvalidLengthTypes
  4498. }
  4499. if (iNdEx + skippy) > l {
  4500. return io.ErrUnexpectedEOF
  4501. }
  4502. iNdEx += skippy
  4503. }
  4504. }
  4505. if iNdEx > l {
  4506. return io.ErrUnexpectedEOF
  4507. }
  4508. return nil
  4509. }
  4510. func (m *BlockMeta) Unmarshal(dAtA []byte) error {
  4511. l := len(dAtA)
  4512. iNdEx := 0
  4513. for iNdEx < l {
  4514. preIndex := iNdEx
  4515. var wire uint64
  4516. for shift := uint(0); ; shift += 7 {
  4517. if shift >= 64 {
  4518. return ErrIntOverflowTypes
  4519. }
  4520. if iNdEx >= l {
  4521. return io.ErrUnexpectedEOF
  4522. }
  4523. b := dAtA[iNdEx]
  4524. iNdEx++
  4525. wire |= uint64(b&0x7F) << shift
  4526. if b < 0x80 {
  4527. break
  4528. }
  4529. }
  4530. fieldNum := int32(wire >> 3)
  4531. wireType := int(wire & 0x7)
  4532. if wireType == 4 {
  4533. return fmt.Errorf("proto: BlockMeta: wiretype end group for non-group")
  4534. }
  4535. if fieldNum <= 0 {
  4536. return fmt.Errorf("proto: BlockMeta: illegal tag %d (wire type %d)", fieldNum, wire)
  4537. }
  4538. switch fieldNum {
  4539. case 1:
  4540. if wireType != 2 {
  4541. return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType)
  4542. }
  4543. var msglen int
  4544. for shift := uint(0); ; shift += 7 {
  4545. if shift >= 64 {
  4546. return ErrIntOverflowTypes
  4547. }
  4548. if iNdEx >= l {
  4549. return io.ErrUnexpectedEOF
  4550. }
  4551. b := dAtA[iNdEx]
  4552. iNdEx++
  4553. msglen |= int(b&0x7F) << shift
  4554. if b < 0x80 {
  4555. break
  4556. }
  4557. }
  4558. if msglen < 0 {
  4559. return ErrInvalidLengthTypes
  4560. }
  4561. postIndex := iNdEx + msglen
  4562. if postIndex < 0 {
  4563. return ErrInvalidLengthTypes
  4564. }
  4565. if postIndex > l {
  4566. return io.ErrUnexpectedEOF
  4567. }
  4568. if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4569. return err
  4570. }
  4571. iNdEx = postIndex
  4572. case 2:
  4573. if wireType != 0 {
  4574. return fmt.Errorf("proto: wrong wireType = %d for field BlockSize", wireType)
  4575. }
  4576. m.BlockSize = 0
  4577. for shift := uint(0); ; shift += 7 {
  4578. if shift >= 64 {
  4579. return ErrIntOverflowTypes
  4580. }
  4581. if iNdEx >= l {
  4582. return io.ErrUnexpectedEOF
  4583. }
  4584. b := dAtA[iNdEx]
  4585. iNdEx++
  4586. m.BlockSize |= int64(b&0x7F) << shift
  4587. if b < 0x80 {
  4588. break
  4589. }
  4590. }
  4591. case 3:
  4592. if wireType != 2 {
  4593. return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
  4594. }
  4595. var msglen int
  4596. for shift := uint(0); ; shift += 7 {
  4597. if shift >= 64 {
  4598. return ErrIntOverflowTypes
  4599. }
  4600. if iNdEx >= l {
  4601. return io.ErrUnexpectedEOF
  4602. }
  4603. b := dAtA[iNdEx]
  4604. iNdEx++
  4605. msglen |= int(b&0x7F) << shift
  4606. if b < 0x80 {
  4607. break
  4608. }
  4609. }
  4610. if msglen < 0 {
  4611. return ErrInvalidLengthTypes
  4612. }
  4613. postIndex := iNdEx + msglen
  4614. if postIndex < 0 {
  4615. return ErrInvalidLengthTypes
  4616. }
  4617. if postIndex > l {
  4618. return io.ErrUnexpectedEOF
  4619. }
  4620. if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4621. return err
  4622. }
  4623. iNdEx = postIndex
  4624. case 4:
  4625. if wireType != 0 {
  4626. return fmt.Errorf("proto: wrong wireType = %d for field NumTxs", wireType)
  4627. }
  4628. m.NumTxs = 0
  4629. for shift := uint(0); ; shift += 7 {
  4630. if shift >= 64 {
  4631. return ErrIntOverflowTypes
  4632. }
  4633. if iNdEx >= l {
  4634. return io.ErrUnexpectedEOF
  4635. }
  4636. b := dAtA[iNdEx]
  4637. iNdEx++
  4638. m.NumTxs |= int64(b&0x7F) << shift
  4639. if b < 0x80 {
  4640. break
  4641. }
  4642. }
  4643. default:
  4644. iNdEx = preIndex
  4645. skippy, err := skipTypes(dAtA[iNdEx:])
  4646. if err != nil {
  4647. return err
  4648. }
  4649. if (skippy < 0) || (iNdEx+skippy) < 0 {
  4650. return ErrInvalidLengthTypes
  4651. }
  4652. if (iNdEx + skippy) > l {
  4653. return io.ErrUnexpectedEOF
  4654. }
  4655. iNdEx += skippy
  4656. }
  4657. }
  4658. if iNdEx > l {
  4659. return io.ErrUnexpectedEOF
  4660. }
  4661. return nil
  4662. }
  4663. func (m *TxProof) Unmarshal(dAtA []byte) error {
  4664. l := len(dAtA)
  4665. iNdEx := 0
  4666. for iNdEx < l {
  4667. preIndex := iNdEx
  4668. var wire uint64
  4669. for shift := uint(0); ; shift += 7 {
  4670. if shift >= 64 {
  4671. return ErrIntOverflowTypes
  4672. }
  4673. if iNdEx >= l {
  4674. return io.ErrUnexpectedEOF
  4675. }
  4676. b := dAtA[iNdEx]
  4677. iNdEx++
  4678. wire |= uint64(b&0x7F) << shift
  4679. if b < 0x80 {
  4680. break
  4681. }
  4682. }
  4683. fieldNum := int32(wire >> 3)
  4684. wireType := int(wire & 0x7)
  4685. if wireType == 4 {
  4686. return fmt.Errorf("proto: TxProof: wiretype end group for non-group")
  4687. }
  4688. if fieldNum <= 0 {
  4689. return fmt.Errorf("proto: TxProof: illegal tag %d (wire type %d)", fieldNum, wire)
  4690. }
  4691. switch fieldNum {
  4692. case 1:
  4693. if wireType != 2 {
  4694. return fmt.Errorf("proto: wrong wireType = %d for field RootHash", wireType)
  4695. }
  4696. var byteLen int
  4697. for shift := uint(0); ; shift += 7 {
  4698. if shift >= 64 {
  4699. return ErrIntOverflowTypes
  4700. }
  4701. if iNdEx >= l {
  4702. return io.ErrUnexpectedEOF
  4703. }
  4704. b := dAtA[iNdEx]
  4705. iNdEx++
  4706. byteLen |= int(b&0x7F) << shift
  4707. if b < 0x80 {
  4708. break
  4709. }
  4710. }
  4711. if byteLen < 0 {
  4712. return ErrInvalidLengthTypes
  4713. }
  4714. postIndex := iNdEx + byteLen
  4715. if postIndex < 0 {
  4716. return ErrInvalidLengthTypes
  4717. }
  4718. if postIndex > l {
  4719. return io.ErrUnexpectedEOF
  4720. }
  4721. m.RootHash = append(m.RootHash[:0], dAtA[iNdEx:postIndex]...)
  4722. if m.RootHash == nil {
  4723. m.RootHash = []byte{}
  4724. }
  4725. iNdEx = postIndex
  4726. case 2:
  4727. if wireType != 2 {
  4728. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  4729. }
  4730. var byteLen int
  4731. for shift := uint(0); ; shift += 7 {
  4732. if shift >= 64 {
  4733. return ErrIntOverflowTypes
  4734. }
  4735. if iNdEx >= l {
  4736. return io.ErrUnexpectedEOF
  4737. }
  4738. b := dAtA[iNdEx]
  4739. iNdEx++
  4740. byteLen |= int(b&0x7F) << shift
  4741. if b < 0x80 {
  4742. break
  4743. }
  4744. }
  4745. if byteLen < 0 {
  4746. return ErrInvalidLengthTypes
  4747. }
  4748. postIndex := iNdEx + byteLen
  4749. if postIndex < 0 {
  4750. return ErrInvalidLengthTypes
  4751. }
  4752. if postIndex > l {
  4753. return io.ErrUnexpectedEOF
  4754. }
  4755. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  4756. if m.Data == nil {
  4757. m.Data = []byte{}
  4758. }
  4759. iNdEx = postIndex
  4760. case 3:
  4761. if wireType != 2 {
  4762. return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType)
  4763. }
  4764. var msglen int
  4765. for shift := uint(0); ; shift += 7 {
  4766. if shift >= 64 {
  4767. return ErrIntOverflowTypes
  4768. }
  4769. if iNdEx >= l {
  4770. return io.ErrUnexpectedEOF
  4771. }
  4772. b := dAtA[iNdEx]
  4773. iNdEx++
  4774. msglen |= int(b&0x7F) << shift
  4775. if b < 0x80 {
  4776. break
  4777. }
  4778. }
  4779. if msglen < 0 {
  4780. return ErrInvalidLengthTypes
  4781. }
  4782. postIndex := iNdEx + msglen
  4783. if postIndex < 0 {
  4784. return ErrInvalidLengthTypes
  4785. }
  4786. if postIndex > l {
  4787. return io.ErrUnexpectedEOF
  4788. }
  4789. if m.Proof == nil {
  4790. m.Proof = &crypto.Proof{}
  4791. }
  4792. if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4793. return err
  4794. }
  4795. iNdEx = postIndex
  4796. default:
  4797. iNdEx = preIndex
  4798. skippy, err := skipTypes(dAtA[iNdEx:])
  4799. if err != nil {
  4800. return err
  4801. }
  4802. if (skippy < 0) || (iNdEx+skippy) < 0 {
  4803. return ErrInvalidLengthTypes
  4804. }
  4805. if (iNdEx + skippy) > l {
  4806. return io.ErrUnexpectedEOF
  4807. }
  4808. iNdEx += skippy
  4809. }
  4810. }
  4811. if iNdEx > l {
  4812. return io.ErrUnexpectedEOF
  4813. }
  4814. return nil
  4815. }
  4816. func skipTypes(dAtA []byte) (n int, err error) {
  4817. l := len(dAtA)
  4818. iNdEx := 0
  4819. depth := 0
  4820. for iNdEx < l {
  4821. var wire uint64
  4822. for shift := uint(0); ; shift += 7 {
  4823. if shift >= 64 {
  4824. return 0, ErrIntOverflowTypes
  4825. }
  4826. if iNdEx >= l {
  4827. return 0, io.ErrUnexpectedEOF
  4828. }
  4829. b := dAtA[iNdEx]
  4830. iNdEx++
  4831. wire |= (uint64(b) & 0x7F) << shift
  4832. if b < 0x80 {
  4833. break
  4834. }
  4835. }
  4836. wireType := int(wire & 0x7)
  4837. switch wireType {
  4838. case 0:
  4839. for shift := uint(0); ; shift += 7 {
  4840. if shift >= 64 {
  4841. return 0, ErrIntOverflowTypes
  4842. }
  4843. if iNdEx >= l {
  4844. return 0, io.ErrUnexpectedEOF
  4845. }
  4846. iNdEx++
  4847. if dAtA[iNdEx-1] < 0x80 {
  4848. break
  4849. }
  4850. }
  4851. case 1:
  4852. iNdEx += 8
  4853. case 2:
  4854. var length int
  4855. for shift := uint(0); ; shift += 7 {
  4856. if shift >= 64 {
  4857. return 0, ErrIntOverflowTypes
  4858. }
  4859. if iNdEx >= l {
  4860. return 0, io.ErrUnexpectedEOF
  4861. }
  4862. b := dAtA[iNdEx]
  4863. iNdEx++
  4864. length |= (int(b) & 0x7F) << shift
  4865. if b < 0x80 {
  4866. break
  4867. }
  4868. }
  4869. if length < 0 {
  4870. return 0, ErrInvalidLengthTypes
  4871. }
  4872. iNdEx += length
  4873. case 3:
  4874. depth++
  4875. case 4:
  4876. if depth == 0 {
  4877. return 0, ErrUnexpectedEndOfGroupTypes
  4878. }
  4879. depth--
  4880. case 5:
  4881. iNdEx += 4
  4882. default:
  4883. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  4884. }
  4885. if iNdEx < 0 {
  4886. return 0, ErrInvalidLengthTypes
  4887. }
  4888. if depth == 0 {
  4889. return iNdEx, nil
  4890. }
  4891. }
  4892. return 0, io.ErrUnexpectedEOF
  4893. }
  4894. var (
  4895. ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
  4896. ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
  4897. ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
  4898. )