github.com/adoriasoft/tendermint@v0.34.0-dev1.0.20200722151356-96d84601a75a/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   EvidenceData `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() EvidenceData {
    81  	if m != nil {
    82  		return m.Evidence
    83  	}
    84  	return EvidenceData{}
    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  	// 271 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, 0x05, 0x92, 0x6e, 0xb8, 0x2e, 0x21, 0x4b, 0x2e, 0xee, 0x9c, 0xc4, 0xe2, 0x92, 0xf8, 0xe4,
   113  	0xfc, 0xdc, 0xdc, 0xcc, 0x12, 0x09, 0x16, 0x5c, 0x0e, 0x76, 0x06, 0xcb, 0x07, 0x71, 0x81, 0x14,
   114  	0x43, 0xd8, 0x4e, 0x81, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c,
   115  	0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x9e,
   116  	0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x98, 0x92, 0x5f, 0x94, 0x99,
   117  	0x58, 0x9c, 0x9f, 0x56, 0xa2, 0x8f, 0x14, 0x82, 0x90, 0xc0, 0x47, 0x0f, 0xd2, 0x24, 0x36, 0xb0,
   118  	0xb8, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x75, 0x36, 0xeb, 0x4b, 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 {
   393  				return ErrInvalidLengthBlock
   394  			}
   395  			if (iNdEx + skippy) < 0 {
   396  				return ErrInvalidLengthBlock
   397  			}
   398  			if (iNdEx + skippy) > l {
   399  				return io.ErrUnexpectedEOF
   400  			}
   401  			iNdEx += skippy
   402  		}
   403  	}
   404  
   405  	if iNdEx > l {
   406  		return io.ErrUnexpectedEOF
   407  	}
   408  	return nil
   409  }
   410  func skipBlock(dAtA []byte) (n int, err error) {
   411  	l := len(dAtA)
   412  	iNdEx := 0
   413  	depth := 0
   414  	for iNdEx < l {
   415  		var wire uint64
   416  		for shift := uint(0); ; shift += 7 {
   417  			if shift >= 64 {
   418  				return 0, ErrIntOverflowBlock
   419  			}
   420  			if iNdEx >= l {
   421  				return 0, io.ErrUnexpectedEOF
   422  			}
   423  			b := dAtA[iNdEx]
   424  			iNdEx++
   425  			wire |= (uint64(b) & 0x7F) << shift
   426  			if b < 0x80 {
   427  				break
   428  			}
   429  		}
   430  		wireType := int(wire & 0x7)
   431  		switch wireType {
   432  		case 0:
   433  			for shift := uint(0); ; shift += 7 {
   434  				if shift >= 64 {
   435  					return 0, ErrIntOverflowBlock
   436  				}
   437  				if iNdEx >= l {
   438  					return 0, io.ErrUnexpectedEOF
   439  				}
   440  				iNdEx++
   441  				if dAtA[iNdEx-1] < 0x80 {
   442  					break
   443  				}
   444  			}
   445  		case 1:
   446  			iNdEx += 8
   447  		case 2:
   448  			var length int
   449  			for shift := uint(0); ; shift += 7 {
   450  				if shift >= 64 {
   451  					return 0, ErrIntOverflowBlock
   452  				}
   453  				if iNdEx >= l {
   454  					return 0, io.ErrUnexpectedEOF
   455  				}
   456  				b := dAtA[iNdEx]
   457  				iNdEx++
   458  				length |= (int(b) & 0x7F) << shift
   459  				if b < 0x80 {
   460  					break
   461  				}
   462  			}
   463  			if length < 0 {
   464  				return 0, ErrInvalidLengthBlock
   465  			}
   466  			iNdEx += length
   467  		case 3:
   468  			depth++
   469  		case 4:
   470  			if depth == 0 {
   471  				return 0, ErrUnexpectedEndOfGroupBlock
   472  			}
   473  			depth--
   474  		case 5:
   475  			iNdEx += 4
   476  		default:
   477  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   478  		}
   479  		if iNdEx < 0 {
   480  			return 0, ErrInvalidLengthBlock
   481  		}
   482  		if depth == 0 {
   483  			return iNdEx, nil
   484  		}
   485  	}
   486  	return 0, io.ErrUnexpectedEOF
   487  }
   488  
   489  var (
   490  	ErrInvalidLengthBlock        = fmt.Errorf("proto: negative length found during unmarshaling")
   491  	ErrIntOverflowBlock          = fmt.Errorf("proto: integer overflow")
   492  	ErrUnexpectedEndOfGroupBlock = fmt.Errorf("proto: unexpected end of group")
   493  )