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