MCPcopy Create free account
hub / github.com/tendermint/tendermint / ValidateBasic

Method ValidateBasic

types/validator.go:36–53  ·  view source on GitHub ↗

ValidateBasic performs basic validation.

()

Source from the content-addressed store, hash-verified

34
35// ValidateBasic performs basic validation.
36func (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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected