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