Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sainoe committed Jan 18, 2024
1 parent 8a0b312 commit 6b0f529
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
- Migrate min commission rate migration to %5 (prop 826) ([\#2855](https://github.com/cosmos/gaia/pull/2855))
Migrate min commission rate migration rate staking parameter to 5%
([prop 826](https://www.mintscan.io/cosmos/proposals/826))
and updates the commission rate for all validators that have a commission
rate less than 5% ([\#2855](https://github.com/cosmos/gaia/pull/2855))



2 changes: 1 addition & 1 deletion app/upgrades/v15/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func UpgradeCommissionRate(ctx sdk.Context, keepers *keepers.AppKeepers) {

for _, val := range keepers.StakingKeeper.GetAllValidators(ctx) {
if val.Commission.CommissionRates.Rate.LT(sdk.NewDecWithPrec(5, 2)) {
// set the commmision rate to 5%
// set the commission rate to 5%
val.Commission.CommissionRates.Rate = sdk.NewDecWithPrec(5, 2)
// set the max rate to 5% if it is less than 5%
if val.Commission.CommissionRates.MaxRate.LT(sdk.NewDecWithPrec(5, 2)) {
Expand Down
14 changes: 4 additions & 10 deletions app/upgrades/v15/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,19 @@ package v15_test
import (
"testing"

stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/stretchr/testify/require"

tmrand "github.com/cometbft/cometbft/libs/rand"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"

tmproto "github.com/cometbft/cometbft/proto/tendermint/types"

"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/cosmos/gaia/v15/app/helpers"
v15 "github.com/cosmos/gaia/v15/app/upgrades/v15"
)

type EmptyAppOptions struct{}

func (ao EmptyAppOptions) Get(_ string) interface{} {
return nil
}

func TestV15UpgradeHandler(t *testing.T) {
gaiaApp := helpers.Setup(t)
ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{})
Expand Down

0 comments on commit 6b0f529

Please sign in to comment.