From f5e863034572be3473b7e4ba99466156f4e32091 Mon Sep 17 00:00:00 2001 From: Lior Bondarevski Date: Sat, 23 Sep 2023 20:42:56 +0300 Subject: [PATCH 1/3] Keep track with testnet consensus version --- x/compute/internal/keeper/migrations.go | 5 +++++ x/compute/module.go | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/x/compute/internal/keeper/migrations.go b/x/compute/internal/keeper/migrations.go index 277269454..4eb56c405 100644 --- a/x/compute/internal/keeper/migrations.go +++ b/x/compute/internal/keeper/migrations.go @@ -63,3 +63,8 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error { return nil } + +func (m Migrator) Migrate2to3(ctx sdk.Context) error { + // Keep it empty it is only here because we had a bug in testnet + return nil +} diff --git a/x/compute/module.go b/x/compute/module.go index 8ce1c5fe4..ce79738e5 100644 --- a/x/compute/module.go +++ b/x/compute/module.go @@ -103,7 +103,7 @@ func NewAppModule(keeper Keeper) AppModule { } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } +func (AppModule) ConsensusVersion() uint64 { return 3 } func (am AppModule) RegisterServices(configurator module.Configurator) { types.RegisterMsgServer(configurator.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) @@ -114,6 +114,10 @@ func (am AppModule) RegisterServices(configurator module.Configurator) { if err != nil { panic(err) } + err = configurator.RegisterMigration(types.ModuleName, 2, m.Migrate2to3) + if err != nil { + panic(err) + } } func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { From 820cfd7f58ce31e5438c85d698e4a914996c158f Mon Sep 17 00:00:00 2001 From: Lior Bondarevski Date: Sat, 23 Sep 2023 20:49:41 +0300 Subject: [PATCH 2/3] unused --- x/compute/internal/keeper/migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/compute/internal/keeper/migrations.go b/x/compute/internal/keeper/migrations.go index 4eb56c405..ca33fff21 100644 --- a/x/compute/internal/keeper/migrations.go +++ b/x/compute/internal/keeper/migrations.go @@ -64,7 +64,7 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error { return nil } -func (m Migrator) Migrate2to3(ctx sdk.Context) error { +func (m Migrator) Migrate2to3(_ sdk.Context) error { // Keep it empty it is only here because we had a bug in testnet return nil } From b18eb20ee10c380ebe4a0aa8855e40cb4b99d601 Mon Sep 17 00:00:00 2001 From: Lior Bondarevski Date: Mon, 25 Sep 2023 02:00:47 +0300 Subject: [PATCH 3/3] Bump consensus version --- x/compute/internal/keeper/migrations.go | 5 +++++ x/compute/module.go | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/x/compute/internal/keeper/migrations.go b/x/compute/internal/keeper/migrations.go index ca33fff21..dc887b94c 100644 --- a/x/compute/internal/keeper/migrations.go +++ b/x/compute/internal/keeper/migrations.go @@ -68,3 +68,8 @@ func (m Migrator) Migrate2to3(_ sdk.Context) error { // Keep it empty it is only here because we had a bug in testnet return nil } + +func (m Migrator) Migrate3to4(_ sdk.Context) error { + // Keep it empty it is only here because we had a bug in testnet + return nil +} diff --git a/x/compute/module.go b/x/compute/module.go index ce79738e5..fbacc250f 100644 --- a/x/compute/module.go +++ b/x/compute/module.go @@ -103,7 +103,7 @@ func NewAppModule(keeper Keeper) AppModule { } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 3 } +func (AppModule) ConsensusVersion() uint64 { return 4 } func (am AppModule) RegisterServices(configurator module.Configurator) { types.RegisterMsgServer(configurator.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) @@ -118,6 +118,11 @@ func (am AppModule) RegisterServices(configurator module.Configurator) { if err != nil { panic(err) } + + err = configurator.RegisterMigration(types.ModuleName, 3, m.Migrate3to4) + if err != nil { + panic(err) + } } func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier {