ValidateBasic performs basic validation.
()
| 34 | |
| 35 | // ValidateBasic performs basic validation. |
| 36 | func (v *Validator) ValidateBasic() error { |
| 37 | if v == nil { |
| 38 | return errors.New("nil validator") |
| 39 | } |
| 40 | if v.PubKey == nil { |
| 41 | return errors.New("validator does not have a public key") |
| 42 | } |
| 43 | |
| 44 | if v.VotingPower < 0 { |
| 45 | return errors.New("validator has negative voting power") |
| 46 | } |
| 47 | |
| 48 | if len(v.Address) != crypto.AddressSize { |
| 49 | return fmt.Errorf("validator address is the wrong size: %v", v.Address) |
| 50 | } |
| 51 | |
| 52 | return nil |
| 53 | } |
| 54 | |
| 55 | // Creates a new copy of the validator so we can mutate ProposerPriority. |
| 56 | // Panics if the validator is nil. |
nothing calls this directly
no outgoing calls
no test coverage detected