Skip to content

Commit

Permalink
add upgrade handler for v3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
catShaark committed Nov 2, 2023
1 parent abd6fe1 commit eced8c4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
Expand Down
14 changes: 14 additions & 0 deletions app/upgrades/v3_0_2/constants.go
Original file line number Diff line number Diff line change
@@ -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,
}
17 changes: 17 additions & 0 deletions app/upgrades/v3_0_2/upgrades.go
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit eced8c4

Please sign in to comment.