github.com/Oyster-zx/tendermint@v0.34.24-fork/proto/tendermint/types/block.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: tendermint/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  	io "io"
    11  	math "math"
    12  	math_bits "math/bits"
    13  )
    14  
    15  // Reference imports to suppress errors if they are not otherwise used.
    16  var _ = proto.Marshal
    17  var _ = fmt.Errorf
    18  var _ = math.Inf
    19  
    20  // This is a compile-time assertion to ensure that this generated file
    21  // is compatible with the proto package it is being compiled against.
    22  // A compilation error at this line likely means your copy of the
    23  // proto package needs to be updated.
    24  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    25  
    26  type Block struct {
    27  	Header     Header       `protobuf:"bytes,1,opt,name=header,proto3" json:"header"`
    28  	Data       Data         `protobuf:"bytes,2,opt,name=data,proto3" json:"data"`
    29  	Evidence   EvidenceList `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"`
    30  	LastCommit *Commit      `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"`
    31  }
    32  
    33  func (m *Block) Reset()         { *m = Block{} }
    34  func (m *Block) String() string { return proto.CompactTextString(m) }
    35  func (*Block) ProtoMessage()    {}
    36  func (*Block) Descriptor() ([]byte, []int) {
    37  	return fileDescriptor_70840e82f4357ab1, []int{0}
    38  }
    39  func (m *Block) XXX_Unmarshal(b []byte) error {
    40  	return m.Unmarshal(b)
    41  }
    42  func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    43  	if deterministic {
    44  		return xxx_messageInfo_Block.Marshal(b, m, deterministic)
    45  	} else {
    46  		b = b[:cap(b)]
    47  		n, err := m.MarshalToSizedBuffer(b)
    48  		if err != nil {
    49  			return nil, err
    50  		}
    51  		return b[:n], nil
    52  	}
    53  }
    54  func (m *Block) XXX_Merge(src proto.Message) {
    55  	xxx_messageInfo_Block.Merge(m, src)
    56  }
    57  func (m *Block) XXX_Size() int {
    58  	return m.Size()
    59  }
    60  func (m *Block) XXX_DiscardUnknown() {
    61  	xxx_messageInfo_Block.DiscardUnknown(m)
    62  }
    63  
    64  var xxx_messageInfo_Block proto.InternalMessageInfo
    65  
    66  func (m *Block) GetHeader() Header {
    67  	if m != nil {
    68  		return m.Header
    69  	}
    70  	return Header{}
    71  }
    72  
    73  func (m *Block) GetData() Data {
    74  	if m != nil {
    75  		return m.Data
    76  	}
    77  	return Data{}
    78  }
    79  
    80  func (m *Block) GetEvidence() EvidenceList {
    81  	if m != nil {
    82  		return m.Evidence
    83  	}
    84  	return EvidenceList{}
    85  }
    86  
    87  func (m *Block) GetLastCommit() *Commit {
    88  	if m != nil {
    89  		return m.LastCommit
    90  	}
    91  	return nil
    92  }
    93  
    94  func init() {
    95  	proto.RegisterType((*Block)(nil), "tendermint.types.Block")
    96  }
    97  
    98  func init() { proto.RegisterFile("tendermint/types/block.proto", fileDescriptor_70840e82f4357ab1) }
    99  
   100  var fileDescriptor_70840e82f4357ab1 = []byte{
   101  	// 266 bytes of a gzipped FileDescriptorProto
   102  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0x49, 0xcd, 0x4b,
   103  	0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xca, 0xc9,
   104  	0x4f, 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0xc8, 0xea, 0x81, 0x65, 0xa5,
   105  	0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x92, 0xfa, 0x20, 0x16, 0x44, 0x9d, 0x14, 0xa6, 0x29, 0x60,
   106  	0x12, 0x2a, 0x2b, 0x8f, 0x21, 0x9b, 0x5a, 0x96, 0x99, 0x92, 0x9a, 0x97, 0x9c, 0x0a, 0x51, 0xa0,
   107  	0xf4, 0x8e, 0x91, 0x8b, 0xd5, 0x09, 0x64, 0xad, 0x90, 0x19, 0x17, 0x5b, 0x46, 0x6a, 0x62, 0x4a,
   108  	0x6a, 0x91, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x84, 0x1e, 0xba, 0x0b, 0xf4, 0x3c, 0xc0,
   109  	0xf2, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x55, 0x0b, 0x19, 0x70, 0xb1, 0xa4, 0x24,
   110  	0x96, 0x24, 0x4a, 0x30, 0x81, 0x75, 0x89, 0x61, 0xea, 0x72, 0x49, 0x2c, 0x49, 0x84, 0xea, 0x01,
   111  	0xab, 0x14, 0x72, 0xe0, 0xe2, 0x80, 0xb9, 0x42, 0x82, 0x19, 0xac, 0x4b, 0x0e, 0x53, 0x97, 0x2b,
   112  	0x54, 0x85, 0x4f, 0x66, 0x71, 0x09, 0x54, 0x37, 0x5c, 0x97, 0x90, 0x25, 0x17, 0x77, 0x4e, 0x62,
   113  	0x71, 0x49, 0x7c, 0x72, 0x7e, 0x6e, 0x6e, 0x66, 0x89, 0x04, 0x0b, 0x2e, 0x07, 0x3b, 0x83, 0xe5,
   114  	0x83, 0xb8, 0x40, 0x8a, 0x21, 0x6c, 0xa7, 0xc0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63,
   115  	0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96,
   116  	0x63, 0x88, 0x32, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x0e,
   117  	0x36, 0x04, 0x13, 0x12, 0xf8, 0xe8, 0x41, 0x9a, 0xc4, 0x06, 0x16, 0x37, 0x06, 0x04, 0x00, 0x00,
   118  	0xff, 0xff, 0x79, 0x8c, 0xb5, 0x43, 0xd1, 0x01, 0x00, 0x00,
   119  }
   120  
   121  func (m *Block) Marshal() (dAtA []byte, err error) {
   122  	size := m.Size()
   123  	dAtA = make([]byte, size)
   124  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   125  	if err != nil {
   126  		return nil, err
   127  	}
   128  	return dAtA[:n], nil
   129  }
   130  
   131  func (m *Block) MarshalTo(dAtA []byte) (int, error) {
   132  	size := m.Size()
   133  	return m.MarshalToSizedBuffer(dAtA[:size])
   134  }
   135  
   136  func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   137  	i := len(dAtA)
   138  	_ = i
   139  	var l int
   140  	_ = l
   141  	if m.LastCommit != nil {
   142  		{
   143  			size, err := m.LastCommit.MarshalToSizedBuffer(dAtA[:i])
   144  			if err != nil {
   145  				return 0, err
   146  			}
   147  			i -= size
   148  			i = encodeVarintBlock(dAtA, i, uint64(size))
   149  		}
   150  		i--
   151  		dAtA[i] = 0x22
   152  	}
   153  	{
   154  		size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i])
   155  		if err != nil {
   156  			return 0, err
   157  		}
   158  		i -= size
   159  		i = encodeVarintBlock(dAtA, i, uint64(size))
   160  	}
   161  	i--
   162  	dAtA[i] = 0x1a
   163  	{
   164  		size, err := m.Data.MarshalToSizedBuffer(dAtA[:i])
   165  		if err != nil {
   166  			return 0, err
   167  		}
   168  		i -= size
   169  		i = encodeVarintBlock(dAtA, i, uint64(size))
   170  	}
   171  	i--
   172  	dAtA[i] = 0x12
   173  	{
   174  		size, err := m.Header.MarshalToSizedBuffer(dAtA[:i])
   175  		if err != nil {
   176  			return 0, err
   177  		}
   178  		i -= size
   179  		i = encodeVarintBlock(dAtA, i, uint64(size))
   180  	}
   181  	i--
   182  	dAtA[i] = 0xa
   183  	return len(dAtA) - i, nil
   184  }
   185  
   186  func encodeVarintBlock(dAtA []byte, offset int, v uint64) int {
   187  	offset -= sovBlock(v)
   188  	base := offset
   189  	for v >= 1<<7 {
   190  		dAtA[offset] = uint8(v&0x7f | 0x80)
   191  		v >>= 7
   192  		offset++
   193  	}
   194  	dAtA[offset] = uint8(v)
   195  	return base
   196  }
   197  func (m *Block) Size() (n int) {
   198  	if m == nil {
   199  		return 0
   200  	}
   201  	var l int
   202  	_ = l
   203  	l = m.Header.Size()
   204  	n += 1 + l + sovBlock(uint64(l))
   205  	l = m.Data.Size()
   206  	n += 1 + l + sovBlock(uint64(l))
   207  	l = m.Evidence.Size()
   208  	n += 1 + l + sovBlock(uint64(l))
   209  	if m.LastCommit != nil {
   210  		l = m.LastCommit.Size()
   211  		n += 1 + l + sovBlock(uint64(l))
   212  	}
   213  	return n
   214  }
   215  
   216  func sovBlock(x uint64) (n int) {
   217  	return (math_bits.Len64(x|1) + 6) / 7
   218  }
   219  func sozBlock(x uint64) (n int) {
   220  	return sovBlock(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   221  }
   222  func (m *Block) Unmarshal(dAtA []byte) error {
   223  	l := len(dAtA)
   224  	iNdEx := 0
   225  	for iNdEx < l {
   226  		preIndex := iNdEx
   227  		var wire uint64
   228  		for shift := uint(0); ; shift += 7 {
   229  			if shift >= 64 {
   230  				return ErrIntOverflowBlock
   231  			}
   232  			if iNdEx >= l {
   233  				return io.ErrUnexpectedEOF
   234  			}
   235  			b := dAtA[iNdEx]
   236  			iNdEx++
   237  			wire |= uint64(b&0x7F) << shift
   238  			if b < 0x80 {
   239  				break
   240  			}
   241  		}
   242  		fieldNum := int32(wire >> 3)
   243  		wireType := int(wire & 0x7)
   244  		if wireType == 4 {
   245  			return fmt.Errorf("proto: Block: wiretype end group for non-group")
   246  		}
   247  		if fieldNum <= 0 {
   248  			return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire)
   249  		}
   250  		switch fieldNum {
   251  		case 1:
   252  			if wireType != 2 {
   253  				return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
   254  			}
   255  			var msglen int
   256  			for shift := uint(0); ; shift += 7 {
   257  				if shift >= 64 {
   258  					return ErrIntOverflowBlock
   259  				}
   260  				if iNdEx >= l {
   261  					return io.ErrUnexpectedEOF
   262  				}
   263  				b := dAtA[iNdEx]
   264  				iNdEx++
   265  				msglen |= int(b&0x7F) << shift
   266  				if b < 0x80 {
   267  					break
   268  				}
   269  			}
   270  			if msglen < 0 {
   271  				return ErrInvalidLengthBlock
   272  			}
   273  			postIndex := iNdEx + msglen
   274  			if postIndex < 0 {
   275  				return ErrInvalidLengthBlock
   276  			}
   277  			if postIndex > l {
   278  				return io.ErrUnexpectedEOF
   279  			}
   280  			if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   281  				return err
   282  			}
   283  			iNdEx = postIndex
   284  		case 2:
   285  			if wireType != 2 {
   286  				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
   287  			}
   288  			var msglen int
   289  			for shift := uint(0); ; shift += 7 {
   290  				if shift >= 64 {
   291  					return ErrIntOverflowBlock
   292  				}
   293  				if iNdEx >= l {
   294  					return io.ErrUnexpectedEOF
   295  				}
   296  				b := dAtA[iNdEx]
   297  				iNdEx++
   298  				msglen |= int(b&0x7F) << shift
   299  				if b < 0x80 {
   300  					break
   301  				}
   302  			}
   303  			if msglen < 0 {
   304  				return ErrInvalidLengthBlock
   305  			}
   306  			postIndex := iNdEx + msglen
   307  			if postIndex < 0 {
   308  				return ErrInvalidLengthBlock
   309  			}
   310  			if postIndex > l {
   311  				return io.ErrUnexpectedEOF
   312  			}
   313  			if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   314  				return err
   315  			}
   316  			iNdEx = postIndex
   317  		case 3:
   318  			if wireType != 2 {
   319  				return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType)
   320  			}
   321  			var msglen int
   322  			for shift := uint(0); ; shift += 7 {
   323  				if shift >= 64 {
   324  					return ErrIntOverflowBlock
   325  				}
   326  				if iNdEx >= l {
   327  					return io.ErrUnexpectedEOF
   328  				}
   329  				b := dAtA[iNdEx]
   330  				iNdEx++
   331  				msglen |= int(b&0x7F) << shift
   332  				if b < 0x80 {
   333  					break
   334  				}
   335  			}
   336  			if msglen < 0 {
   337  				return ErrInvalidLengthBlock
   338  			}
   339  			postIndex := iNdEx + msglen
   340  			if postIndex < 0 {
   341  				return ErrInvalidLengthBlock
   342  			}
   343  			if postIndex > l {
   344  				return io.ErrUnexpectedEOF
   345  			}
   346  			if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   347  				return err
   348  			}
   349  			iNdEx = postIndex
   350  		case 4:
   351  			if wireType != 2 {
   352  				return fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType)
   353  			}
   354  			var msglen int
   355  			for shift := uint(0); ; shift += 7 {
   356  				if shift >= 64 {
   357  					return ErrIntOverflowBlock
   358  				}
   359  				if iNdEx >= l {
   360  					return io.ErrUnexpectedEOF
   361  				}
   362  				b := dAtA[iNdEx]
   363  				iNdEx++
   364  				msglen |= int(b&0x7F) << shift
   365  				if b < 0x80 {
   366  					break
   367  				}
   368  			}
   369  			if msglen < 0 {
   370  				return ErrInvalidLengthBlock
   371  			}
   372  			postIndex := iNdEx + msglen
   373  			if postIndex < 0 {
   374  				return ErrInvalidLengthBlock
   375  			}
   376  			if postIndex > l {
   377  				return io.ErrUnexpectedEOF
   378  			}
   379  			if m.LastCommit == nil {
   380  				m.LastCommit = &Commit{}
   381  			}
   382  			if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   383  				return err
   384  			}
   385  			iNdEx = postIndex
   386  		default:
   387  			iNdEx = preIndex
   388  			skippy, err := skipBlock(dAtA[iNdEx:])
   389  			if err != nil {
   390  				return err
   391  			}
   392  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   393  				return ErrInvalidLengthBlock
   394  			}
   395  			if (iNdEx + skippy) > l {
   396  				return io.ErrUnexpectedEOF
   397  			}
   398  			iNdEx += skippy
   399  		}
   400  	}
   401  
   402  	if iNdEx > l {
   403  		return io.ErrUnexpectedEOF
   404  	}
   405  	return nil
   406  }
   407  func skipBlock(dAtA []byte) (n int, err error) {
   408  	l := len(dAtA)
   409  	iNdEx := 0
   410  	depth := 0
   411  	for iNdEx < l {
   412  		var wire uint64
   413  		for shift := uint(0); ; shift += 7 {
   414  			if shift >= 64 {
   415  				return 0, ErrIntOverflowBlock
   416  			}
   417  			if iNdEx >= l {
   418  				return 0, io.ErrUnexpectedEOF
   419  			}
   420  			b := dAtA[iNdEx]
   421  			iNdEx++
   422  			wire |= (uint64(b) & 0x7F) << shift
   423  			if b < 0x80 {
   424  				break
   425  			}
   426  		}
   427  		wireType := int(wire & 0x7)
   428  		switch wireType {
   429  		case 0:
   430  			for shift := uint(0); ; shift += 7 {
   431  				if shift >= 64 {
   432  					return 0, ErrIntOverflowBlock
   433  				}
   434  				if iNdEx >= l {
   435  					return 0, io.ErrUnexpectedEOF
   436  				}
   437  				iNdEx++
   438  				if dAtA[iNdEx-1] < 0x80 {
   439  					break
   440  				}
   441  			}
   442  		case 1:
   443  			iNdEx += 8
   444  		case 2:
   445  			var length int
   446  			for shift := uint(0); ; shift += 7 {
   447  				if shift >= 64 {
   448  					return 0, ErrIntOverflowBlock
   449  				}
   450  				if iNdEx >= l {
   451  					return 0, io.ErrUnexpectedEOF
   452  				}
   453  				b := dAtA[iNdEx]
   454  				iNdEx++
   455  				length |= (int(b) & 0x7F) << shift
   456  				if b < 0x80 {
   457  					break
   458  				}
   459  			}
   460  			if length < 0 {
   461  				return 0, ErrInvalidLengthBlock
   462  			}
   463  			iNdEx += length
   464  		case 3:
   465  			depth++
   466  		case 4:
   467  			if depth == 0 {
   468  				return 0, ErrUnexpectedEndOfGroupBlock
   469  			}
   470  			depth--
   471  		case 5:
   472  			iNdEx += 4
   473  		default:
   474  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   475  		}
   476  		if iNdEx < 0 {
   477  			return 0, ErrInvalidLengthBlock
   478  		}
   479  		if depth == 0 {
   480  			return iNdEx, nil
   481  		}
   482  	}
   483  	return 0, io.ErrUnexpectedEOF
   484  }
   485  
   486  var (
   487  	ErrInvalidLengthBlock        = fmt.Errorf("proto: negative length found during unmarshaling")
   488  	ErrIntOverflowBlock          = fmt.Errorf("proto: integer overflow")
   489  	ErrUnexpectedEndOfGroupBlock = fmt.Errorf("proto: unexpected end of group")
   490  )