From 89d6c6f7129ddee72f9eacc2d30457765b960133 Mon Sep 17 00:00:00 2001 From: kenta-elys Date: Mon, 27 Nov 2023 06:45:48 +0000 Subject: [PATCH] chore: add incentive param migrator --- x/incentive/migrations/v7_migration.go | 11 +++++++++++ x/incentive/module.go | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 x/incentive/migrations/v7_migration.go diff --git a/x/incentive/migrations/v7_migration.go b/x/incentive/migrations/v7_migration.go new file mode 100644 index 000000000..adcfe5a75 --- /dev/null +++ b/x/incentive/migrations/v7_migration.go @@ -0,0 +1,11 @@ +package migrations + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/elys-network/elys/x/incentive/types" +) + +func (m Migrator) V7Migration(ctx sdk.Context) error { + m.keeper.SetParams(ctx, types.NewParams()) + return nil +} diff --git a/x/incentive/module.go b/x/incentive/module.go index 2ba2bb2c1..1f692362f 100644 --- a/x/incentive/module.go +++ b/x/incentive/module.go @@ -111,7 +111,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) m := migrations.NewMigrator(am.keeper) - err := cfg.RegisterMigration(types.ModuleName, 5, m.V6Migration) + err := cfg.RegisterMigration(types.ModuleName, 6, m.V7Migration) if err != nil { panic(err) } @@ -137,7 +137,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1 -func (AppModule) ConsensusVersion() uint64 { return 6 } +func (AppModule) ConsensusVersion() uint64 { return 7 } // BeginBlock contains the logic that is automatically triggered at the beginning of each block func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {}