github.com/line/ostracon@v1.0.10-0.20230328032236-7f20145f065d/proto/ostracon/types/block.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: ostracon/types/block.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 _ "github.com/gogo/protobuf/gogoproto" 9 proto "github.com/gogo/protobuf/proto" 10 types "github.com/tendermint/tendermint/proto/tendermint/types" 11 io "io" 12 math "math" 13 math_bits "math/bits" 14 ) 15 16 // Reference imports to suppress errors if they are not otherwise used. 17 var _ = proto.Marshal 18 var _ = fmt.Errorf 19 var _ = math.Inf 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the proto package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // proto package needs to be updated. 25 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 26 27 type Block struct { 28 Header types.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` 29 Data types.Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` 30 Evidence types.EvidenceList `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"` 31 LastCommit *types.Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` 32 // *** Ostracon Extended Fields *** 33 Entropy Entropy `protobuf:"bytes,1000,opt,name=entropy,proto3" json:"entropy"` 34 } 35 36 func (m *Block) Reset() { *m = Block{} } 37 func (m *Block) String() string { return proto.CompactTextString(m) } 38 func (*Block) ProtoMessage() {} 39 func (*Block) Descriptor() ([]byte, []int) { 40 return fileDescriptor_69510200dee501a6, []int{0} 41 } 42 func (m *Block) XXX_Unmarshal(b []byte) error { 43 return m.Unmarshal(b) 44 } 45 func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 46 if deterministic { 47 return xxx_messageInfo_Block.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 *Block) XXX_Merge(src proto.Message) { 58 xxx_messageInfo_Block.Merge(m, src) 59 } 60 func (m *Block) XXX_Size() int { 61 return m.Size() 62 } 63 func (m *Block) XXX_DiscardUnknown() { 64 xxx_messageInfo_Block.DiscardUnknown(m) 65 } 66 67 var xxx_messageInfo_Block proto.InternalMessageInfo 68 69 func (m *Block) GetHeader() types.Header { 70 if m != nil { 71 return m.Header 72 } 73 return types.Header{} 74 } 75 76 func (m *Block) GetData() types.Data { 77 if m != nil { 78 return m.Data 79 } 80 return types.Data{} 81 } 82 83 func (m *Block) GetEvidence() types.EvidenceList { 84 if m != nil { 85 return m.Evidence 86 } 87 return types.EvidenceList{} 88 } 89 90 func (m *Block) GetLastCommit() *types.Commit { 91 if m != nil { 92 return m.LastCommit 93 } 94 return nil 95 } 96 97 func (m *Block) GetEntropy() Entropy { 98 if m != nil { 99 return m.Entropy 100 } 101 return Entropy{} 102 } 103 104 func init() { 105 proto.RegisterType((*Block)(nil), "ostracon.types.Block") 106 } 107 108 func init() { proto.RegisterFile("ostracon/types/block.proto", fileDescriptor_69510200dee501a6) } 109 110 var fileDescriptor_69510200dee501a6 = []byte{ 111 // 310 bytes of a gzipped FileDescriptorProto 112 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xb1, 0x4a, 0xc3, 0x40, 113 0x18, 0x80, 0x93, 0x5a, 0x5b, 0xb9, 0x82, 0xc3, 0x21, 0x7a, 0x14, 0xb9, 0x8a, 0x93, 0x8b, 0x17, 114 0x51, 0x10, 0xdd, 0xa4, 0x5a, 0x74, 0x70, 0xea, 0xe8, 0x22, 0x97, 0xe4, 0x48, 0x0f, 0x93, 0xbb, 115 0x90, 0xfc, 0x0a, 0x7d, 0x0b, 0x1f, 0xc3, 0x47, 0xe9, 0xd8, 0xd1, 0x49, 0x24, 0x59, 0x7c, 0x0c, 116 0xc9, 0xe5, 0x52, 0xad, 0xc1, 0x25, 0xf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, 0x36, 0xfa, 0xf8, 0x76, 0x51, 0x50, 128 0x77, 0x59, 0x50, 0xf7, 0xb3, 0xa0, 0xee, 0x6b, 0x49, 0x9d, 0x65, 0x49, 0x9d, 0xf7, 0x92, 0x3a, 129 0x0f, 0xc7, 0x91, 0x84, 0xd9, 0xb3, 0xcf, 0x02, 0x9d, 0x78, 0xb1, 0x54, 0xc2, 0x5b, 0xdd, 0xab, 130 0x3e, 0xe5, 0xfa, 0xf9, 0xfc, 0x9e, 0x79, 0x7b, 0xf6, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xea, 0xef, 131 0xa5, 0x4e, 0x19, 0x02, 0x00, 0x00, 132 } 133 134 func (m *Block) Marshal() (dAtA []byte, err error) { 135 size := m.Size() 136 dAtA = make([]byte, size) 137 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 138 if err != nil { 139 return nil, err 140 } 141 return dAtA[:n], nil 142 } 143 144 func (m *Block) MarshalTo(dAtA []byte) (int, error) { 145 size := m.Size() 146 return m.MarshalToSizedBuffer(dAtA[:size]) 147 } 148 149 func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) { 150 i := len(dAtA) 151 _ = i 152 var l int 153 _ = l 154 { 155 size, err := m.Entropy.MarshalToSizedBuffer(dAtA[:i]) 156 if err != nil { 157 return 0, err 158 } 159 i -= size 160 i = encodeVarintBlock(dAtA, i, uint64(size)) 161 } 162 i-- 163 dAtA[i] = 0x3e 164 i-- 165 dAtA[i] = 0xc2 166 if m.LastCommit != nil { 167 { 168 size, err := m.LastCommit.MarshalToSizedBuffer(dAtA[:i]) 169 if err != nil { 170 return 0, err 171 } 172 i -= size 173 i = encodeVarintBlock(dAtA, i, uint64(size)) 174 } 175 i-- 176 dAtA[i] = 0x22 177 } 178 { 179 size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) 180 if err != nil { 181 return 0, err 182 } 183 i -= size 184 i = encodeVarintBlock(dAtA, i, uint64(size)) 185 } 186 i-- 187 dAtA[i] = 0x1a 188 { 189 size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) 190 if err != nil { 191 return 0, err 192 } 193 i -= size 194 i = encodeVarintBlock(dAtA, i, uint64(size)) 195 } 196 i-- 197 dAtA[i] = 0x12 198 { 199 size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) 200 if err != nil { 201 return 0, err 202 } 203 i -= size 204 i = encodeVarintBlock(dAtA, i, uint64(size)) 205 } 206 i-- 207 dAtA[i] = 0xa 208 return len(dAtA) - i, nil 209 } 210 211 func encodeVarintBlock(dAtA []byte, offset int, v uint64) int { 212 offset -= sovBlock(v) 213 base := offset 214 for v >= 1<<7 { 215 dAtA[offset] = uint8(v&0x7f | 0x80) 216 v >>= 7 217 offset++ 218 } 219 dAtA[offset] = uint8(v) 220 return base 221 } 222 func (m *Block) Size() (n int) { 223 if m == nil { 224 return 0 225 } 226 var l int 227 _ = l 228 l = m.Header.Size() 229 n += 1 + l + sovBlock(uint64(l)) 230 l = m.Data.Size() 231 n += 1 + l + sovBlock(uint64(l)) 232 l = m.Evidence.Size() 233 n += 1 + l + sovBlock(uint64(l)) 234 if m.LastCommit != nil { 235 l = m.LastCommit.Size() 236 n += 1 + l + sovBlock(uint64(l)) 237 } 238 l = m.Entropy.Size() 239 n += 2 + l + sovBlock(uint64(l)) 240 return n 241 } 242 243 func sovBlock(x uint64) (n int) { 244 return (math_bits.Len64(x|1) + 6) / 7 245 } 246 func sozBlock(x uint64) (n int) { 247 return sovBlock(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 248 } 249 func (m *Block) Unmarshal(dAtA []byte) error { 250 l := len(dAtA) 251 iNdEx := 0 252 for iNdEx < l { 253 preIndex := iNdEx 254 var wire uint64 255 for shift := uint(0); ; shift += 7 { 256 if shift >= 64 { 257 return ErrIntOverflowBlock 258 } 259 if iNdEx >= l { 260 return io.ErrUnexpectedEOF 261 } 262 b := dAtA[iNdEx] 263 iNdEx++ 264 wire |= uint64(b&0x7F) << shift 265 if b < 0x80 { 266 break 267 } 268 } 269 fieldNum := int32(wire >> 3) 270 wireType := int(wire & 0x7) 271 if wireType == 4 { 272 return fmt.Errorf("proto: Block: wiretype end group for non-group") 273 } 274 if fieldNum <= 0 { 275 return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire) 276 } 277 switch fieldNum { 278 case 1: 279 if wireType != 2 { 280 return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) 281 } 282 var msglen int 283 for shift := uint(0); ; shift += 7 { 284 if shift >= 64 { 285 return ErrIntOverflowBlock 286 } 287 if iNdEx >= l { 288 return io.ErrUnexpectedEOF 289 } 290 b := dAtA[iNdEx] 291 iNdEx++ 292 msglen |= int(b&0x7F) << shift 293 if b < 0x80 { 294 break 295 } 296 } 297 if msglen < 0 { 298 return ErrInvalidLengthBlock 299 } 300 postIndex := iNdEx + msglen 301 if postIndex < 0 { 302 return ErrInvalidLengthBlock 303 } 304 if postIndex > l { 305 return io.ErrUnexpectedEOF 306 } 307 if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 308 return err 309 } 310 iNdEx = postIndex 311 case 2: 312 if wireType != 2 { 313 return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) 314 } 315 var msglen int 316 for shift := uint(0); ; shift += 7 { 317 if shift >= 64 { 318 return ErrIntOverflowBlock 319 } 320 if iNdEx >= l { 321 return io.ErrUnexpectedEOF 322 } 323 b := dAtA[iNdEx] 324 iNdEx++ 325 msglen |= int(b&0x7F) << shift 326 if b < 0x80 { 327 break 328 } 329 } 330 if msglen < 0 { 331 return ErrInvalidLengthBlock 332 } 333 postIndex := iNdEx + msglen 334 if postIndex < 0 { 335 return ErrInvalidLengthBlock 336 } 337 if postIndex > l { 338 return io.ErrUnexpectedEOF 339 } 340 if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 341 return err 342 } 343 iNdEx = postIndex 344 case 3: 345 if wireType != 2 { 346 return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) 347 } 348 var msglen int 349 for shift := uint(0); ; shift += 7 { 350 if shift >= 64 { 351 return ErrIntOverflowBlock 352 } 353 if iNdEx >= l { 354 return io.ErrUnexpectedEOF 355 } 356 b := dAtA[iNdEx] 357 iNdEx++ 358 msglen |= int(b&0x7F) << shift 359 if b < 0x80 { 360 break 361 } 362 } 363 if msglen < 0 { 364 return ErrInvalidLengthBlock 365 } 366 postIndex := iNdEx + msglen 367 if postIndex < 0 { 368 return ErrInvalidLengthBlock 369 } 370 if postIndex > l { 371 return io.ErrUnexpectedEOF 372 } 373 if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 374 return err 375 } 376 iNdEx = postIndex 377 case 4: 378 if wireType != 2 { 379 return fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType) 380 } 381 var msglen int 382 for shift := uint(0); ; shift += 7 { 383 if shift >= 64 { 384 return ErrIntOverflowBlock 385 } 386 if iNdEx >= l { 387 return io.ErrUnexpectedEOF 388 } 389 b := dAtA[iNdEx] 390 iNdEx++ 391 msglen |= int(b&0x7F) << shift 392 if b < 0x80 { 393 break 394 } 395 } 396 if msglen < 0 { 397 return ErrInvalidLengthBlock 398 } 399 postIndex := iNdEx + msglen 400 if postIndex < 0 { 401 return ErrInvalidLengthBlock 402 } 403 if postIndex > l { 404 return io.ErrUnexpectedEOF 405 } 406 if m.LastCommit == nil { 407 m.LastCommit = &types.Commit{} 408 } 409 if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 410 return err 411 } 412 iNdEx = postIndex 413 case 1000: 414 if wireType != 2 { 415 return fmt.Errorf("proto: wrong wireType = %d for field Entropy", wireType) 416 } 417 var msglen int 418 for shift := uint(0); ; shift += 7 { 419 if shift >= 64 { 420 return ErrIntOverflowBlock 421 } 422 if iNdEx >= l { 423 return io.ErrUnexpectedEOF 424 } 425 b := dAtA[iNdEx] 426 iNdEx++ 427 msglen |= int(b&0x7F) << shift 428 if b < 0x80 { 429 break 430 } 431 } 432 if msglen < 0 { 433 return ErrInvalidLengthBlock 434 } 435 postIndex := iNdEx + msglen 436 if postIndex < 0 { 437 return ErrInvalidLengthBlock 438 } 439 if postIndex > l { 440 return io.ErrUnexpectedEOF 441 } 442 if err := m.Entropy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 443 return err 444 } 445 iNdEx = postIndex 446 default: 447 iNdEx = preIndex 448 skippy, err := skipBlock(dAtA[iNdEx:]) 449 if err != nil { 450 return err 451 } 452 if (skippy < 0) || (iNdEx+skippy) < 0 { 453 return ErrInvalidLengthBlock 454 } 455 if (iNdEx + skippy) > l { 456 return io.ErrUnexpectedEOF 457 } 458 iNdEx += skippy 459 } 460 } 461 462 if iNdEx > l { 463 return io.ErrUnexpectedEOF 464 } 465 return nil 466 } 467 func skipBlock(dAtA []byte) (n int, err error) { 468 l := len(dAtA) 469 iNdEx := 0 470 depth := 0 471 for iNdEx < l { 472 var wire uint64 473 for shift := uint(0); ; shift += 7 { 474 if shift >= 64 { 475 return 0, ErrIntOverflowBlock 476 } 477 if iNdEx >= l { 478 return 0, io.ErrUnexpectedEOF 479 } 480 b := dAtA[iNdEx] 481 iNdEx++ 482 wire |= (uint64(b) & 0x7F) << shift 483 if b < 0x80 { 484 break 485 } 486 } 487 wireType := int(wire & 0x7) 488 switch wireType { 489 case 0: 490 for shift := uint(0); ; shift += 7 { 491 if shift >= 64 { 492 return 0, ErrIntOverflowBlock 493 } 494 if iNdEx >= l { 495 return 0, io.ErrUnexpectedEOF 496 } 497 iNdEx++ 498 if dAtA[iNdEx-1] < 0x80 { 499 break 500 } 501 } 502 case 1: 503 iNdEx += 8 504 case 2: 505 var length int 506 for shift := uint(0); ; shift += 7 { 507 if shift >= 64 { 508 return 0, ErrIntOverflowBlock 509 } 510 if iNdEx >= l { 511 return 0, io.ErrUnexpectedEOF 512 } 513 b := dAtA[iNdEx] 514 iNdEx++ 515 length |= (int(b) & 0x7F) << shift 516 if b < 0x80 { 517 break 518 } 519 } 520 if length < 0 { 521 return 0, ErrInvalidLengthBlock 522 } 523 iNdEx += length 524 case 3: 525 depth++ 526 case 4: 527 if depth == 0 { 528 return 0, ErrUnexpectedEndOfGroupBlock 529 } 530 depth-- 531 case 5: 532 iNdEx += 4 533 default: 534 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 535 } 536 if iNdEx < 0 { 537 return 0, ErrInvalidLengthBlock 538 } 539 if depth == 0 { 540 return iNdEx, nil 541 } 542 } 543 return 0, io.ErrUnexpectedEOF 544 } 545 546 var ( 547 ErrInvalidLengthBlock = fmt.Errorf("proto: negative length found during unmarshaling") 548 ErrIntOverflowBlock = fmt.Errorf("proto: integer overflow") 549 ErrUnexpectedEndOfGroupBlock = fmt.Errorf("proto: unexpected end of group") 550 )