Skip to content

Commit

Permalink
Merge pull request #412 from neutron-org/feat/upgrade-handler-after-2…
Browse files Browse the repository at this point in the history
….0.1

added empty upgrade handler for 2.0.2
  • Loading branch information
pr0n00gler authored Jan 15, 2024
2 parents 33570a1 + c60535a commit 57a25eb
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import (
"github.com/neutron-org/neutron/v2/docs"

"github.com/neutron-org/neutron/v2/app/upgrades"
v030 "github.com/neutron-org/neutron/v2/app/upgrades/v0.3.0"
v044 "github.com/neutron-org/neutron/v2/app/upgrades/v0.4.4"
v200 "github.com/neutron-org/neutron/v2/app/upgrades/v2.0.0"
"github.com/neutron-org/neutron/v2/app/upgrades/v0.3.0"
"github.com/neutron-org/neutron/v2/app/upgrades/v0.4.4"
"github.com/neutron-org/neutron/v2/app/upgrades/v2.0.0"
"github.com/neutron-org/neutron/v2/app/upgrades/v2.0.2"

"github.com/neutron-org/neutron/v2/x/cron"

"github.com/CosmWasm/wasmd/x/wasm"
Expand Down Expand Up @@ -166,7 +168,7 @@ const (
)

var (
Upgrades = []upgrades.Upgrade{v030.Upgrade, v044.Upgrade, v200.Upgrade}
Upgrades = []upgrades.Upgrade{v030.Upgrade, v044.Upgrade, v200.Upgrade, v202.Upgrade}

// DefaultNodeHome default home directories for the application daemon
DefaultNodeHome string
Expand Down
15 changes: 15 additions & 0 deletions app/upgrades/v2.0.2/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package v202

import (
"github.com/neutron-org/neutron/v2/app/upgrades"
)

const (
// UpgradeName defines the on-chain upgrade name.
UpgradeName = "v2.0.2"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
}
24 changes: 24 additions & 0 deletions app/upgrades/v2.0.2/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package v202

import (
"fmt"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/neutron-org/neutron/v2/app/upgrades"
)

func CreateUpgradeHandler(
_ *module.Manager,
_ module.Configurator,
_ *upgrades.UpgradeKeepers,
_ upgrades.StoreKeys,
_ codec.Codec,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info(fmt.Sprintf("Empty migration {%s} applied", UpgradeName))
return vm, nil
}
}

0 comments on commit 57a25eb

Please sign in to comment.