diff --git a/app/app.go b/app/app.go index d82500f2..a82d8190 100644 --- a/app/app.go +++ b/app/app.go @@ -147,6 +147,7 @@ import ( v2 "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/upgrades/v2" "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/upgrades/v2_2_5" v3 "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/upgrades/v3" + v3_0_2 "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/upgrades/v3_0_2" ) const ( @@ -165,7 +166,7 @@ var ( // https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 EnableSpecificProposals = "" - Upgrades = []upgrades.Upgrade{v2.Upgrade, v2_2_5.Upgrade, v3.Upgrade} + Upgrades = []upgrades.Upgrade{v2.Upgrade, v2_2_5.Upgrade, v3.Upgrade, v3_0_2.Upgrade} ) // GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to @@ -1099,6 +1100,7 @@ func (app *MigalooApp) setupUpgradeHandlers(cfg module.Configurator) { } for _, upgrade := range Upgrades { + upgrade := upgrade if upgradeInfo.Name == upgrade.UpgradeName { app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &upgrade.StoreUpgrades)) } diff --git a/app/upgrades/v3_0_2/constants.go b/app/upgrades/v3_0_2/constants.go new file mode 100644 index 00000000..2670b147 --- /dev/null +++ b/app/upgrades/v3_0_2/constants.go @@ -0,0 +1,14 @@ +package v3 + +import ( + "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/upgrades" +) + +// UpgradeName defines the on-chain upgrade name for the Migaloo v3.0.2 upgrade. +// this upgrade includes the fix for pfm +const UpgradeName = "v3.0.2" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, +} diff --git a/app/upgrades/v3_0_2/upgrades.go b/app/upgrades/v3_0_2/upgrades.go new file mode 100644 index 00000000..7095d92b --- /dev/null +++ b/app/upgrades/v3_0_2/upgrades.go @@ -0,0 +1,17 @@ +package v3 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +// small security fix, can be a no-op, running mm.RunMigarions just to be sure +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, configurator, vm) + } +}