feat: store migration setup (#794)

* feat: store migration setup

* comment

* changelog
This commit is contained in:
Federico Kunze Küllmer
2021-11-29 16:46:20 +01:00
committed by GitHub
parent bfe059e43e
commit 841c93cd65
6 changed files with 34 additions and 4 deletions
+13
View File
@@ -0,0 +1,13 @@
package keeper
// Migrator is a struct for handling in-place store migrations.
type Migrator struct {
keeper Keeper
}
// NewMigrator returns a new Migrator.
func NewMigrator(keeper Keeper) Migrator {
return Migrator{
keeper: keeper,
}
}
+3 -3
View File
@@ -115,15 +115,15 @@ func (AppModule) Name() string {
// RegisterInvariants interface for registering invariants. Performs a no-op
// as the evm module doesn't expose invariants.
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
// Invariats lead to performance degradation
//
// keeper.RegisterInvariants(ir, *am.keeper)
}
// RegisterQueryService registers a GRPC query service to respond to the
// module-specific GRPC queries.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterMsgServer(cfg.MsgServer(), am.keeper)
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
_ = keeper.NewMigrator(*am.keeper)
}
// Route returns the message routing key for the evm module.