()
| 80 | } |
| 81 | |
| 82 | func (vals *ValidatorSet) ValidateBasic() error { |
| 83 | if vals.IsNilOrEmpty() { |
| 84 | return errors.New("validator set is nil or empty") |
| 85 | } |
| 86 | |
| 87 | for idx, val := range vals.Validators { |
| 88 | if err := val.ValidateBasic(); err != nil { |
| 89 | return fmt.Errorf("invalid validator #%d: %w", idx, err) |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | if err := vals.Proposer.ValidateBasic(); err != nil { |
| 94 | return fmt.Errorf("proposer failed validate basic, error: %w", err) |
| 95 | } |
| 96 | |
| 97 | return nil |
| 98 | } |
| 99 | |
| 100 | // IsNilOrEmpty returns true if validator set is nil or empty. |
| 101 | func (vals *ValidatorSet) IsNilOrEmpty() bool { |
nothing calls this directly
no test coverage detected