Skip to content

Commit

Permalink
Merge pull request #284 from scorpioborn/upgrade/v1.1.1
Browse files Browse the repository at this point in the history
Upgrade/v1.1.1
  • Loading branch information
3eyedraga authored Nov 6, 2023
2 parents 76e7374 + 7aa89c1 commit 1a74c2a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
sgeappparams "github.com/sge-network/sge/app/params"
"github.com/sge-network/sge/app/upgrades"
v1 "github.com/sge-network/sge/app/upgrades/v1"
v2 "github.com/sge-network/sge/app/upgrades/v2"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
Expand Down Expand Up @@ -66,7 +67,10 @@ func getGovProposalHandlers() []govclient.ProposalHandler {
var (
// DefaultNodeHome default home directories for the application daemon
DefaultNodeHome string
Upgrades = []upgrades.Upgrade{v1.Upgrade}
Upgrades = []upgrades.Upgrade{
v1.Upgrade,
v2.Upgrade,
}
)

var (
Expand Down
19 changes: 19 additions & 0 deletions app/upgrades/v2/consts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package v2

import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/sge-network/sge/app/upgrades"
)

// UpgradeName defines the on-chain upgrade name for the v1.1.1 upgrade.
const UpgradeName = "v1.1.1"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{},
Deleted: []string{},
},
}
19 changes: 19 additions & 0 deletions app/upgrades/v2/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package v2

import (
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/sge-network/sge/app/keepers"
)

func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, configurator, fromVM)
}
}

0 comments on commit 1a74c2a

Please sign in to comment.