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.

1390 lines
34 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: proto/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. PartsHeader CanonicalPartSetHeader `protobuf:"bytes,2,opt,name=parts_header,json=partsHeader,proto3" json:"parts_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_3f9b1d584b46f180, []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) GetPartsHeader() CanonicalPartSetHeader {
  68. if m != nil {
  69. return m.PartsHeader
  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_3f9b1d584b46f180, []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_3f9b1d584b46f180, []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 SIGNED_MSG_TYPE_UNKNOWN
  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. }
  210. func (m *CanonicalVote) Reset() { *m = CanonicalVote{} }
  211. func (m *CanonicalVote) String() string { return proto.CompactTextString(m) }
  212. func (*CanonicalVote) ProtoMessage() {}
  213. func (*CanonicalVote) Descriptor() ([]byte, []int) {
  214. return fileDescriptor_3f9b1d584b46f180, []int{3}
  215. }
  216. func (m *CanonicalVote) XXX_Unmarshal(b []byte) error {
  217. return m.Unmarshal(b)
  218. }
  219. func (m *CanonicalVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  220. if deterministic {
  221. return xxx_messageInfo_CanonicalVote.Marshal(b, m, deterministic)
  222. } else {
  223. b = b[:cap(b)]
  224. n, err := m.MarshalToSizedBuffer(b)
  225. if err != nil {
  226. return nil, err
  227. }
  228. return b[:n], nil
  229. }
  230. }
  231. func (m *CanonicalVote) XXX_Merge(src proto.Message) {
  232. xxx_messageInfo_CanonicalVote.Merge(m, src)
  233. }
  234. func (m *CanonicalVote) XXX_Size() int {
  235. return m.Size()
  236. }
  237. func (m *CanonicalVote) XXX_DiscardUnknown() {
  238. xxx_messageInfo_CanonicalVote.DiscardUnknown(m)
  239. }
  240. var xxx_messageInfo_CanonicalVote proto.InternalMessageInfo
  241. func (m *CanonicalVote) GetType() SignedMsgType {
  242. if m != nil {
  243. return m.Type
  244. }
  245. return SIGNED_MSG_TYPE_UNKNOWN
  246. }
  247. func (m *CanonicalVote) GetHeight() int64 {
  248. if m != nil {
  249. return m.Height
  250. }
  251. return 0
  252. }
  253. func (m *CanonicalVote) GetRound() int64 {
  254. if m != nil {
  255. return m.Round
  256. }
  257. return 0
  258. }
  259. func (m *CanonicalVote) GetBlockID() *CanonicalBlockID {
  260. if m != nil {
  261. return m.BlockID
  262. }
  263. return nil
  264. }
  265. func (m *CanonicalVote) GetTimestamp() time.Time {
  266. if m != nil {
  267. return m.Timestamp
  268. }
  269. return time.Time{}
  270. }
  271. func (m *CanonicalVote) GetChainID() string {
  272. if m != nil {
  273. return m.ChainID
  274. }
  275. return ""
  276. }
  277. func init() {
  278. proto.RegisterType((*CanonicalBlockID)(nil), "tendermint.types.CanonicalBlockID")
  279. proto.RegisterType((*CanonicalPartSetHeader)(nil), "tendermint.types.CanonicalPartSetHeader")
  280. proto.RegisterType((*CanonicalProposal)(nil), "tendermint.types.CanonicalProposal")
  281. proto.RegisterType((*CanonicalVote)(nil), "tendermint.types.CanonicalVote")
  282. }
  283. func init() { proto.RegisterFile("proto/types/canonical.proto", fileDescriptor_3f9b1d584b46f180) }
  284. var fileDescriptor_3f9b1d584b46f180 = []byte{
  285. // 489 bytes of a gzipped FileDescriptorProto
  286. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0xcb, 0x6e, 0xd3, 0x40,
  287. 0x14, 0xcd, 0xa4, 0x4e, 0xe2, 0x4c, 0x52, 0x14, 0x46, 0xa8, 0x58, 0x41, 0xb2, 0x23, 0x2f, 0x2a,
  288. 0x23, 0x21, 0x5b, 0x6a, 0xff, 0xc0, 0x45, 0x88, 0x20, 0x10, 0x65, 0x5a, 0xb1, 0x60, 0x13, 0x4d,
  289. 0xec, 0xc1, 0x1e, 0xe1, 0x78, 0x2c, 0x7b, 0xb2, 0xc8, 0x5f, 0xf4, 0x3b, 0xf8, 0x92, 0x2e, 0xbb,
  290. 0x84, 0x4d, 0x40, 0xce, 0x8f, 0xa0, 0x99, 0x49, 0xe2, 0x88, 0xd7, 0x06, 0xd4, 0x8d, 0x75, 0x1f,
  291. 0xe7, 0x9e, 0x7b, 0x7c, 0xae, 0x06, 0x3e, 0x29, 0x4a, 0x2e, 0x78, 0x20, 0x56, 0x05, 0xad, 0x82,
  292. 0x88, 0xe4, 0x3c, 0x67, 0x11, 0xc9, 0x7c, 0x55, 0x45, 0x23, 0x41, 0xf3, 0x98, 0x96, 0x0b, 0x96,
  293. 0x0b, 0x5f, 0x21, 0xc6, 0xa7, 0x22, 0x65, 0x65, 0x3c, 0x2b, 0x48, 0x29, 0x56, 0x81, 0x1e, 0x4d,
  294. 0x78, 0xc2, 0x9b, 0x48, 0x4f, 0x8e, 0x1f, 0x1f, 0xd2, 0xaa, 0xef, 0xb6, 0xe1, 0x24, 0x9c, 0x27,
  295. 0x19, 0xd5, 0xb3, 0xf3, 0xe5, 0xc7, 0x40, 0xb0, 0x05, 0xad, 0x04, 0x59, 0x14, 0x1a, 0xe0, 0xae,
  296. 0xe0, 0xe8, 0x62, 0x27, 0x23, 0xcc, 0x78, 0xf4, 0x69, 0xfa, 0x1c, 0x21, 0x68, 0xa4, 0xa4, 0x4a,
  297. 0x2d, 0x30, 0x01, 0xde, 0x10, 0xab, 0x18, 0xbd, 0x83, 0x43, 0xa9, 0xa2, 0x9a, 0xa5, 0x94, 0xc4,
  298. 0xb4, 0xb4, 0xda, 0x13, 0xe0, 0x0d, 0xce, 0x3c, 0xff, 0x67, 0xc9, 0xfe, 0x9e, 0xed, 0x92, 0x94,
  299. 0xe2, 0x8a, 0x8a, 0x97, 0x0a, 0x1f, 0x1a, 0xb7, 0x6b, 0xa7, 0x85, 0x07, 0x8a, 0x43, 0x97, 0xdc,
  300. 0x10, 0x9e, 0xfc, 0x1e, 0x8c, 0x1e, 0xc1, 0x8e, 0xe0, 0x82, 0x64, 0x4a, 0xc1, 0x31, 0xd6, 0xc9,
  301. 0x5e, 0x56, 0xbb, 0x91, 0xe5, 0x7e, 0x6d, 0xc3, 0x87, 0x0d, 0x49, 0xc9, 0x0b, 0x5e, 0x91, 0x0c,
  302. 0x9d, 0x43, 0x43, 0x8a, 0x51, 0xe3, 0x0f, 0xce, 0x9c, 0x5f, 0x45, 0x5e, 0xb1, 0x24, 0xa7, 0xf1,
  303. 0x9b, 0x2a, 0xb9, 0x5e, 0x15, 0x14, 0x2b, 0x30, 0x3a, 0x81, 0xdd, 0x94, 0xb2, 0x24, 0x15, 0x6a,
  304. 0xc1, 0x08, 0x6f, 0x33, 0x29, 0xa6, 0xe4, 0xcb, 0x3c, 0xb6, 0x8e, 0x54, 0x59, 0x27, 0xe8, 0x29,
  305. 0xec, 0x17, 0x3c, 0x9b, 0xe9, 0x8e, 0x31, 0x01, 0xde, 0x51, 0x38, 0xac, 0xd7, 0x8e, 0x79, 0xf9,
  306. 0xf6, 0x35, 0x96, 0x35, 0x6c, 0x16, 0x3c, 0x53, 0x11, 0x7a, 0x05, 0xcd, 0xb9, 0x74, 0x76, 0xc6,
  307. 0x62, 0xab, 0xa3, 0x6c, 0x73, 0xff, 0x62, 0xdb, 0xf6, 0x08, 0xe1, 0xa0, 0x5e, 0x3b, 0xbd, 0x6d,
  308. 0x82, 0x7b, 0x8a, 0x60, 0x1a, 0xa3, 0x10, 0xf6, 0xf7, 0x17, 0xb4, 0xba, 0x8a, 0x6c, 0xec, 0xeb,
  309. 0x1b, 0xfb, 0xbb, 0x1b, 0xfb, 0xd7, 0x3b, 0x44, 0x68, 0x4a, 0xd7, 0x6f, 0xbe, 0x39, 0x00, 0x37,
  310. 0x63, 0xe8, 0x14, 0x9a, 0x51, 0x4a, 0x58, 0x2e, 0xf5, 0xf4, 0x26, 0xc0, 0xeb, 0xeb, 0x5d, 0x17,
  311. 0xb2, 0x26, 0x77, 0xa9, 0xe6, 0x34, 0x76, 0x3f, 0xb7, 0xe1, 0xf1, 0x5e, 0xd6, 0x7b, 0x2e, 0xe8,
  312. 0x7d, 0xf8, 0x7a, 0x68, 0x96, 0xf1, 0x3f, 0xcd, 0xea, 0xfc, 0xbb, 0x59, 0xdd, 0x3f, 0x9b, 0x15,
  313. 0xbe, 0xb8, 0xad, 0x6d, 0x70, 0x57, 0xdb, 0xe0, 0x7b, 0x6d, 0x83, 0x9b, 0x8d, 0xdd, 0xba, 0xdb,
  314. 0xd8, 0xad, 0x2f, 0x1b, 0xbb, 0xf5, 0xe1, 0x59, 0xc2, 0x44, 0xba, 0x9c, 0xfb, 0x11, 0x5f, 0x04,
  315. 0xcd, 0x9f, 0x1c, 0x86, 0x07, 0x8f, 0x77, 0xde, 0x55, 0xc9, 0xf9, 0x8f, 0x00, 0x00, 0x00, 0xff,
  316. 0xff, 0x6b, 0xbc, 0x84, 0x74, 0x29, 0x04, 0x00, 0x00,
  317. }
  318. func (m *CanonicalBlockID) Marshal() (dAtA []byte, err error) {
  319. size := m.Size()
  320. dAtA = make([]byte, size)
  321. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  322. if err != nil {
  323. return nil, err
  324. }
  325. return dAtA[:n], nil
  326. }
  327. func (m *CanonicalBlockID) MarshalTo(dAtA []byte) (int, error) {
  328. size := m.Size()
  329. return m.MarshalToSizedBuffer(dAtA[:size])
  330. }
  331. func (m *CanonicalBlockID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  332. i := len(dAtA)
  333. _ = i
  334. var l int
  335. _ = l
  336. {
  337. size, err := m.PartsHeader.MarshalToSizedBuffer(dAtA[:i])
  338. if err != nil {
  339. return 0, err
  340. }
  341. i -= size
  342. i = encodeVarintCanonical(dAtA, i, uint64(size))
  343. }
  344. i--
  345. dAtA[i] = 0x12
  346. if len(m.Hash) > 0 {
  347. i -= len(m.Hash)
  348. copy(dAtA[i:], m.Hash)
  349. i = encodeVarintCanonical(dAtA, i, uint64(len(m.Hash)))
  350. i--
  351. dAtA[i] = 0xa
  352. }
  353. return len(dAtA) - i, nil
  354. }
  355. func (m *CanonicalPartSetHeader) Marshal() (dAtA []byte, err error) {
  356. size := m.Size()
  357. dAtA = make([]byte, size)
  358. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  359. if err != nil {
  360. return nil, err
  361. }
  362. return dAtA[:n], nil
  363. }
  364. func (m *CanonicalPartSetHeader) MarshalTo(dAtA []byte) (int, error) {
  365. size := m.Size()
  366. return m.MarshalToSizedBuffer(dAtA[:size])
  367. }
  368. func (m *CanonicalPartSetHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  369. i := len(dAtA)
  370. _ = i
  371. var l int
  372. _ = l
  373. if len(m.Hash) > 0 {
  374. i -= len(m.Hash)
  375. copy(dAtA[i:], m.Hash)
  376. i = encodeVarintCanonical(dAtA, i, uint64(len(m.Hash)))
  377. i--
  378. dAtA[i] = 0x12
  379. }
  380. if m.Total != 0 {
  381. i = encodeVarintCanonical(dAtA, i, uint64(m.Total))
  382. i--
  383. dAtA[i] = 0x8
  384. }
  385. return len(dAtA) - i, nil
  386. }
  387. func (m *CanonicalProposal) Marshal() (dAtA []byte, err error) {
  388. size := m.Size()
  389. dAtA = make([]byte, size)
  390. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  391. if err != nil {
  392. return nil, err
  393. }
  394. return dAtA[:n], nil
  395. }
  396. func (m *CanonicalProposal) MarshalTo(dAtA []byte) (int, error) {
  397. size := m.Size()
  398. return m.MarshalToSizedBuffer(dAtA[:size])
  399. }
  400. func (m *CanonicalProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  401. i := len(dAtA)
  402. _ = i
  403. var l int
  404. _ = l
  405. if len(m.ChainID) > 0 {
  406. i -= len(m.ChainID)
  407. copy(dAtA[i:], m.ChainID)
  408. i = encodeVarintCanonical(dAtA, i, uint64(len(m.ChainID)))
  409. i--
  410. dAtA[i] = 0x3a
  411. }
  412. n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
  413. if err2 != nil {
  414. return 0, err2
  415. }
  416. i -= n2
  417. i = encodeVarintCanonical(dAtA, i, uint64(n2))
  418. i--
  419. dAtA[i] = 0x32
  420. if m.BlockID != nil {
  421. {
  422. size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i])
  423. if err != nil {
  424. return 0, err
  425. }
  426. i -= size
  427. i = encodeVarintCanonical(dAtA, i, uint64(size))
  428. }
  429. i--
  430. dAtA[i] = 0x2a
  431. }
  432. if m.POLRound != 0 {
  433. i = encodeVarintCanonical(dAtA, i, uint64(m.POLRound))
  434. i--
  435. dAtA[i] = 0x20
  436. }
  437. if m.Round != 0 {
  438. i -= 8
  439. encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Round))
  440. i--
  441. dAtA[i] = 0x19
  442. }
  443. if m.Height != 0 {
  444. i -= 8
  445. encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Height))
  446. i--
  447. dAtA[i] = 0x11
  448. }
  449. if m.Type != 0 {
  450. i = encodeVarintCanonical(dAtA, i, uint64(m.Type))
  451. i--
  452. dAtA[i] = 0x8
  453. }
  454. return len(dAtA) - i, nil
  455. }
  456. func (m *CanonicalVote) Marshal() (dAtA []byte, err error) {
  457. size := m.Size()
  458. dAtA = make([]byte, size)
  459. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  460. if err != nil {
  461. return nil, err
  462. }
  463. return dAtA[:n], nil
  464. }
  465. func (m *CanonicalVote) MarshalTo(dAtA []byte) (int, error) {
  466. size := m.Size()
  467. return m.MarshalToSizedBuffer(dAtA[:size])
  468. }
  469. func (m *CanonicalVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  470. i := len(dAtA)
  471. _ = i
  472. var l int
  473. _ = l
  474. if len(m.ChainID) > 0 {
  475. i -= len(m.ChainID)
  476. copy(dAtA[i:], m.ChainID)
  477. i = encodeVarintCanonical(dAtA, i, uint64(len(m.ChainID)))
  478. i--
  479. dAtA[i] = 0x32
  480. }
  481. n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
  482. if err4 != nil {
  483. return 0, err4
  484. }
  485. i -= n4
  486. i = encodeVarintCanonical(dAtA, i, uint64(n4))
  487. i--
  488. dAtA[i] = 0x2a
  489. if m.BlockID != nil {
  490. {
  491. size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i])
  492. if err != nil {
  493. return 0, err
  494. }
  495. i -= size
  496. i = encodeVarintCanonical(dAtA, i, uint64(size))
  497. }
  498. i--
  499. dAtA[i] = 0x22
  500. }
  501. if m.Round != 0 {
  502. i -= 8
  503. encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Round))
  504. i--
  505. dAtA[i] = 0x19
  506. }
  507. if m.Height != 0 {
  508. i -= 8
  509. encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Height))
  510. i--
  511. dAtA[i] = 0x11
  512. }
  513. if m.Type != 0 {
  514. i = encodeVarintCanonical(dAtA, i, uint64(m.Type))
  515. i--
  516. dAtA[i] = 0x8
  517. }
  518. return len(dAtA) - i, nil
  519. }
  520. func encodeVarintCanonical(dAtA []byte, offset int, v uint64) int {
  521. offset -= sovCanonical(v)
  522. base := offset
  523. for v >= 1<<7 {
  524. dAtA[offset] = uint8(v&0x7f | 0x80)
  525. v >>= 7
  526. offset++
  527. }
  528. dAtA[offset] = uint8(v)
  529. return base
  530. }
  531. func (m *CanonicalBlockID) Size() (n int) {
  532. if m == nil {
  533. return 0
  534. }
  535. var l int
  536. _ = l
  537. l = len(m.Hash)
  538. if l > 0 {
  539. n += 1 + l + sovCanonical(uint64(l))
  540. }
  541. l = m.PartsHeader.Size()
  542. n += 1 + l + sovCanonical(uint64(l))
  543. return n
  544. }
  545. func (m *CanonicalPartSetHeader) Size() (n int) {
  546. if m == nil {
  547. return 0
  548. }
  549. var l int
  550. _ = l
  551. if m.Total != 0 {
  552. n += 1 + sovCanonical(uint64(m.Total))
  553. }
  554. l = len(m.Hash)
  555. if l > 0 {
  556. n += 1 + l + sovCanonical(uint64(l))
  557. }
  558. return n
  559. }
  560. func (m *CanonicalProposal) Size() (n int) {
  561. if m == nil {
  562. return 0
  563. }
  564. var l int
  565. _ = l
  566. if m.Type != 0 {
  567. n += 1 + sovCanonical(uint64(m.Type))
  568. }
  569. if m.Height != 0 {
  570. n += 9
  571. }
  572. if m.Round != 0 {
  573. n += 9
  574. }
  575. if m.POLRound != 0 {
  576. n += 1 + sovCanonical(uint64(m.POLRound))
  577. }
  578. if m.BlockID != nil {
  579. l = m.BlockID.Size()
  580. n += 1 + l + sovCanonical(uint64(l))
  581. }
  582. l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
  583. n += 1 + l + sovCanonical(uint64(l))
  584. l = len(m.ChainID)
  585. if l > 0 {
  586. n += 1 + l + sovCanonical(uint64(l))
  587. }
  588. return n
  589. }
  590. func (m *CanonicalVote) Size() (n int) {
  591. if m == nil {
  592. return 0
  593. }
  594. var l int
  595. _ = l
  596. if m.Type != 0 {
  597. n += 1 + sovCanonical(uint64(m.Type))
  598. }
  599. if m.Height != 0 {
  600. n += 9
  601. }
  602. if m.Round != 0 {
  603. n += 9
  604. }
  605. if m.BlockID != nil {
  606. l = m.BlockID.Size()
  607. n += 1 + l + sovCanonical(uint64(l))
  608. }
  609. l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
  610. n += 1 + l + sovCanonical(uint64(l))
  611. l = len(m.ChainID)
  612. if l > 0 {
  613. n += 1 + l + sovCanonical(uint64(l))
  614. }
  615. return n
  616. }
  617. func sovCanonical(x uint64) (n int) {
  618. return (math_bits.Len64(x|1) + 6) / 7
  619. }
  620. func sozCanonical(x uint64) (n int) {
  621. return sovCanonical(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  622. }
  623. func (m *CanonicalBlockID) Unmarshal(dAtA []byte) error {
  624. l := len(dAtA)
  625. iNdEx := 0
  626. for iNdEx < l {
  627. preIndex := iNdEx
  628. var wire uint64
  629. for shift := uint(0); ; shift += 7 {
  630. if shift >= 64 {
  631. return ErrIntOverflowCanonical
  632. }
  633. if iNdEx >= l {
  634. return io.ErrUnexpectedEOF
  635. }
  636. b := dAtA[iNdEx]
  637. iNdEx++
  638. wire |= uint64(b&0x7F) << shift
  639. if b < 0x80 {
  640. break
  641. }
  642. }
  643. fieldNum := int32(wire >> 3)
  644. wireType := int(wire & 0x7)
  645. if wireType == 4 {
  646. return fmt.Errorf("proto: CanonicalBlockID: wiretype end group for non-group")
  647. }
  648. if fieldNum <= 0 {
  649. return fmt.Errorf("proto: CanonicalBlockID: illegal tag %d (wire type %d)", fieldNum, wire)
  650. }
  651. switch fieldNum {
  652. case 1:
  653. if wireType != 2 {
  654. return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType)
  655. }
  656. var byteLen int
  657. for shift := uint(0); ; shift += 7 {
  658. if shift >= 64 {
  659. return ErrIntOverflowCanonical
  660. }
  661. if iNdEx >= l {
  662. return io.ErrUnexpectedEOF
  663. }
  664. b := dAtA[iNdEx]
  665. iNdEx++
  666. byteLen |= int(b&0x7F) << shift
  667. if b < 0x80 {
  668. break
  669. }
  670. }
  671. if byteLen < 0 {
  672. return ErrInvalidLengthCanonical
  673. }
  674. postIndex := iNdEx + byteLen
  675. if postIndex < 0 {
  676. return ErrInvalidLengthCanonical
  677. }
  678. if postIndex > l {
  679. return io.ErrUnexpectedEOF
  680. }
  681. m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...)
  682. if m.Hash == nil {
  683. m.Hash = []byte{}
  684. }
  685. iNdEx = postIndex
  686. case 2:
  687. if wireType != 2 {
  688. return fmt.Errorf("proto: wrong wireType = %d for field PartsHeader", wireType)
  689. }
  690. var msglen int
  691. for shift := uint(0); ; shift += 7 {
  692. if shift >= 64 {
  693. return ErrIntOverflowCanonical
  694. }
  695. if iNdEx >= l {
  696. return io.ErrUnexpectedEOF
  697. }
  698. b := dAtA[iNdEx]
  699. iNdEx++
  700. msglen |= int(b&0x7F) << shift
  701. if b < 0x80 {
  702. break
  703. }
  704. }
  705. if msglen < 0 {
  706. return ErrInvalidLengthCanonical
  707. }
  708. postIndex := iNdEx + msglen
  709. if postIndex < 0 {
  710. return ErrInvalidLengthCanonical
  711. }
  712. if postIndex > l {
  713. return io.ErrUnexpectedEOF
  714. }
  715. if err := m.PartsHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  716. return err
  717. }
  718. iNdEx = postIndex
  719. default:
  720. iNdEx = preIndex
  721. skippy, err := skipCanonical(dAtA[iNdEx:])
  722. if err != nil {
  723. return err
  724. }
  725. if skippy < 0 {
  726. return ErrInvalidLengthCanonical
  727. }
  728. if (iNdEx + skippy) < 0 {
  729. return ErrInvalidLengthCanonical
  730. }
  731. if (iNdEx + skippy) > l {
  732. return io.ErrUnexpectedEOF
  733. }
  734. iNdEx += skippy
  735. }
  736. }
  737. if iNdEx > l {
  738. return io.ErrUnexpectedEOF
  739. }
  740. return nil
  741. }
  742. func (m *CanonicalPartSetHeader) Unmarshal(dAtA []byte) error {
  743. l := len(dAtA)
  744. iNdEx := 0
  745. for iNdEx < l {
  746. preIndex := iNdEx
  747. var wire uint64
  748. for shift := uint(0); ; shift += 7 {
  749. if shift >= 64 {
  750. return ErrIntOverflowCanonical
  751. }
  752. if iNdEx >= l {
  753. return io.ErrUnexpectedEOF
  754. }
  755. b := dAtA[iNdEx]
  756. iNdEx++
  757. wire |= uint64(b&0x7F) << shift
  758. if b < 0x80 {
  759. break
  760. }
  761. }
  762. fieldNum := int32(wire >> 3)
  763. wireType := int(wire & 0x7)
  764. if wireType == 4 {
  765. return fmt.Errorf("proto: CanonicalPartSetHeader: wiretype end group for non-group")
  766. }
  767. if fieldNum <= 0 {
  768. return fmt.Errorf("proto: CanonicalPartSetHeader: illegal tag %d (wire type %d)", fieldNum, wire)
  769. }
  770. switch fieldNum {
  771. case 1:
  772. if wireType != 0 {
  773. return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
  774. }
  775. m.Total = 0
  776. for shift := uint(0); ; shift += 7 {
  777. if shift >= 64 {
  778. return ErrIntOverflowCanonical
  779. }
  780. if iNdEx >= l {
  781. return io.ErrUnexpectedEOF
  782. }
  783. b := dAtA[iNdEx]
  784. iNdEx++
  785. m.Total |= uint32(b&0x7F) << shift
  786. if b < 0x80 {
  787. break
  788. }
  789. }
  790. case 2:
  791. if wireType != 2 {
  792. return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType)
  793. }
  794. var byteLen int
  795. for shift := uint(0); ; shift += 7 {
  796. if shift >= 64 {
  797. return ErrIntOverflowCanonical
  798. }
  799. if iNdEx >= l {
  800. return io.ErrUnexpectedEOF
  801. }
  802. b := dAtA[iNdEx]
  803. iNdEx++
  804. byteLen |= int(b&0x7F) << shift
  805. if b < 0x80 {
  806. break
  807. }
  808. }
  809. if byteLen < 0 {
  810. return ErrInvalidLengthCanonical
  811. }
  812. postIndex := iNdEx + byteLen
  813. if postIndex < 0 {
  814. return ErrInvalidLengthCanonical
  815. }
  816. if postIndex > l {
  817. return io.ErrUnexpectedEOF
  818. }
  819. m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...)
  820. if m.Hash == nil {
  821. m.Hash = []byte{}
  822. }
  823. iNdEx = postIndex
  824. default:
  825. iNdEx = preIndex
  826. skippy, err := skipCanonical(dAtA[iNdEx:])
  827. if err != nil {
  828. return err
  829. }
  830. if skippy < 0 {
  831. return ErrInvalidLengthCanonical
  832. }
  833. if (iNdEx + skippy) < 0 {
  834. return ErrInvalidLengthCanonical
  835. }
  836. if (iNdEx + skippy) > l {
  837. return io.ErrUnexpectedEOF
  838. }
  839. iNdEx += skippy
  840. }
  841. }
  842. if iNdEx > l {
  843. return io.ErrUnexpectedEOF
  844. }
  845. return nil
  846. }
  847. func (m *CanonicalProposal) Unmarshal(dAtA []byte) error {
  848. l := len(dAtA)
  849. iNdEx := 0
  850. for iNdEx < l {
  851. preIndex := iNdEx
  852. var wire uint64
  853. for shift := uint(0); ; shift += 7 {
  854. if shift >= 64 {
  855. return ErrIntOverflowCanonical
  856. }
  857. if iNdEx >= l {
  858. return io.ErrUnexpectedEOF
  859. }
  860. b := dAtA[iNdEx]
  861. iNdEx++
  862. wire |= uint64(b&0x7F) << shift
  863. if b < 0x80 {
  864. break
  865. }
  866. }
  867. fieldNum := int32(wire >> 3)
  868. wireType := int(wire & 0x7)
  869. if wireType == 4 {
  870. return fmt.Errorf("proto: CanonicalProposal: wiretype end group for non-group")
  871. }
  872. if fieldNum <= 0 {
  873. return fmt.Errorf("proto: CanonicalProposal: illegal tag %d (wire type %d)", fieldNum, wire)
  874. }
  875. switch fieldNum {
  876. case 1:
  877. if wireType != 0 {
  878. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  879. }
  880. m.Type = 0
  881. for shift := uint(0); ; shift += 7 {
  882. if shift >= 64 {
  883. return ErrIntOverflowCanonical
  884. }
  885. if iNdEx >= l {
  886. return io.ErrUnexpectedEOF
  887. }
  888. b := dAtA[iNdEx]
  889. iNdEx++
  890. m.Type |= SignedMsgType(b&0x7F) << shift
  891. if b < 0x80 {
  892. break
  893. }
  894. }
  895. case 2:
  896. if wireType != 1 {
  897. return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
  898. }
  899. m.Height = 0
  900. if (iNdEx + 8) > l {
  901. return io.ErrUnexpectedEOF
  902. }
  903. m.Height = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))
  904. iNdEx += 8
  905. case 3:
  906. if wireType != 1 {
  907. return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType)
  908. }
  909. m.Round = 0
  910. if (iNdEx + 8) > l {
  911. return io.ErrUnexpectedEOF
  912. }
  913. m.Round = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))
  914. iNdEx += 8
  915. case 4:
  916. if wireType != 0 {
  917. return fmt.Errorf("proto: wrong wireType = %d for field POLRound", wireType)
  918. }
  919. m.POLRound = 0
  920. for shift := uint(0); ; shift += 7 {
  921. if shift >= 64 {
  922. return ErrIntOverflowCanonical
  923. }
  924. if iNdEx >= l {
  925. return io.ErrUnexpectedEOF
  926. }
  927. b := dAtA[iNdEx]
  928. iNdEx++
  929. m.POLRound |= int64(b&0x7F) << shift
  930. if b < 0x80 {
  931. break
  932. }
  933. }
  934. case 5:
  935. if wireType != 2 {
  936. return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType)
  937. }
  938. var msglen int
  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. msglen |= int(b&0x7F) << shift
  949. if b < 0x80 {
  950. break
  951. }
  952. }
  953. if msglen < 0 {
  954. return ErrInvalidLengthCanonical
  955. }
  956. postIndex := iNdEx + msglen
  957. if postIndex < 0 {
  958. return ErrInvalidLengthCanonical
  959. }
  960. if postIndex > l {
  961. return io.ErrUnexpectedEOF
  962. }
  963. if m.BlockID == nil {
  964. m.BlockID = &CanonicalBlockID{}
  965. }
  966. if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  967. return err
  968. }
  969. iNdEx = postIndex
  970. case 6:
  971. if wireType != 2 {
  972. return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
  973. }
  974. var msglen int
  975. for shift := uint(0); ; shift += 7 {
  976. if shift >= 64 {
  977. return ErrIntOverflowCanonical
  978. }
  979. if iNdEx >= l {
  980. return io.ErrUnexpectedEOF
  981. }
  982. b := dAtA[iNdEx]
  983. iNdEx++
  984. msglen |= int(b&0x7F) << shift
  985. if b < 0x80 {
  986. break
  987. }
  988. }
  989. if msglen < 0 {
  990. return ErrInvalidLengthCanonical
  991. }
  992. postIndex := iNdEx + msglen
  993. if postIndex < 0 {
  994. return ErrInvalidLengthCanonical
  995. }
  996. if postIndex > l {
  997. return io.ErrUnexpectedEOF
  998. }
  999. if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
  1000. return err
  1001. }
  1002. iNdEx = postIndex
  1003. case 7:
  1004. if wireType != 2 {
  1005. return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType)
  1006. }
  1007. var stringLen uint64
  1008. for shift := uint(0); ; shift += 7 {
  1009. if shift >= 64 {
  1010. return ErrIntOverflowCanonical
  1011. }
  1012. if iNdEx >= l {
  1013. return io.ErrUnexpectedEOF
  1014. }
  1015. b := dAtA[iNdEx]
  1016. iNdEx++
  1017. stringLen |= uint64(b&0x7F) << shift
  1018. if b < 0x80 {
  1019. break
  1020. }
  1021. }
  1022. intStringLen := int(stringLen)
  1023. if intStringLen < 0 {
  1024. return ErrInvalidLengthCanonical
  1025. }
  1026. postIndex := iNdEx + intStringLen
  1027. if postIndex < 0 {
  1028. return ErrInvalidLengthCanonical
  1029. }
  1030. if postIndex > l {
  1031. return io.ErrUnexpectedEOF
  1032. }
  1033. m.ChainID = string(dAtA[iNdEx:postIndex])
  1034. iNdEx = postIndex
  1035. default:
  1036. iNdEx = preIndex
  1037. skippy, err := skipCanonical(dAtA[iNdEx:])
  1038. if err != nil {
  1039. return err
  1040. }
  1041. if skippy < 0 {
  1042. return ErrInvalidLengthCanonical
  1043. }
  1044. if (iNdEx + skippy) < 0 {
  1045. return ErrInvalidLengthCanonical
  1046. }
  1047. if (iNdEx + skippy) > l {
  1048. return io.ErrUnexpectedEOF
  1049. }
  1050. iNdEx += skippy
  1051. }
  1052. }
  1053. if iNdEx > l {
  1054. return io.ErrUnexpectedEOF
  1055. }
  1056. return nil
  1057. }
  1058. func (m *CanonicalVote) Unmarshal(dAtA []byte) error {
  1059. l := len(dAtA)
  1060. iNdEx := 0
  1061. for iNdEx < l {
  1062. preIndex := iNdEx
  1063. var wire uint64
  1064. for shift := uint(0); ; shift += 7 {
  1065. if shift >= 64 {
  1066. return ErrIntOverflowCanonical
  1067. }
  1068. if iNdEx >= l {
  1069. return io.ErrUnexpectedEOF
  1070. }
  1071. b := dAtA[iNdEx]
  1072. iNdEx++
  1073. wire |= uint64(b&0x7F) << shift
  1074. if b < 0x80 {
  1075. break
  1076. }
  1077. }
  1078. fieldNum := int32(wire >> 3)
  1079. wireType := int(wire & 0x7)
  1080. if wireType == 4 {
  1081. return fmt.Errorf("proto: CanonicalVote: wiretype end group for non-group")
  1082. }
  1083. if fieldNum <= 0 {
  1084. return fmt.Errorf("proto: CanonicalVote: illegal tag %d (wire type %d)", fieldNum, wire)
  1085. }
  1086. switch fieldNum {
  1087. case 1:
  1088. if wireType != 0 {
  1089. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1090. }
  1091. m.Type = 0
  1092. for shift := uint(0); ; shift += 7 {
  1093. if shift >= 64 {
  1094. return ErrIntOverflowCanonical
  1095. }
  1096. if iNdEx >= l {
  1097. return io.ErrUnexpectedEOF
  1098. }
  1099. b := dAtA[iNdEx]
  1100. iNdEx++
  1101. m.Type |= SignedMsgType(b&0x7F) << shift
  1102. if b < 0x80 {
  1103. break
  1104. }
  1105. }
  1106. case 2:
  1107. if wireType != 1 {
  1108. return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
  1109. }
  1110. m.Height = 0
  1111. if (iNdEx + 8) > l {
  1112. return io.ErrUnexpectedEOF
  1113. }
  1114. m.Height = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))
  1115. iNdEx += 8
  1116. case 3:
  1117. if wireType != 1 {
  1118. return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType)
  1119. }
  1120. m.Round = 0
  1121. if (iNdEx + 8) > l {
  1122. return io.ErrUnexpectedEOF
  1123. }
  1124. m.Round = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))
  1125. iNdEx += 8
  1126. case 4:
  1127. if wireType != 2 {
  1128. return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType)
  1129. }
  1130. var msglen int
  1131. for shift := uint(0); ; shift += 7 {
  1132. if shift >= 64 {
  1133. return ErrIntOverflowCanonical
  1134. }
  1135. if iNdEx >= l {
  1136. return io.ErrUnexpectedEOF
  1137. }
  1138. b := dAtA[iNdEx]
  1139. iNdEx++
  1140. msglen |= int(b&0x7F) << shift
  1141. if b < 0x80 {
  1142. break
  1143. }
  1144. }
  1145. if msglen < 0 {
  1146. return ErrInvalidLengthCanonical
  1147. }
  1148. postIndex := iNdEx + msglen
  1149. if postIndex < 0 {
  1150. return ErrInvalidLengthCanonical
  1151. }
  1152. if postIndex > l {
  1153. return io.ErrUnexpectedEOF
  1154. }
  1155. if m.BlockID == nil {
  1156. m.BlockID = &CanonicalBlockID{}
  1157. }
  1158. if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1159. return err
  1160. }
  1161. iNdEx = postIndex
  1162. case 5:
  1163. if wireType != 2 {
  1164. return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
  1165. }
  1166. var msglen int
  1167. for shift := uint(0); ; shift += 7 {
  1168. if shift >= 64 {
  1169. return ErrIntOverflowCanonical
  1170. }
  1171. if iNdEx >= l {
  1172. return io.ErrUnexpectedEOF
  1173. }
  1174. b := dAtA[iNdEx]
  1175. iNdEx++
  1176. msglen |= int(b&0x7F) << shift
  1177. if b < 0x80 {
  1178. break
  1179. }
  1180. }
  1181. if msglen < 0 {
  1182. return ErrInvalidLengthCanonical
  1183. }
  1184. postIndex := iNdEx + msglen
  1185. if postIndex < 0 {
  1186. return ErrInvalidLengthCanonical
  1187. }
  1188. if postIndex > l {
  1189. return io.ErrUnexpectedEOF
  1190. }
  1191. if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
  1192. return err
  1193. }
  1194. iNdEx = postIndex
  1195. case 6:
  1196. if wireType != 2 {
  1197. return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType)
  1198. }
  1199. var stringLen uint64
  1200. for shift := uint(0); ; shift += 7 {
  1201. if shift >= 64 {
  1202. return ErrIntOverflowCanonical
  1203. }
  1204. if iNdEx >= l {
  1205. return io.ErrUnexpectedEOF
  1206. }
  1207. b := dAtA[iNdEx]
  1208. iNdEx++
  1209. stringLen |= uint64(b&0x7F) << shift
  1210. if b < 0x80 {
  1211. break
  1212. }
  1213. }
  1214. intStringLen := int(stringLen)
  1215. if intStringLen < 0 {
  1216. return ErrInvalidLengthCanonical
  1217. }
  1218. postIndex := iNdEx + intStringLen
  1219. if postIndex < 0 {
  1220. return ErrInvalidLengthCanonical
  1221. }
  1222. if postIndex > l {
  1223. return io.ErrUnexpectedEOF
  1224. }
  1225. m.ChainID = string(dAtA[iNdEx:postIndex])
  1226. iNdEx = postIndex
  1227. default:
  1228. iNdEx = preIndex
  1229. skippy, err := skipCanonical(dAtA[iNdEx:])
  1230. if err != nil {
  1231. return err
  1232. }
  1233. if skippy < 0 {
  1234. return ErrInvalidLengthCanonical
  1235. }
  1236. if (iNdEx + skippy) < 0 {
  1237. return ErrInvalidLengthCanonical
  1238. }
  1239. if (iNdEx + skippy) > l {
  1240. return io.ErrUnexpectedEOF
  1241. }
  1242. iNdEx += skippy
  1243. }
  1244. }
  1245. if iNdEx > l {
  1246. return io.ErrUnexpectedEOF
  1247. }
  1248. return nil
  1249. }
  1250. func skipCanonical(dAtA []byte) (n int, err error) {
  1251. l := len(dAtA)
  1252. iNdEx := 0
  1253. depth := 0
  1254. for iNdEx < l {
  1255. var wire uint64
  1256. for shift := uint(0); ; shift += 7 {
  1257. if shift >= 64 {
  1258. return 0, ErrIntOverflowCanonical
  1259. }
  1260. if iNdEx >= l {
  1261. return 0, io.ErrUnexpectedEOF
  1262. }
  1263. b := dAtA[iNdEx]
  1264. iNdEx++
  1265. wire |= (uint64(b) & 0x7F) << shift
  1266. if b < 0x80 {
  1267. break
  1268. }
  1269. }
  1270. wireType := int(wire & 0x7)
  1271. switch wireType {
  1272. case 0:
  1273. for shift := uint(0); ; shift += 7 {
  1274. if shift >= 64 {
  1275. return 0, ErrIntOverflowCanonical
  1276. }
  1277. if iNdEx >= l {
  1278. return 0, io.ErrUnexpectedEOF
  1279. }
  1280. iNdEx++
  1281. if dAtA[iNdEx-1] < 0x80 {
  1282. break
  1283. }
  1284. }
  1285. case 1:
  1286. iNdEx += 8
  1287. case 2:
  1288. var length int
  1289. for shift := uint(0); ; shift += 7 {
  1290. if shift >= 64 {
  1291. return 0, ErrIntOverflowCanonical
  1292. }
  1293. if iNdEx >= l {
  1294. return 0, io.ErrUnexpectedEOF
  1295. }
  1296. b := dAtA[iNdEx]
  1297. iNdEx++
  1298. length |= (int(b) & 0x7F) << shift
  1299. if b < 0x80 {
  1300. break
  1301. }
  1302. }
  1303. if length < 0 {
  1304. return 0, ErrInvalidLengthCanonical
  1305. }
  1306. iNdEx += length
  1307. case 3:
  1308. depth++
  1309. case 4:
  1310. if depth == 0 {
  1311. return 0, ErrUnexpectedEndOfGroupCanonical
  1312. }
  1313. depth--
  1314. case 5:
  1315. iNdEx += 4
  1316. default:
  1317. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1318. }
  1319. if iNdEx < 0 {
  1320. return 0, ErrInvalidLengthCanonical
  1321. }
  1322. if depth == 0 {
  1323. return iNdEx, nil
  1324. }
  1325. }
  1326. return 0, io.ErrUnexpectedEOF
  1327. }
  1328. var (
  1329. ErrInvalidLengthCanonical = fmt.Errorf("proto: negative length found during unmarshaling")
  1330. ErrIntOverflowCanonical = fmt.Errorf("proto: integer overflow")
  1331. ErrUnexpectedEndOfGroupCanonical = fmt.Errorf("proto: unexpected end of group")
  1332. )