diff --git a/x/ccv/consumer/module.go b/x/ccv/consumer/module.go index 594d38819a..ffbce0eb72 100644 --- a/x/ccv/consumer/module.go +++ b/x/ccv/consumer/module.go @@ -115,6 +115,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { consumertypes.RegisterQueryServer(cfg.QueryServer(), am.keeper) migrator := keeper.NewMigrator(am.keeper, am.paramSpace) + // TODO: adapt 'fromVersion' and use MigrateXtoY() instead once merged with main err := cfg.RegisterMigration(am.Name(), 1, migrator.MigrateParams) if err != nil { panic(err) diff --git a/x/ccv/provider/keeper/migration.go b/x/ccv/provider/keeper/migration.go index 336c5ebe69..0d295fe531 100644 --- a/x/ccv/provider/keeper/migration.go +++ b/x/ccv/provider/keeper/migration.go @@ -18,6 +18,11 @@ func NewMigrator(keeper Keeper, subspace paramtypes.Subspace) Migrator { } } +// Migration from consensus version 2 to 3 +func (m Migrator) Migrate2to3(ctx sdk.Context) error { + return m.MigrateParams(ctx) +} + // MigrateParams migrates the provider module's parameters from the x/params to self store. func (m Migrator) MigrateParams(ctx sdk.Context) error { params := GetParamsLegacy(ctx, m.legacySubspace) diff --git a/x/ccv/provider/module.go b/x/ccv/provider/module.go index a6cc456ac9..74f340db24 100644 --- a/x/ccv/provider/module.go +++ b/x/ccv/provider/module.go @@ -121,7 +121,8 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { providertypes.RegisterQueryServer(cfg.QueryServer(), am.keeper) migrator := keeper.NewMigrator(*am.keeper, am.paramSpace) - err := cfg.RegisterMigration(am.Name(), 2, migrator.MigrateParams) + // TODO: check/adapt 'fromVersion' once v0.50 branch merged with main + err := cfg.RegisterMigration(am.Name(), 2, migrator.Migrate2to3) if err != nil { panic(err) } diff --git a/x/ccv/provider/types/params.go b/x/ccv/provider/types/params.go index 9a4cbdb149..b4ca06a314 100644 --- a/x/ccv/provider/types/params.go +++ b/x/ccv/provider/types/params.go @@ -44,6 +44,9 @@ const ( ) // Reflection based keys for params subspace +// Legacy: usage of x/params for parameters is deprecated. +// Use x/ccv/provider/keeper/params instead +// [DEPRECATED] var ( KeyTemplateClient = []byte("TemplateClient") KeyTrustingPeriodFraction = []byte("TrustingPeriodFraction") diff --git a/x/ccv/types/params.go b/x/ccv/types/params.go index d44ec68c80..0891591403 100644 --- a/x/ccv/types/params.go +++ b/x/ccv/types/params.go @@ -43,6 +43,7 @@ const ( ) // Reflection based keys for params subspace +// [DEPRECATED] var ( KeyEnabled = []byte("Enabled") KeyBlocksPerDistributionTransmission = []byte("BlocksPerDistributionTransmission")