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