Merge PR #2251: Refactor Bech32 Prefixes and Nomenclature of Validator Pubkey and Operator

This commit is contained in:
Alexander Bezobchuk
2018-09-08 16:44:58 +08:00
committed by Christopher Goes
parent f68e5a7542
commit 0edfa17b53
34 changed files with 226 additions and 223 deletions
+5 -5
View File
@@ -22,13 +22,13 @@ const (
// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
Bech32PrefixAccPub = "cosmospub"
// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
Bech32PrefixValAddr = "cosmosval"
Bech32PrefixValAddr = "cosmosvaloper"
// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
Bech32PrefixValPub = "cosmosvalpub"
Bech32PrefixValPub = "cosmosvaloperpub"
// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
Bech32PrefixConsAddr = "cosmoscons"
Bech32PrefixConsAddr = "cosmosvalcons"
// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
Bech32PrefixConsPub = "cosmosconspub"
Bech32PrefixConsPub = "cosmosvalconspub"
)
// ----------------------------------------------------------------------------
@@ -146,7 +146,7 @@ func (aa AccAddress) Format(s fmt.State, verb rune) {
}
// ----------------------------------------------------------------------------
// validator owner
// validator operator
// ----------------------------------------------------------------------------
// ValAddress defines a wrapper around bytes meant to present a validator's
+3 -3
View File
@@ -40,7 +40,7 @@ type Validator interface {
GetJailed() bool // whether the validator is jailed
GetMoniker() string // moniker of the validator
GetStatus() BondStatus // status of the validator
GetOperator() ValAddress // owner address to receive/return validators coins
GetOperator() ValAddress // operator address to receive/return validators coins
GetPubKey() crypto.PubKey // validation pubkey
GetPower() Dec // validation power
GetTokens() Dec // validation tokens
@@ -59,11 +59,11 @@ func ABCIValidator(v Validator) abci.Validator {
// properties for the set of all validators
type ValidatorSet interface {
// iterate through validator by owner-AccAddress, execute func for each validator
// iterate through validators by operator address, execute func for each validator
IterateValidators(Context,
func(index int64, validator Validator) (stop bool))
// iterate through bonded validator by pubkey-AccAddress, execute func for each validator
// iterate through bonded validators by operator address, execute func for each validator
IterateValidatorsBonded(Context,
func(index int64, validator Validator) (stop bool))