Skip to content

Commit

Permalink
refactor: update go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Apr 17, 2024
1 parent abb638a commit 830d4b3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 378 deletions.
20 changes: 12 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ import (
appparams "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/params"

// unnamed import of statik for swagger UI support
v3_0_2 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v3_0_2"
v32 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v3_0_2"
v42 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_2"
v44 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_4"
v45 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_5"
"github.com/rakyll/statik/fs"

Expand Down Expand Up @@ -1181,14 +1182,9 @@ func RegisterSwaggerAPI(rtr *mux.Router) {
// Setup Upgrade Handler
func (app *MigalooApp) setupUpgradeHandlers() {
app.UpgradeKeeper.SetUpgradeHandler(
v3_0_2.UpgradeName,
v3_0_2.CreateUpgradeHandler(app.mm, app.configurator),
v32.UpgradeName,
v32.CreateUpgradeHandler(app.mm, app.configurator),
)

// !! ATTENTION !!
// v4 upgrade handler
// !! WHEN UPGRADING TO SDK v0.47 MAKE SURE TO INCLUDE THIS
// source: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/UPGRADING.md#xconsensus
app.UpgradeKeeper.SetUpgradeHandler(
v42.UpgradeName,
v42.CreateUpgradeHandler(
Expand All @@ -1201,6 +1197,14 @@ func (app *MigalooApp) setupUpgradeHandlers() {
app.AccountKeeper,
),
)
app.UpgradeKeeper.SetUpgradeHandler(
v44.UpgradeName,
v44.CreateUpgradeHandler(
app.mm,
app.configurator,
),
)

app.UpgradeKeeper.SetUpgradeHandler(
v45.UpgradeName,
v45.CreateUpgradeHandler(
Expand Down
7 changes: 7 additions & 0 deletions app/upgrades/v4_1_4/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package v4

// UpgradeName defines the on-chain upgrade name for the Migaloo v4.1.4 upgrade.
// this upgrade includes the fix for pfm
const (
UpgradeName = "v4.1.4"
)
17 changes: 17 additions & 0 deletions app/upgrades/v4_1_4/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package v4

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

// CreateUpgradeHandler that migrates the chain from v4.1.3 to v4.1.4
func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, configurator, fromVM)
}
}
Loading

0 comments on commit 830d4b3

Please sign in to comment.