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