Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
neitdung committed May 13, 2024
1 parent db86787 commit 1294ccd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 7 additions & 3 deletions app/upgrades/v4/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func CreateUpgradeHandler(
configurator module.Configurator,
sk *stakingkeeper.Keeper,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("Starting upgrade for multi staking...")
fixMinCommisionRate(ctx, sk)
return mm.RunMigrations(ctx, configurator, vm)
Expand All @@ -28,11 +28,15 @@ func fixMinCommisionRate(ctx sdk.Context, staking *stakingkeeper.Keeper) {
minComm := sdk.MustNewDecFromStr(NewMinCommisionRate)
params := staking.GetParams(ctx)
params.MinCommissionRate = minComm
staking.SetParams(ctx, params)

err := staking.SetParams(ctx, params)
if err != nil {
panic(err)
}

for _, v := range validators {
//nolint
if v.Commission.Rate.LT(minComm) {
// We need to remove
comm, err := updateValidatorCommission(ctx, staking, v, minComm)
if err != nil {
panic(err)
Expand Down
4 changes: 1 addition & 3 deletions app/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"

sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

v4 "github.com/realiotech/realio-network/app/upgrades/v4"
"github.com/stretchr/testify/require"
)

func TestV4Upgrade(t *testing.T) {
Expand Down

0 comments on commit 1294ccd

Please sign in to comment.