Skip to content

Commit

Permalink
upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Nov 8, 2024
1 parent 4f43caa commit 2d1ba1d
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,31 @@ import (

upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/cosmos/cosmos-sdk/types/module"

opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"
)

const upgradeName = "0.6.0"
const upgradeName = "0.6.2"

// RegisterUpgradeHandlers returns upgrade handlers
func (app *MinitiaApp) RegisterUpgradeHandlers(cfg module.Configurator) {
app.UpgradeKeeper.SetUpgradeHandler(upgradeName,
func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return fromVM, nil
app.UpgradeKeeper.SetUpgradeHandler(
upgradeName,
func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
params, err := app.OPChildKeeper.GetParams(ctx)
if err != nil {
return nil, err
}

// set non-zero default values for new params
params.HookMaxGas = opchildtypes.DefaultHookMaxGas

err = app.OPChildKeeper.SetParams(ctx, params)
if err != nil {
return nil, err
}

return vm, nil
},
)
}

0 comments on commit 2d1ba1d

Please sign in to comment.