Skip to content

Commit

Permalink
upgrade handler for v410 (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMarstonConnell authored Sep 12, 2024
2 parents af32726 + 735c427 commit 4e64e64
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/jackalLabs/canine-chain/v4/app/upgrades/testnet/beta7"
v3 "github.com/jackalLabs/canine-chain/v4/app/upgrades/v3"
v4 "github.com/jackalLabs/canine-chain/v4/app/upgrades/v4"
"github.com/jackalLabs/canine-chain/v4/app/upgrades/v410beta"
"github.com/jackalLabs/canine-chain/v4/app/upgrades/v4alpha1"
"github.com/jackalLabs/canine-chain/v4/app/upgrades/v4alpha3"
"github.com/jackalLabs/canine-chain/v4/app/upgrades/v4alpha5"
Expand All @@ -26,6 +27,7 @@ func (app *JackalApp) registerTestnetUpgradeHandlers() {
app.registerUpgrade(v4alpha1.NewUpgrade(app.mm, app.configurator))
app.registerUpgrade(v4alpha3.NewUpgrade(app.mm, app.configurator))
app.registerUpgrade(v4alpha5.NewUpgrade(app.mm, app.configurator))
app.registerUpgrade(v410beta.NewUpgrade(app.mm, app.configurator))
}

func (app *JackalApp) registerMainnetUpgradeHandlers() {
Expand Down
44 changes: 44 additions & 0 deletions app/upgrades/v410beta/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package v410beta

import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
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/jackalLabs/canine-chain/v4/app/upgrades"
)

var _ upgrades.Upgrade = &Upgrade{}

type Upgrade struct {
mm *module.Manager
configurator module.Configurator
}

// NewUpgrade returns a new Upgrade instance
func NewUpgrade(mm *module.Manager, configurator module.Configurator) *Upgrade {
return &Upgrade{
mm: mm,
configurator: configurator,
}
}

// Name implements upgrades.Upgrade
func (u *Upgrade) Name() string {
return "v410beta"
}

// Handler implements upgrades.Upgrade
func (u *Upgrade) Handler() upgradetypes.UpgradeHandler {
return func(_ sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return fromVM, nil
}
}

// StoreUpgrades implements upgrades.Upgrade
func (u *Upgrade) StoreUpgrades() *storetypes.StoreUpgrades {
return &storetypes.StoreUpgrades{
Added: []string{},
Deleted: []string{},
}
}

0 comments on commit 4e64e64

Please sign in to comment.