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

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: tendermint/types/validator.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  	crypto "github.com/vipernet-xyz/tm/proto/tendermint/crypto"
    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 ValidatorSet struct {
    28  	Validators       []*Validator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"`
    29  	Proposer         *Validator   `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"`
    30  	TotalVotingPower int64        `protobuf:"varint,3,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"`
    31  }
    32  
    33  func (m *ValidatorSet) Reset()         { *m = ValidatorSet{} }
    34  func (m *ValidatorSet) String() string { return proto.CompactTextString(m) }
    35  func (*ValidatorSet) ProtoMessage()    {}
    36  func (*ValidatorSet) Descriptor() ([]byte, []int) {
    37  	return fileDescriptor_4e92274df03d3088, []int{0}
    38  }
    39  func (m *ValidatorSet) XXX_Unmarshal(b []byte) error {
    40  	return m.Unmarshal(b)
    41  }
    42  func (m *ValidatorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    43  	if deterministic {
    44  		return xxx_messageInfo_ValidatorSet.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 *ValidatorSet) XXX_Merge(src proto.Message) {
    55  	xxx_messageInfo_ValidatorSet.Merge(m, src)
    56  }
    57  func (m *ValidatorSet) XXX_Size() int {
    58  	return m.Size()
    59  }
    60  func (m *ValidatorSet) XXX_DiscardUnknown() {
    61  	xxx_messageInfo_ValidatorSet.DiscardUnknown(m)
    62  }
    63  
    64  var xxx_messageInfo_ValidatorSet proto.InternalMessageInfo
    65  
    66  func (m *ValidatorSet) GetValidators() []*Validator {
    67  	if m != nil {
    68  		return m.Validators
    69  	}
    70  	return nil
    71  }
    72  
    73  func (m *ValidatorSet) GetProposer() *Validator {
    74  	if m != nil {
    75  		return m.Proposer
    76  	}
    77  	return nil
    78  }
    79  
    80  func (m *ValidatorSet) GetTotalVotingPower() int64 {
    81  	if m != nil {
    82  		return m.TotalVotingPower
    83  	}
    84  	return 0
    85  }
    86  
    87  type Validator struct {
    88  	Address          []byte           `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
    89  	PubKey           crypto.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"`
    90  	VotingPower      int64            `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"`
    91  	ProposerPriority int64            `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"`
    92  }
    93  
    94  func (m *Validator) Reset()         { *m = Validator{} }
    95  func (m *Validator) String() string { return proto.CompactTextString(m) }
    96  func (*Validator) ProtoMessage()    {}
    97  func (*Validator) Descriptor() ([]byte, []int) {
    98  	return fileDescriptor_4e92274df03d3088, []int{1}
    99  }
   100  func (m *Validator) XXX_Unmarshal(b []byte) error {
   101  	return m.Unmarshal(b)
   102  }
   103  func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   104  	if deterministic {
   105  		return xxx_messageInfo_Validator.Marshal(b, m, deterministic)
   106  	} else {
   107  		b = b[:cap(b)]
   108  		n, err := m.MarshalToSizedBuffer(b)
   109  		if err != nil {
   110  			return nil, err
   111  		}
   112  		return b[:n], nil
   113  	}
   114  }
   115  func (m *Validator) XXX_Merge(src proto.Message) {
   116  	xxx_messageInfo_Validator.Merge(m, src)
   117  }
   118  func (m *Validator) XXX_Size() int {
   119  	return m.Size()
   120  }
   121  func (m *Validator) XXX_DiscardUnknown() {
   122  	xxx_messageInfo_Validator.DiscardUnknown(m)
   123  }
   124  
   125  var xxx_messageInfo_Validator proto.InternalMessageInfo
   126  
   127  func (m *Validator) GetAddress() []byte {
   128  	if m != nil {
   129  		return m.Address
   130  	}
   131  	return nil
   132  }
   133  
   134  func (m *Validator) GetPubKey() crypto.PublicKey {
   135  	if m != nil {
   136  		return m.PubKey
   137  	}
   138  	return crypto.PublicKey{}
   139  }
   140  
   141  func (m *Validator) GetVotingPower() int64 {
   142  	if m != nil {
   143  		return m.VotingPower
   144  	}
   145  	return 0
   146  }
   147  
   148  func (m *Validator) GetProposerPriority() int64 {
   149  	if m != nil {
   150  		return m.ProposerPriority
   151  	}
   152  	return 0
   153  }
   154  
   155  type SimpleValidator struct {
   156  	PubKey      *crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
   157  	VotingPower int64             `protobuf:"varint,2,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"`
   158  }
   159  
   160  func (m *SimpleValidator) Reset()         { *m = SimpleValidator{} }
   161  func (m *SimpleValidator) String() string { return proto.CompactTextString(m) }
   162  func (*SimpleValidator) ProtoMessage()    {}
   163  func (*SimpleValidator) Descriptor() ([]byte, []int) {
   164  	return fileDescriptor_4e92274df03d3088, []int{2}
   165  }
   166  func (m *SimpleValidator) XXX_Unmarshal(b []byte) error {
   167  	return m.Unmarshal(b)
   168  }
   169  func (m *SimpleValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   170  	if deterministic {
   171  		return xxx_messageInfo_SimpleValidator.Marshal(b, m, deterministic)
   172  	} else {
   173  		b = b[:cap(b)]
   174  		n, err := m.MarshalToSizedBuffer(b)
   175  		if err != nil {
   176  			return nil, err
   177  		}
   178  		return b[:n], nil
   179  	}
   180  }
   181  func (m *SimpleValidator) XXX_Merge(src proto.Message) {
   182  	xxx_messageInfo_SimpleValidator.Merge(m, src)
   183  }
   184  func (m *SimpleValidator) XXX_Size() int {
   185  	return m.Size()
   186  }
   187  func (m *SimpleValidator) XXX_DiscardUnknown() {
   188  	xxx_messageInfo_SimpleValidator.DiscardUnknown(m)
   189  }
   190  
   191  var xxx_messageInfo_SimpleValidator proto.InternalMessageInfo
   192  
   193  func (m *SimpleValidator) GetPubKey() *crypto.PublicKey {
   194  	if m != nil {
   195  		return m.PubKey
   196  	}
   197  	return nil
   198  }
   199  
   200  func (m *SimpleValidator) GetVotingPower() int64 {
   201  	if m != nil {
   202  		return m.VotingPower
   203  	}
   204  	return 0
   205  }
   206  
   207  func init() {
   208  	proto.RegisterType((*ValidatorSet)(nil), "tendermint.types.ValidatorSet")
   209  	proto.RegisterType((*Validator)(nil), "tendermint.types.Validator")
   210  	proto.RegisterType((*SimpleValidator)(nil), "tendermint.types.SimpleValidator")
   211  }
   212  
   213  func init() { proto.RegisterFile("tendermint/types/validator.proto", fileDescriptor_4e92274df03d3088) }
   214  
   215  var fileDescriptor_4e92274df03d3088 = []byte{
   216  	// 361 bytes of a gzipped FileDescriptorProto
   217  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcf, 0x4e, 0xc2, 0x40,
   218  	0x10, 0xc6, 0xbb, 0x40, 0x40, 0x17, 0x12, 0x71, 0xe3, 0xa1, 0x41, 0x52, 0x2b, 0x27, 0x12, 0x4d,
   219  	0x9b, 0x68, 0x0c, 0x07, 0x6e, 0x5c, 0xb9, 0x60, 0x49, 0x38, 0x78, 0x69, 0x5a, 0xba, 0xa9, 0x1b,
   220  	0x0a, 0xbb, 0xd9, 0x6e, 0x31, 0xfb, 0x16, 0x3e, 0x8b, 0x4f, 0xc1, 0x91, 0xa3, 0x27, 0x63, 0xe0,
   221  	0x45, 0x4c, 0x5b, 0xfa, 0x27, 0xa8, 0xe1, 0x36, 0x9d, 0xef, 0x9b, 0x99, 0x5f, 0x37, 0x1f, 0xd4,
   222  	0x05, 0x5e, 0x79, 0x98, 0x2f, 0xc9, 0x4a, 0x98, 0x42, 0x32, 0x1c, 0x9a, 0x6b, 0x27, 0x20, 0x9e,
   223  	0x23, 0x28, 0x37, 0x18, 0xa7, 0x82, 0xa2, 0x76, 0xe1, 0x30, 0x12, 0x47, 0xe7, 0xca, 0xa7, 0x3e,
   224  	0x4d, 0x44, 0x33, 0xae, 0x52, 0x5f, 0xa7, 0x5b, 0xda, 0x34, 0xe7, 0x92, 0x09, 0x6a, 0x2e, 0xb0,
   225  	0x0c, 0x53, 0xb5, 0xf7, 0x01, 0x60, 0x6b, 0x96, 0x6d, 0x9e, 0x62, 0x81, 0x86, 0x10, 0xe6, 0x97,
   226  	0x42, 0x15, 0xe8, 0xd5, 0x7e, 0xf3, 0xe1, 0xda, 0x38, 0xbe, 0x65, 0xe4, 0x33, 0x56, 0xc9, 0x8e,
   227  	0x06, 0xf0, 0x8c, 0x71, 0xca, 0x68, 0x88, 0xb9, 0x5a, 0xd1, 0xc1, 0xa9, 0xd1, 0xdc, 0x8c, 0xee,
   228  	0x21, 0x12, 0x54, 0x38, 0x81, 0xbd, 0xa6, 0x82, 0xac, 0x7c, 0x9b, 0xd1, 0x37, 0xcc, 0xd5, 0xaa,
   229  	0x0e, 0xfa, 0x55, 0xab, 0x9d, 0x28, 0xb3, 0x44, 0x98, 0xc4, 0xfd, 0x18, 0xfa, 0x3c, 0xdf, 0x82,
   230  	0x54, 0xd8, 0x70, 0x3c, 0x8f, 0xe3, 0x30, 0xc6, 0x05, 0xfd, 0x96, 0x95, 0x7d, 0xa2, 0x21, 0x6c,
   231  	0xb0, 0xc8, 0xb5, 0x17, 0x58, 0x1e, 0x68, 0xba, 0x65, 0x9a, 0xf4, 0x31, 0x8c, 0x49, 0xe4, 0x06,
   232  	0x64, 0x3e, 0xc6, 0x72, 0x54, 0xdb, 0x7c, 0xdd, 0x28, 0x56, 0x9d, 0x45, 0xee, 0x18, 0x4b, 0x74,
   233  	0x0b, 0x5b, 0x7f, 0xc0, 0x34, 0xd7, 0x05, 0x07, 0xba, 0x83, 0x97, 0xd9, 0x1f, 0xd8, 0x8c, 0x13,
   234  	0xca, 0x89, 0x90, 0x6a, 0x2d, 0x85, 0xce, 0x84, 0xc9, 0xa1, 0xdf, 0x5b, 0xc0, 0x8b, 0x29, 0x59,
   235  	0xb2, 0x00, 0x17, 0xe4, 0x4f, 0x05, 0x1f, 0x38, 0xcd, 0xf7, 0x2f, 0x59, 0xe5, 0x17, 0xd9, 0xe8,
   236  	0x79, 0xb3, 0xd3, 0xc0, 0x76, 0xa7, 0x81, 0xef, 0x9d, 0x06, 0xde, 0xf7, 0x9a, 0xb2, 0xdd, 0x6b,
   237  	0xca, 0xe7, 0x5e, 0x53, 0x5e, 0x06, 0x3e, 0x11, 0xaf, 0x91, 0x6b, 0xcc, 0xe9, 0xd2, 0x2c, 0x67,
   238  	0xac, 0x28, 0xd3, 0x04, 0x1d, 0xe7, 0xcf, 0xad, 0x27, 0xfd, 0xc7, 0x9f, 0x00, 0x00, 0x00, 0xff,
   239  	0xff, 0x48, 0xbf, 0x34, 0x35, 0x9a, 0x02, 0x00, 0x00,
   240  }
   241  
   242  func (m *ValidatorSet) Marshal() (dAtA []byte, err error) {
   243  	size := m.Size()
   244  	dAtA = make([]byte, size)
   245  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   246  	if err != nil {
   247  		return nil, err
   248  	}
   249  	return dAtA[:n], nil
   250  }
   251  
   252  func (m *ValidatorSet) MarshalTo(dAtA []byte) (int, error) {
   253  	size := m.Size()
   254  	return m.MarshalToSizedBuffer(dAtA[:size])
   255  }
   256  
   257  func (m *ValidatorSet) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   258  	i := len(dAtA)
   259  	_ = i
   260  	var l int
   261  	_ = l
   262  	if m.TotalVotingPower != 0 {
   263  		i = encodeVarintValidator(dAtA, i, uint64(m.TotalVotingPower))
   264  		i--
   265  		dAtA[i] = 0x18
   266  	}
   267  	if m.Proposer != nil {
   268  		{
   269  			size, err := m.Proposer.MarshalToSizedBuffer(dAtA[:i])
   270  			if err != nil {
   271  				return 0, err
   272  			}
   273  			i -= size
   274  			i = encodeVarintValidator(dAtA, i, uint64(size))
   275  		}
   276  		i--
   277  		dAtA[i] = 0x12
   278  	}
   279  	if len(m.Validators) > 0 {
   280  		for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- {
   281  			{
   282  				size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   283  				if err != nil {
   284  					return 0, err
   285  				}
   286  				i -= size
   287  				i = encodeVarintValidator(dAtA, i, uint64(size))
   288  			}
   289  			i--
   290  			dAtA[i] = 0xa
   291  		}
   292  	}
   293  	return len(dAtA) - i, nil
   294  }
   295  
   296  func (m *Validator) Marshal() (dAtA []byte, err error) {
   297  	size := m.Size()
   298  	dAtA = make([]byte, size)
   299  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   300  	if err != nil {
   301  		return nil, err
   302  	}
   303  	return dAtA[:n], nil
   304  }
   305  
   306  func (m *Validator) MarshalTo(dAtA []byte) (int, error) {
   307  	size := m.Size()
   308  	return m.MarshalToSizedBuffer(dAtA[:size])
   309  }
   310  
   311  func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   312  	i := len(dAtA)
   313  	_ = i
   314  	var l int
   315  	_ = l
   316  	if m.ProposerPriority != 0 {
   317  		i = encodeVarintValidator(dAtA, i, uint64(m.ProposerPriority))
   318  		i--
   319  		dAtA[i] = 0x20
   320  	}
   321  	if m.VotingPower != 0 {
   322  		i = encodeVarintValidator(dAtA, i, uint64(m.VotingPower))
   323  		i--
   324  		dAtA[i] = 0x18
   325  	}
   326  	{
   327  		size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i])
   328  		if err != nil {
   329  			return 0, err
   330  		}
   331  		i -= size
   332  		i = encodeVarintValidator(dAtA, i, uint64(size))
   333  	}
   334  	i--
   335  	dAtA[i] = 0x12
   336  	if len(m.Address) > 0 {
   337  		i -= len(m.Address)
   338  		copy(dAtA[i:], m.Address)
   339  		i = encodeVarintValidator(dAtA, i, uint64(len(m.Address)))
   340  		i--
   341  		dAtA[i] = 0xa
   342  	}
   343  	return len(dAtA) - i, nil
   344  }
   345  
   346  func (m *SimpleValidator) Marshal() (dAtA []byte, err error) {
   347  	size := m.Size()
   348  	dAtA = make([]byte, size)
   349  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   350  	if err != nil {
   351  		return nil, err
   352  	}
   353  	return dAtA[:n], nil
   354  }
   355  
   356  func (m *SimpleValidator) MarshalTo(dAtA []byte) (int, error) {
   357  	size := m.Size()
   358  	return m.MarshalToSizedBuffer(dAtA[:size])
   359  }
   360  
   361  func (m *SimpleValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   362  	i := len(dAtA)
   363  	_ = i
   364  	var l int
   365  	_ = l
   366  	if m.VotingPower != 0 {
   367  		i = encodeVarintValidator(dAtA, i, uint64(m.VotingPower))
   368  		i--
   369  		dAtA[i] = 0x10
   370  	}
   371  	if m.PubKey != nil {
   372  		{
   373  			size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i])
   374  			if err != nil {
   375  				return 0, err
   376  			}
   377  			i -= size
   378  			i = encodeVarintValidator(dAtA, i, uint64(size))
   379  		}
   380  		i--
   381  		dAtA[i] = 0xa
   382  	}
   383  	return len(dAtA) - i, nil
   384  }
   385  
   386  func encodeVarintValidator(dAtA []byte, offset int, v uint64) int {
   387  	offset -= sovValidator(v)
   388  	base := offset
   389  	for v >= 1<<7 {
   390  		dAtA[offset] = uint8(v&0x7f | 0x80)
   391  		v >>= 7
   392  		offset++
   393  	}
   394  	dAtA[offset] = uint8(v)
   395  	return base
   396  }
   397  func (m *ValidatorSet) Size() (n int) {
   398  	if m == nil {
   399  		return 0
   400  	}
   401  	var l int
   402  	_ = l
   403  	if len(m.Validators) > 0 {
   404  		for _, e := range m.Validators {
   405  			l = e.Size()
   406  			n += 1 + l + sovValidator(uint64(l))
   407  		}
   408  	}
   409  	if m.Proposer != nil {
   410  		l = m.Proposer.Size()
   411  		n += 1 + l + sovValidator(uint64(l))
   412  	}
   413  	if m.TotalVotingPower != 0 {
   414  		n += 1 + sovValidator(uint64(m.TotalVotingPower))
   415  	}
   416  	return n
   417  }
   418  
   419  func (m *Validator) Size() (n int) {
   420  	if m == nil {
   421  		return 0
   422  	}
   423  	var l int
   424  	_ = l
   425  	l = len(m.Address)
   426  	if l > 0 {
   427  		n += 1 + l + sovValidator(uint64(l))
   428  	}
   429  	l = m.PubKey.Size()
   430  	n += 1 + l + sovValidator(uint64(l))
   431  	if m.VotingPower != 0 {
   432  		n += 1 + sovValidator(uint64(m.VotingPower))
   433  	}
   434  	if m.ProposerPriority != 0 {
   435  		n += 1 + sovValidator(uint64(m.ProposerPriority))
   436  	}
   437  	return n
   438  }
   439  
   440  func (m *SimpleValidator) Size() (n int) {
   441  	if m == nil {
   442  		return 0
   443  	}
   444  	var l int
   445  	_ = l
   446  	if m.PubKey != nil {
   447  		l = m.PubKey.Size()
   448  		n += 1 + l + sovValidator(uint64(l))
   449  	}
   450  	if m.VotingPower != 0 {
   451  		n += 1 + sovValidator(uint64(m.VotingPower))
   452  	}
   453  	return n
   454  }
   455  
   456  func sovValidator(x uint64) (n int) {
   457  	return (math_bits.Len64(x|1) + 6) / 7
   458  }
   459  func sozValidator(x uint64) (n int) {
   460  	return sovValidator(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   461  }
   462  func (m *ValidatorSet) Unmarshal(dAtA []byte) error {
   463  	l := len(dAtA)
   464  	iNdEx := 0
   465  	for iNdEx < l {
   466  		preIndex := iNdEx
   467  		var wire uint64
   468  		for shift := uint(0); ; shift += 7 {
   469  			if shift >= 64 {
   470  				return ErrIntOverflowValidator
   471  			}
   472  			if iNdEx >= l {
   473  				return io.ErrUnexpectedEOF
   474  			}
   475  			b := dAtA[iNdEx]
   476  			iNdEx++
   477  			wire |= uint64(b&0x7F) << shift
   478  			if b < 0x80 {
   479  				break
   480  			}
   481  		}
   482  		fieldNum := int32(wire >> 3)
   483  		wireType := int(wire & 0x7)
   484  		if wireType == 4 {
   485  			return fmt.Errorf("proto: ValidatorSet: wiretype end group for non-group")
   486  		}
   487  		if fieldNum <= 0 {
   488  			return fmt.Errorf("proto: ValidatorSet: illegal tag %d (wire type %d)", fieldNum, wire)
   489  		}
   490  		switch fieldNum {
   491  		case 1:
   492  			if wireType != 2 {
   493  				return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType)
   494  			}
   495  			var msglen int
   496  			for shift := uint(0); ; shift += 7 {
   497  				if shift >= 64 {
   498  					return ErrIntOverflowValidator
   499  				}
   500  				if iNdEx >= l {
   501  					return io.ErrUnexpectedEOF
   502  				}
   503  				b := dAtA[iNdEx]
   504  				iNdEx++
   505  				msglen |= int(b&0x7F) << shift
   506  				if b < 0x80 {
   507  					break
   508  				}
   509  			}
   510  			if msglen < 0 {
   511  				return ErrInvalidLengthValidator
   512  			}
   513  			postIndex := iNdEx + msglen
   514  			if postIndex < 0 {
   515  				return ErrInvalidLengthValidator
   516  			}
   517  			if postIndex > l {
   518  				return io.ErrUnexpectedEOF
   519  			}
   520  			m.Validators = append(m.Validators, &Validator{})
   521  			if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   522  				return err
   523  			}
   524  			iNdEx = postIndex
   525  		case 2:
   526  			if wireType != 2 {
   527  				return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType)
   528  			}
   529  			var msglen int
   530  			for shift := uint(0); ; shift += 7 {
   531  				if shift >= 64 {
   532  					return ErrIntOverflowValidator
   533  				}
   534  				if iNdEx >= l {
   535  					return io.ErrUnexpectedEOF
   536  				}
   537  				b := dAtA[iNdEx]
   538  				iNdEx++
   539  				msglen |= int(b&0x7F) << shift
   540  				if b < 0x80 {
   541  					break
   542  				}
   543  			}
   544  			if msglen < 0 {
   545  				return ErrInvalidLengthValidator
   546  			}
   547  			postIndex := iNdEx + msglen
   548  			if postIndex < 0 {
   549  				return ErrInvalidLengthValidator
   550  			}
   551  			if postIndex > l {
   552  				return io.ErrUnexpectedEOF
   553  			}
   554  			if m.Proposer == nil {
   555  				m.Proposer = &Validator{}
   556  			}
   557  			if err := m.Proposer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   558  				return err
   559  			}
   560  			iNdEx = postIndex
   561  		case 3:
   562  			if wireType != 0 {
   563  				return fmt.Errorf("proto: wrong wireType = %d for field TotalVotingPower", wireType)
   564  			}
   565  			m.TotalVotingPower = 0
   566  			for shift := uint(0); ; shift += 7 {
   567  				if shift >= 64 {
   568  					return ErrIntOverflowValidator
   569  				}
   570  				if iNdEx >= l {
   571  					return io.ErrUnexpectedEOF
   572  				}
   573  				b := dAtA[iNdEx]
   574  				iNdEx++
   575  				m.TotalVotingPower |= int64(b&0x7F) << shift
   576  				if b < 0x80 {
   577  					break
   578  				}
   579  			}
   580  		default:
   581  			iNdEx = preIndex
   582  			skippy, err := skipValidator(dAtA[iNdEx:])
   583  			if err != nil {
   584  				return err
   585  			}
   586  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   587  				return ErrInvalidLengthValidator
   588  			}
   589  			if (iNdEx + skippy) > l {
   590  				return io.ErrUnexpectedEOF
   591  			}
   592  			iNdEx += skippy
   593  		}
   594  	}
   595  
   596  	if iNdEx > l {
   597  		return io.ErrUnexpectedEOF
   598  	}
   599  	return nil
   600  }
   601  func (m *Validator) Unmarshal(dAtA []byte) error {
   602  	l := len(dAtA)
   603  	iNdEx := 0
   604  	for iNdEx < l {
   605  		preIndex := iNdEx
   606  		var wire uint64
   607  		for shift := uint(0); ; shift += 7 {
   608  			if shift >= 64 {
   609  				return ErrIntOverflowValidator
   610  			}
   611  			if iNdEx >= l {
   612  				return io.ErrUnexpectedEOF
   613  			}
   614  			b := dAtA[iNdEx]
   615  			iNdEx++
   616  			wire |= uint64(b&0x7F) << shift
   617  			if b < 0x80 {
   618  				break
   619  			}
   620  		}
   621  		fieldNum := int32(wire >> 3)
   622  		wireType := int(wire & 0x7)
   623  		if wireType == 4 {
   624  			return fmt.Errorf("proto: Validator: wiretype end group for non-group")
   625  		}
   626  		if fieldNum <= 0 {
   627  			return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire)
   628  		}
   629  		switch fieldNum {
   630  		case 1:
   631  			if wireType != 2 {
   632  				return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
   633  			}
   634  			var byteLen int
   635  			for shift := uint(0); ; shift += 7 {
   636  				if shift >= 64 {
   637  					return ErrIntOverflowValidator
   638  				}
   639  				if iNdEx >= l {
   640  					return io.ErrUnexpectedEOF
   641  				}
   642  				b := dAtA[iNdEx]
   643  				iNdEx++
   644  				byteLen |= int(b&0x7F) << shift
   645  				if b < 0x80 {
   646  					break
   647  				}
   648  			}
   649  			if byteLen < 0 {
   650  				return ErrInvalidLengthValidator
   651  			}
   652  			postIndex := iNdEx + byteLen
   653  			if postIndex < 0 {
   654  				return ErrInvalidLengthValidator
   655  			}
   656  			if postIndex > l {
   657  				return io.ErrUnexpectedEOF
   658  			}
   659  			m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...)
   660  			if m.Address == nil {
   661  				m.Address = []byte{}
   662  			}
   663  			iNdEx = postIndex
   664  		case 2:
   665  			if wireType != 2 {
   666  				return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType)
   667  			}
   668  			var msglen int
   669  			for shift := uint(0); ; shift += 7 {
   670  				if shift >= 64 {
   671  					return ErrIntOverflowValidator
   672  				}
   673  				if iNdEx >= l {
   674  					return io.ErrUnexpectedEOF
   675  				}
   676  				b := dAtA[iNdEx]
   677  				iNdEx++
   678  				msglen |= int(b&0x7F) << shift
   679  				if b < 0x80 {
   680  					break
   681  				}
   682  			}
   683  			if msglen < 0 {
   684  				return ErrInvalidLengthValidator
   685  			}
   686  			postIndex := iNdEx + msglen
   687  			if postIndex < 0 {
   688  				return ErrInvalidLengthValidator
   689  			}
   690  			if postIndex > l {
   691  				return io.ErrUnexpectedEOF
   692  			}
   693  			if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   694  				return err
   695  			}
   696  			iNdEx = postIndex
   697  		case 3:
   698  			if wireType != 0 {
   699  				return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType)
   700  			}
   701  			m.VotingPower = 0
   702  			for shift := uint(0); ; shift += 7 {
   703  				if shift >= 64 {
   704  					return ErrIntOverflowValidator
   705  				}
   706  				if iNdEx >= l {
   707  					return io.ErrUnexpectedEOF
   708  				}
   709  				b := dAtA[iNdEx]
   710  				iNdEx++
   711  				m.VotingPower |= int64(b&0x7F) << shift
   712  				if b < 0x80 {
   713  					break
   714  				}
   715  			}
   716  		case 4:
   717  			if wireType != 0 {
   718  				return fmt.Errorf("proto: wrong wireType = %d for field ProposerPriority", wireType)
   719  			}
   720  			m.ProposerPriority = 0
   721  			for shift := uint(0); ; shift += 7 {
   722  				if shift >= 64 {
   723  					return ErrIntOverflowValidator
   724  				}
   725  				if iNdEx >= l {
   726  					return io.ErrUnexpectedEOF
   727  				}
   728  				b := dAtA[iNdEx]
   729  				iNdEx++
   730  				m.ProposerPriority |= int64(b&0x7F) << shift
   731  				if b < 0x80 {
   732  					break
   733  				}
   734  			}
   735  		default:
   736  			iNdEx = preIndex
   737  			skippy, err := skipValidator(dAtA[iNdEx:])
   738  			if err != nil {
   739  				return err
   740  			}
   741  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   742  				return ErrInvalidLengthValidator
   743  			}
   744  			if (iNdEx + skippy) > l {
   745  				return io.ErrUnexpectedEOF
   746  			}
   747  			iNdEx += skippy
   748  		}
   749  	}
   750  
   751  	if iNdEx > l {
   752  		return io.ErrUnexpectedEOF
   753  	}
   754  	return nil
   755  }
   756  func (m *SimpleValidator) Unmarshal(dAtA []byte) error {
   757  	l := len(dAtA)
   758  	iNdEx := 0
   759  	for iNdEx < l {
   760  		preIndex := iNdEx
   761  		var wire uint64
   762  		for shift := uint(0); ; shift += 7 {
   763  			if shift >= 64 {
   764  				return ErrIntOverflowValidator
   765  			}
   766  			if iNdEx >= l {
   767  				return io.ErrUnexpectedEOF
   768  			}
   769  			b := dAtA[iNdEx]
   770  			iNdEx++
   771  			wire |= uint64(b&0x7F) << shift
   772  			if b < 0x80 {
   773  				break
   774  			}
   775  		}
   776  		fieldNum := int32(wire >> 3)
   777  		wireType := int(wire & 0x7)
   778  		if wireType == 4 {
   779  			return fmt.Errorf("proto: SimpleValidator: wiretype end group for non-group")
   780  		}
   781  		if fieldNum <= 0 {
   782  			return fmt.Errorf("proto: SimpleValidator: illegal tag %d (wire type %d)", fieldNum, wire)
   783  		}
   784  		switch fieldNum {
   785  		case 1:
   786  			if wireType != 2 {
   787  				return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType)
   788  			}
   789  			var msglen int
   790  			for shift := uint(0); ; shift += 7 {
   791  				if shift >= 64 {
   792  					return ErrIntOverflowValidator
   793  				}
   794  				if iNdEx >= l {
   795  					return io.ErrUnexpectedEOF
   796  				}
   797  				b := dAtA[iNdEx]
   798  				iNdEx++
   799  				msglen |= int(b&0x7F) << shift
   800  				if b < 0x80 {
   801  					break
   802  				}
   803  			}
   804  			if msglen < 0 {
   805  				return ErrInvalidLengthValidator
   806  			}
   807  			postIndex := iNdEx + msglen
   808  			if postIndex < 0 {
   809  				return ErrInvalidLengthValidator
   810  			}
   811  			if postIndex > l {
   812  				return io.ErrUnexpectedEOF
   813  			}
   814  			if m.PubKey == nil {
   815  				m.PubKey = &crypto.PublicKey{}
   816  			}
   817  			if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   818  				return err
   819  			}
   820  			iNdEx = postIndex
   821  		case 2:
   822  			if wireType != 0 {
   823  				return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType)
   824  			}
   825  			m.VotingPower = 0
   826  			for shift := uint(0); ; shift += 7 {
   827  				if shift >= 64 {
   828  					return ErrIntOverflowValidator
   829  				}
   830  				if iNdEx >= l {
   831  					return io.ErrUnexpectedEOF
   832  				}
   833  				b := dAtA[iNdEx]
   834  				iNdEx++
   835  				m.VotingPower |= int64(b&0x7F) << shift
   836  				if b < 0x80 {
   837  					break
   838  				}
   839  			}
   840  		default:
   841  			iNdEx = preIndex
   842  			skippy, err := skipValidator(dAtA[iNdEx:])
   843  			if err != nil {
   844  				return err
   845  			}
   846  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   847  				return ErrInvalidLengthValidator
   848  			}
   849  			if (iNdEx + skippy) > l {
   850  				return io.ErrUnexpectedEOF
   851  			}
   852  			iNdEx += skippy
   853  		}
   854  	}
   855  
   856  	if iNdEx > l {
   857  		return io.ErrUnexpectedEOF
   858  	}
   859  	return nil
   860  }
   861  func skipValidator(dAtA []byte) (n int, err error) {
   862  	l := len(dAtA)
   863  	iNdEx := 0
   864  	depth := 0
   865  	for iNdEx < l {
   866  		var wire uint64
   867  		for shift := uint(0); ; shift += 7 {
   868  			if shift >= 64 {
   869  				return 0, ErrIntOverflowValidator
   870  			}
   871  			if iNdEx >= l {
   872  				return 0, io.ErrUnexpectedEOF
   873  			}
   874  			b := dAtA[iNdEx]
   875  			iNdEx++
   876  			wire |= (uint64(b) & 0x7F) << shift
   877  			if b < 0x80 {
   878  				break
   879  			}
   880  		}
   881  		wireType := int(wire & 0x7)
   882  		switch wireType {
   883  		case 0:
   884  			for shift := uint(0); ; shift += 7 {
   885  				if shift >= 64 {
   886  					return 0, ErrIntOverflowValidator
   887  				}
   888  				if iNdEx >= l {
   889  					return 0, io.ErrUnexpectedEOF
   890  				}
   891  				iNdEx++
   892  				if dAtA[iNdEx-1] < 0x80 {
   893  					break
   894  				}
   895  			}
   896  		case 1:
   897  			iNdEx += 8
   898  		case 2:
   899  			var length int
   900  			for shift := uint(0); ; shift += 7 {
   901  				if shift >= 64 {
   902  					return 0, ErrIntOverflowValidator
   903  				}
   904  				if iNdEx >= l {
   905  					return 0, io.ErrUnexpectedEOF
   906  				}
   907  				b := dAtA[iNdEx]
   908  				iNdEx++
   909  				length |= (int(b) & 0x7F) << shift
   910  				if b < 0x80 {
   911  					break
   912  				}
   913  			}
   914  			if length < 0 {
   915  				return 0, ErrInvalidLengthValidator
   916  			}
   917  			iNdEx += length
   918  		case 3:
   919  			depth++
   920  		case 4:
   921  			if depth == 0 {
   922  				return 0, ErrUnexpectedEndOfGroupValidator
   923  			}
   924  			depth--
   925  		case 5:
   926  			iNdEx += 4
   927  		default:
   928  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   929  		}
   930  		if iNdEx < 0 {
   931  			return 0, ErrInvalidLengthValidator
   932  		}
   933  		if depth == 0 {
   934  			return iNdEx, nil
   935  		}
   936  	}
   937  	return 0, io.ErrUnexpectedEOF
   938  }
   939  
   940  var (
   941  	ErrInvalidLengthValidator        = fmt.Errorf("proto: negative length found during unmarshaling")
   942  	ErrIntOverflowValidator          = fmt.Errorf("proto: integer overflow")
   943  	ErrUnexpectedEndOfGroupValidator = fmt.Errorf("proto: unexpected end of group")
   944  )