diff --git a/app/upgrades/v10/constants.go b/app/upgrades/v10/constants.go new file mode 100644 index 00000000..b5309736 --- /dev/null +++ b/app/upgrades/v10/constants.go @@ -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{}, + }, +} diff --git a/app/upgrades/v10/upgrades.go b/app/upgrades/v10/upgrades.go new file mode 100644 index 00000000..44d6f553 --- /dev/null +++ b/app/upgrades/v10/upgrades.go @@ -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) + } +}