reduce power reduction var name

This commit is contained in:
psaradev
2021-02-03 19:59:37 +10:00
parent 1c1e67fa51
commit 5acdc07df4
2 changed files with 15 additions and 15 deletions
+4 -4
View File
@@ -20,21 +20,21 @@ func GetTmConsPubKey(v types.Validator) (tmcrypto.PubKey, error) {
}
// ToTmValidator casts an SDK validator to a tendermint type Validator.
func ToTmValidator(v types.Validator, powerReduction sdk.Int) (*tmtypes.Validator, error) {
func ToTmValidator(v types.Validator, r sdk.Int) (*tmtypes.Validator, error) {
tmPk, err := GetTmConsPubKey(v)
if err != nil {
return nil, err
}
return tmtypes.NewValidator(tmPk, v.ConsensusPower(powerReduction)), nil
return tmtypes.NewValidator(tmPk, v.ConsensusPower(r)), nil
}
// ToTmValidators casts all validators to the corresponding tendermint type.
func ToTmValidators(v types.Validators, powerReduction sdk.Int) ([]*tmtypes.Validator, error) {
func ToTmValidators(v types.Validators, r sdk.Int) ([]*tmtypes.Validator, error) {
validators := make([]*tmtypes.Validator, len(v))
var err error
for i, val := range v {
validators[i], err = ToTmValidator(val, powerReduction)
validators[i], err = ToTmValidator(val, r)
if err != nil {
return nil, err
}