Browse Source

types: validatebasic on from proto (#5152)

## Description

Validatebasic on FromProto for validator set not ToProto

Closes: #XXX
pull/5154/head
Marko 4 years ago
committed by GitHub
parent
commit
ee7bbb6cb2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      types/validator_set.go

+ 2
- 4
types/validator_set.go View File

@ -910,9 +910,7 @@ func (vals *ValidatorSet) ToProto() (*tmproto.ValidatorSet, error) {
if vals == nil {
return nil, errors.New("nil validator set") // validator set should never be nil
}
if err := vals.ValidateBasic(); err != nil {
return nil, fmt.Errorf("validator set failed basic: %w", err)
}
vp := new(tmproto.ValidatorSet)
valsProto := make([]*tmproto.Validator, len(vals.Validators))
for i := 0; i < len(vals.Validators); i++ {
@ -963,7 +961,7 @@ func ValidatorSetFromProto(vp *tmproto.ValidatorSet) (*ValidatorSet, error) {
vals.totalVotingPower = vp.GetTotalVotingPower()
return vals, nil
return vals, vals.ValidateBasic()
}
//----------------------------------------


Loading…
Cancel
Save