Skip to content

Commit

Permalink
Merge branch 'main' into chore/pstake-bump
Browse files Browse the repository at this point in the history
  • Loading branch information
kruspy authored Oct 20, 2023
2 parents 5c6aa9e + 9e592d8 commit 91e11a6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/upgrades/v10/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package v10

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

"github.com/persistenceOne/persistenceCore/v9/app/upgrades"
)

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

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

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/persistenceOne/persistenceCore/v9/app/upgrades"
)

func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("running upgrade handler")

consensusParams, err := args.Keepers.ConsensusParamsKeeper.Get(ctx)
if err != nil {
panic(err)
}
consensusParams.Block.MaxBytes = 5242880
args.Keepers.ConsensusParamsKeeper.Set(ctx, consensusParams)

return args.ModuleManager.RunMigrations(ctx, args.Configurator, vm)
}
}

0 comments on commit 91e11a6

Please sign in to comment.