mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 06:15:33 +00:00
@@ -332,9 +332,9 @@ message TxResult {
|
||||
|
||||
// Validator
|
||||
message Validator {
|
||||
bytes address = 1;
|
||||
bytes address = 1; // The first 20 bytes of SHA256(public key)
|
||||
// PubKey pub_key = 2 [(gogoproto.nullable)=false];
|
||||
int64 power = 3;
|
||||
int64 power = 3; // The voting power
|
||||
}
|
||||
|
||||
// ValidatorUpdate
|
||||
|
||||
@@ -23,6 +23,7 @@ type Validator struct {
|
||||
ProposerPriority int64 `json:"proposer_priority"`
|
||||
}
|
||||
|
||||
// NewValidator returns a new validator with the given pubkey and voting power.
|
||||
func NewValidator(pubKey crypto.PubKey, votingPower int64) *Validator {
|
||||
return &Validator{
|
||||
Address: pubKey.Address(),
|
||||
@@ -32,6 +33,7 @@ func NewValidator(pubKey crypto.PubKey, votingPower int64) *Validator {
|
||||
}
|
||||
}
|
||||
|
||||
// ValidateBasic performs basic validation.
|
||||
func (v *Validator) ValidateBasic() error {
|
||||
if v == nil {
|
||||
return errors.New("nil validator")
|
||||
|
||||
Reference in New Issue
Block a user