Skip to content

Commit

Permalink
chore: add incentive param migrator
Browse files Browse the repository at this point in the history
  • Loading branch information
kenta-elys committed Nov 27, 2023
1 parent 3daacaf commit 89d6c6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions x/incentive/migrations/v7_migration.go
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions x/incentive/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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) {}
Expand Down

0 comments on commit 89d6c6f

Please sign in to comment.