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.

1440 lines
35 KiB

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