Skip to content

Commit

Permalink
chore: fix typo (#1422)
Browse files Browse the repository at this point in the history
* flag

* spelling

* ws

* --

Co-authored-by: Sai Kumar <17549398+gsk967@users.noreply.github.com>
  • Loading branch information
toteki and gsk967 authored Sep 19, 2022
1 parent 1f8bc6f commit ae66523
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (app UmeeApp) RegisterUpgradeHandlers() {

ctx.Logger().Info("Upgrade handler execution finished, updating minimum commission rate of all validators",
"name", UpgradeV3_0Plan)
err = v3upgrades.SetMinimumCommissionRateToValidatros(ctx, app.StakingKeeper, minCommissionRate)
err = v3upgrades.SetMinimumCommissionRateToValidators(ctx, app.StakingKeeper, minCommissionRate)
if err != nil {
return vm, sdkerrors.Wrapf(
err, "Calypso %q Upgrade: Unable to upgrade, failed to update minimum commission rate for validators",
Expand Down
9 changes: 3 additions & 6 deletions app/upgrades/v3/min_commission.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

var (
minCommissionRate = sdk.MustNewDecFromStr("0.05")
)
var minCommissionRate = sdk.MustNewDecFromStr("0.05")

// UpdateMinimumCommissionRateParam is update the minimum commission rate param of staking.
func UpdateMinimumCommissionRateParam(ctx sdk.Context, keeper StakingKeeper) (sdk.Dec, error) {
Expand All @@ -19,10 +17,9 @@ func UpdateMinimumCommissionRateParam(ctx sdk.Context, keeper StakingKeeper) (sd
return minCommissionRate, nil
}

// SetMinimumCommissionRateToValidatros is update the minimum commission rate to the validators rate
// SetMinimumCommissionRateToValidators is update the minimum commission rate to the validators rate
// whose commission rate is below the minimum commission rate.
func SetMinimumCommissionRateToValidatros(
ctx sdk.Context, keeper StakingKeeper, minCommissionRate sdk.Dec) error {
func SetMinimumCommissionRateToValidators(ctx sdk.Context, keeper StakingKeeper, minCommissionRate sdk.Dec) error {
validators := keeper.GetAllValidators(ctx)

for _, validator := range validators {
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v3/min_commission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestUpdateMinimumCommissionRateParam(t *testing.T) {
require.Equal(t, minCommissionRate, updatedParams.MinCommissionRate)
}

func TestSetMinimumCommissionRateToValidatros(t *testing.T) {
func TestSetMinimumCommissionRateToValidators(t *testing.T) {
ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil)
valAddrs, sk := GenerateRandomTestCase()

Expand All @@ -36,7 +36,7 @@ func TestSetMinimumCommissionRateToValidatros(t *testing.T) {
require.NotNil(t, minCommissionRate)

// update min commisson rate to all validators
err = SetMinimumCommissionRateToValidatros(ctx, &sk, minCommissionRate)
err = SetMinimumCommissionRateToValidators(ctx, &sk, minCommissionRate)
require.NoError(t, err)

// get the validator
Expand Down
8 changes: 3 additions & 5 deletions app/upgrades/v3/staking_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/staking/types"
)

var (
_ StakingKeeper = &MockStakingKeeper{}
)
var _ StakingKeeper = &MockStakingKeeper{}

// MockStakingKeeper imlements the StakingKeeper interface.
type MockStakingKeeper struct {
Expand Down Expand Up @@ -98,9 +96,9 @@ func GenerateRandomTestCase() ([]sdk.ValAddress, MockStakingKeeper) {
return valAddrs, stakingKeeper
}

func NewMockStakingKeeper(validatros []types.Validator) MockStakingKeeper {
func NewMockStakingKeeper(validators []types.Validator) MockStakingKeeper {
return MockStakingKeeper{
validators: validatros,
validators: validators,
params: types.DefaultParams(),
}
}

0 comments on commit ae66523

Please sign in to comment.