Skip to content

Commit

Permalink
chore: change upgrade order
Browse files Browse the repository at this point in the history
  • Loading branch information
shifty11 committed Sep 12, 2023
1 parent fb1c053 commit b28e024
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/upgrades/v1_4/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
ibcTmMigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations"

// Consensus
consensusKeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
Expand All @@ -15,8 +16,7 @@ import (
govKeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
// IBC Core
ibcKeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
// IBC Light Clients
ibcTmMigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations"

// Params
paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types"
Expand Down Expand Up @@ -45,12 +45,6 @@ func CreateUpgradeHandler(
WithKeyTable(paramsTypes.ConsensusParamsKeyTable())
baseapp.MigrateParams(ctx, baseAppSubspace, &consensusKeeper)

// Prune expired Tendermint consensus states.
_, err = ibcTmMigrations.PruneExpiredConsensusStates(ctx, cdc, ibcKeeper.ClientKeeper)
if err != nil {
return vm, err
}

// ibc-go v7.0 to v7.1 upgrade
// explicitly update the IBC 02-client params, adding the localhost client type
params := ibcKeeper.ClientKeeper.GetParams(ctx)
Expand All @@ -63,6 +57,12 @@ func CreateUpgradeHandler(
return vm, err
}

// Prune expired Tendermint consensus states.
_, err = ibcTmMigrations.PruneExpiredConsensusStates(ctx, cdc, ibcKeeper.ClientKeeper)
if err != nil {
return vm, err
}

// Migrate initial deposit ratio.
err = migrateInitialDepositRatio(ctx, globalKeeper, govKeeper)
if err != nil {
Expand Down

0 comments on commit b28e024

Please sign in to comment.