github.com/vipernet-xyz/tm@v0.34.24/proto/tendermint/libs/bits/types.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: tendermint/libs/bits/types.proto
     3  
     4  package bits
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/gogo/protobuf/proto"
     9  	io "io"
    10  	math "math"
    11  	math_bits "math/bits"
    12  )
    13  
    14  // Reference imports to suppress errors if they are not otherwise used.
    15  var _ = proto.Marshal
    16  var _ = fmt.Errorf
    17  var _ = math.Inf
    18  
    19  // This is a compile-time assertion to ensure that this generated file
    20  // is compatible with the proto package it is being compiled against.
    21  // A compilation error at this line likely means your copy of the
    22  // proto package needs to be updated.
    23  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    24  
    25  type BitArray struct {
    26  	Bits  int64    `protobuf:"varint,1,opt,name=bits,proto3" json:"bits,omitempty"`
    27  	Elems []uint64 `protobuf:"varint,2,rep,packed,name=elems,proto3" json:"elems,omitempty"`
    28  }
    29  
    30  func (m *BitArray) Reset()         { *m = BitArray{} }
    31  func (m *BitArray) String() string { return proto.CompactTextString(m) }
    32  func (*BitArray) ProtoMessage()    {}
    33  func (*BitArray) Descriptor() ([]byte, []int) {
    34  	return fileDescriptor_e91ab2672920d7d4, []int{0}
    35  }
    36  func (m *BitArray) XXX_Unmarshal(b []byte) error {
    37  	return m.Unmarshal(b)
    38  }
    39  func (m *BitArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    40  	if deterministic {
    41  		return xxx_messageInfo_BitArray.Marshal(b, m, deterministic)
    42  	} else {
    43  		b = b[:cap(b)]
    44  		n, err := m.MarshalToSizedBuffer(b)
    45  		if err != nil {
    46  			return nil, err
    47  		}
    48  		return b[:n], nil
    49  	}
    50  }
    51  func (m *BitArray) XXX_Merge(src proto.Message) {
    52  	xxx_messageInfo_BitArray.Merge(m, src)
    53  }
    54  func (m *BitArray) XXX_Size() int {
    55  	return m.Size()
    56  }
    57  func (m *BitArray) XXX_DiscardUnknown() {
    58  	xxx_messageInfo_BitArray.DiscardUnknown(m)
    59  }
    60  
    61  var xxx_messageInfo_BitArray proto.InternalMessageInfo
    62  
    63  func (m *BitArray) GetBits() int64 {
    64  	if m != nil {
    65  		return m.Bits
    66  	}
    67  	return 0
    68  }
    69  
    70  func (m *BitArray) GetElems() []uint64 {
    71  	if m != nil {
    72  		return m.Elems
    73  	}
    74  	return nil
    75  }
    76  
    77  func init() {
    78  	proto.RegisterType((*BitArray)(nil), "tendermint.libs.bits.BitArray")
    79  }
    80  
    81  func init() { proto.RegisterFile("tendermint/libs/bits/types.proto", fileDescriptor_e91ab2672920d7d4) }
    82  
    83  var fileDescriptor_e91ab2672920d7d4 = []byte{
    84  	// 168 bytes of a gzipped FileDescriptorProto
    85  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0x49, 0xcd, 0x4b,
    86  	0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0xcf, 0xc9, 0x4c, 0x2a, 0xd6, 0x4f, 0xca, 0x2c, 0x29,
    87  	0xd6, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x41, 0xa8,
    88  	0xd0, 0x03, 0xa9, 0xd0, 0x03, 0xa9, 0x50, 0x32, 0xe1, 0xe2, 0x70, 0xca, 0x2c, 0x71, 0x2c, 0x2a,
    89  	0x4a, 0xac, 0x14, 0x12, 0xe2, 0x62, 0x01, 0x89, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0x81,
    90  	0xd9, 0x42, 0x22, 0x5c, 0xac, 0xa9, 0x39, 0xa9, 0xb9, 0xc5, 0x12, 0x4c, 0x0a, 0xcc, 0x1a, 0x2c,
    91  	0x41, 0x10, 0x8e, 0x53, 0xe8, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24,
    92  	0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x59,
    93  	0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x23, 0x39, 0x09, 0x89, 0x09,
    94  	0x76, 0x8d, 0x3e, 0x36, 0xe7, 0x26, 0xb1, 0x81, 0xe5, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff,
    95  	0x5b, 0x0c, 0xe3, 0x3e, 0xcd, 0x00, 0x00, 0x00,
    96  }
    97  
    98  func (m *BitArray) Marshal() (dAtA []byte, err error) {
    99  	size := m.Size()
   100  	dAtA = make([]byte, size)
   101  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return dAtA[:n], nil
   106  }
   107  
   108  func (m *BitArray) MarshalTo(dAtA []byte) (int, error) {
   109  	size := m.Size()
   110  	return m.MarshalToSizedBuffer(dAtA[:size])
   111  }
   112  
   113  func (m *BitArray) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   114  	i := len(dAtA)
   115  	_ = i
   116  	var l int
   117  	_ = l
   118  	if len(m.Elems) > 0 {
   119  		dAtA2 := make([]byte, len(m.Elems)*10)
   120  		var j1 int
   121  		for _, num := range m.Elems {
   122  			for num >= 1<<7 {
   123  				dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80)
   124  				num >>= 7
   125  				j1++
   126  			}
   127  			dAtA2[j1] = uint8(num)
   128  			j1++
   129  		}
   130  		i -= j1
   131  		copy(dAtA[i:], dAtA2[:j1])
   132  		i = encodeVarintTypes(dAtA, i, uint64(j1))
   133  		i--
   134  		dAtA[i] = 0x12
   135  	}
   136  	if m.Bits != 0 {
   137  		i = encodeVarintTypes(dAtA, i, uint64(m.Bits))
   138  		i--
   139  		dAtA[i] = 0x8
   140  	}
   141  	return len(dAtA) - i, nil
   142  }
   143  
   144  func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
   145  	offset -= sovTypes(v)
   146  	base := offset
   147  	for v >= 1<<7 {
   148  		dAtA[offset] = uint8(v&0x7f | 0x80)
   149  		v >>= 7
   150  		offset++
   151  	}
   152  	dAtA[offset] = uint8(v)
   153  	return base
   154  }
   155  func (m *BitArray) Size() (n int) {
   156  	if m == nil {
   157  		return 0
   158  	}
   159  	var l int
   160  	_ = l
   161  	if m.Bits != 0 {
   162  		n += 1 + sovTypes(uint64(m.Bits))
   163  	}
   164  	if len(m.Elems) > 0 {
   165  		l = 0
   166  		for _, e := range m.Elems {
   167  			l += sovTypes(uint64(e))
   168  		}
   169  		n += 1 + sovTypes(uint64(l)) + l
   170  	}
   171  	return n
   172  }
   173  
   174  func sovTypes(x uint64) (n int) {
   175  	return (math_bits.Len64(x|1) + 6) / 7
   176  }
   177  func sozTypes(x uint64) (n int) {
   178  	return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   179  }
   180  func (m *BitArray) Unmarshal(dAtA []byte) error {
   181  	l := len(dAtA)
   182  	iNdEx := 0
   183  	for iNdEx < l {
   184  		preIndex := iNdEx
   185  		var wire uint64
   186  		for shift := uint(0); ; shift += 7 {
   187  			if shift >= 64 {
   188  				return ErrIntOverflowTypes
   189  			}
   190  			if iNdEx >= l {
   191  				return io.ErrUnexpectedEOF
   192  			}
   193  			b := dAtA[iNdEx]
   194  			iNdEx++
   195  			wire |= uint64(b&0x7F) << shift
   196  			if b < 0x80 {
   197  				break
   198  			}
   199  		}
   200  		fieldNum := int32(wire >> 3)
   201  		wireType := int(wire & 0x7)
   202  		if wireType == 4 {
   203  			return fmt.Errorf("proto: BitArray: wiretype end group for non-group")
   204  		}
   205  		if fieldNum <= 0 {
   206  			return fmt.Errorf("proto: BitArray: illegal tag %d (wire type %d)", fieldNum, wire)
   207  		}
   208  		switch fieldNum {
   209  		case 1:
   210  			if wireType != 0 {
   211  				return fmt.Errorf("proto: wrong wireType = %d for field Bits", wireType)
   212  			}
   213  			m.Bits = 0
   214  			for shift := uint(0); ; shift += 7 {
   215  				if shift >= 64 {
   216  					return ErrIntOverflowTypes
   217  				}
   218  				if iNdEx >= l {
   219  					return io.ErrUnexpectedEOF
   220  				}
   221  				b := dAtA[iNdEx]
   222  				iNdEx++
   223  				m.Bits |= int64(b&0x7F) << shift
   224  				if b < 0x80 {
   225  					break
   226  				}
   227  			}
   228  		case 2:
   229  			if wireType == 0 {
   230  				var v uint64
   231  				for shift := uint(0); ; shift += 7 {
   232  					if shift >= 64 {
   233  						return ErrIntOverflowTypes
   234  					}
   235  					if iNdEx >= l {
   236  						return io.ErrUnexpectedEOF
   237  					}
   238  					b := dAtA[iNdEx]
   239  					iNdEx++
   240  					v |= uint64(b&0x7F) << shift
   241  					if b < 0x80 {
   242  						break
   243  					}
   244  				}
   245  				m.Elems = append(m.Elems, v)
   246  			} else if wireType == 2 {
   247  				var packedLen int
   248  				for shift := uint(0); ; shift += 7 {
   249  					if shift >= 64 {
   250  						return ErrIntOverflowTypes
   251  					}
   252  					if iNdEx >= l {
   253  						return io.ErrUnexpectedEOF
   254  					}
   255  					b := dAtA[iNdEx]
   256  					iNdEx++
   257  					packedLen |= int(b&0x7F) << shift
   258  					if b < 0x80 {
   259  						break
   260  					}
   261  				}
   262  				if packedLen < 0 {
   263  					return ErrInvalidLengthTypes
   264  				}
   265  				postIndex := iNdEx + packedLen
   266  				if postIndex < 0 {
   267  					return ErrInvalidLengthTypes
   268  				}
   269  				if postIndex > l {
   270  					return io.ErrUnexpectedEOF
   271  				}
   272  				var elementCount int
   273  				var count int
   274  				for _, integer := range dAtA[iNdEx:postIndex] {
   275  					if integer < 128 {
   276  						count++
   277  					}
   278  				}
   279  				elementCount = count
   280  				if elementCount != 0 && len(m.Elems) == 0 {
   281  					m.Elems = make([]uint64, 0, elementCount)
   282  				}
   283  				for iNdEx < postIndex {
   284  					var v uint64
   285  					for shift := uint(0); ; shift += 7 {
   286  						if shift >= 64 {
   287  							return ErrIntOverflowTypes
   288  						}
   289  						if iNdEx >= l {
   290  							return io.ErrUnexpectedEOF
   291  						}
   292  						b := dAtA[iNdEx]
   293  						iNdEx++
   294  						v |= uint64(b&0x7F) << shift
   295  						if b < 0x80 {
   296  							break
   297  						}
   298  					}
   299  					m.Elems = append(m.Elems, v)
   300  				}
   301  			} else {
   302  				return fmt.Errorf("proto: wrong wireType = %d for field Elems", wireType)
   303  			}
   304  		default:
   305  			iNdEx = preIndex
   306  			skippy, err := skipTypes(dAtA[iNdEx:])
   307  			if err != nil {
   308  				return err
   309  			}
   310  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   311  				return ErrInvalidLengthTypes
   312  			}
   313  			if (iNdEx + skippy) > l {
   314  				return io.ErrUnexpectedEOF
   315  			}
   316  			iNdEx += skippy
   317  		}
   318  	}
   319  
   320  	if iNdEx > l {
   321  		return io.ErrUnexpectedEOF
   322  	}
   323  	return nil
   324  }
   325  func skipTypes(dAtA []byte) (n int, err error) {
   326  	l := len(dAtA)
   327  	iNdEx := 0
   328  	depth := 0
   329  	for iNdEx < l {
   330  		var wire uint64
   331  		for shift := uint(0); ; shift += 7 {
   332  			if shift >= 64 {
   333  				return 0, ErrIntOverflowTypes
   334  			}
   335  			if iNdEx >= l {
   336  				return 0, io.ErrUnexpectedEOF
   337  			}
   338  			b := dAtA[iNdEx]
   339  			iNdEx++
   340  			wire |= (uint64(b) & 0x7F) << shift
   341  			if b < 0x80 {
   342  				break
   343  			}
   344  		}
   345  		wireType := int(wire & 0x7)
   346  		switch wireType {
   347  		case 0:
   348  			for shift := uint(0); ; shift += 7 {
   349  				if shift >= 64 {
   350  					return 0, ErrIntOverflowTypes
   351  				}
   352  				if iNdEx >= l {
   353  					return 0, io.ErrUnexpectedEOF
   354  				}
   355  				iNdEx++
   356  				if dAtA[iNdEx-1] < 0x80 {
   357  					break
   358  				}
   359  			}
   360  		case 1:
   361  			iNdEx += 8
   362  		case 2:
   363  			var length int
   364  			for shift := uint(0); ; shift += 7 {
   365  				if shift >= 64 {
   366  					return 0, ErrIntOverflowTypes
   367  				}
   368  				if iNdEx >= l {
   369  					return 0, io.ErrUnexpectedEOF
   370  				}
   371  				b := dAtA[iNdEx]
   372  				iNdEx++
   373  				length |= (int(b) & 0x7F) << shift
   374  				if b < 0x80 {
   375  					break
   376  				}
   377  			}
   378  			if length < 0 {
   379  				return 0, ErrInvalidLengthTypes
   380  			}
   381  			iNdEx += length
   382  		case 3:
   383  			depth++
   384  		case 4:
   385  			if depth == 0 {
   386  				return 0, ErrUnexpectedEndOfGroupTypes
   387  			}
   388  			depth--
   389  		case 5:
   390  			iNdEx += 4
   391  		default:
   392  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   393  		}
   394  		if iNdEx < 0 {
   395  			return 0, ErrInvalidLengthTypes
   396  		}
   397  		if depth == 0 {
   398  			return iNdEx, nil
   399  		}
   400  	}
   401  	return 0, io.ErrUnexpectedEOF
   402  }
   403  
   404  var (
   405  	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
   406  	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
   407  	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
   408  )