From 124b6a673c13d825b1c3027a972d92741ea82ded Mon Sep 17 00:00:00 2001 From: Yarom Swisa Date: Sun, 20 Nov 2022 12:57:19 +0200 Subject: [PATCH] add the upgrade plans --- app/app.go | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/app/app.go b/app/app.go index dce5524502..64d45b53f2 100644 --- a/app/app.go +++ b/app/app.go @@ -100,7 +100,6 @@ import ( pairingmodulekeeper "github.com/lavanet/lava/x/pairing/keeper" pairingmoduletypes "github.com/lavanet/lava/x/pairing/types" "github.com/lavanet/lava/x/spec" - specmodule "github.com/lavanet/lava/x/spec" specmoduleclient "github.com/lavanet/lava/x/spec/client" specmodulekeeper "github.com/lavanet/lava/x/spec/keeper" specmoduletypes "github.com/lavanet/lava/x/spec/types" @@ -113,16 +112,6 @@ import ( // this line is used by starport scaffolding # stargate/app/moduleImport ) -var Upgrade010 = upgrades.Upgrade{ - UpgradeName: "v0.1.0", // upgrade name defined few lines above - CreateUpgradeHandler: func(m *module.Manager, c module.Configurator, bapm upgrades.BaseAppParamManager, lk *keepers.LavaKeepers) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - return m.RunMigrations(ctx, c, vm) - } - }, // create CreateUpgradeHandler in upgrades.go below - StoreUpgrades: store.StoreUpgrades{}, // StoreUpgrades has 3 fields: Added/Renamed/Deleted any module that fits these description should be added in the way below -} - const ( AccountAddressPrefix = "lava@" Name = "lava" @@ -158,9 +147,29 @@ var Upgrade6 = upgrades.Upgrade{ StoreUpgrades: store.StoreUpgrades{}, // StoreUpgrades has 3 fields: Added/Renamed/Deleted any module that fits these description should be added in the way below } +var Upgrade010 = upgrades.Upgrade{ + UpgradeName: "v0.1.0", // upgrade name defined few lines above + CreateUpgradeHandler: func(m *module.Manager, c module.Configurator, bapm upgrades.BaseAppParamManager, lk *keepers.LavaKeepers) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + return m.RunMigrations(ctx, c, vm) + } + }, // create CreateUpgradeHandler in upgrades.go below + StoreUpgrades: store.StoreUpgrades{}, // StoreUpgrades has 3 fields: Added/Renamed/Deleted any module that fits these description should be added in the way below +} + +var Upgrade011 = upgrades.Upgrade{ + UpgradeName: "v0.1.1", // upgrade name defined few lines above + CreateUpgradeHandler: func(m *module.Manager, c module.Configurator, bapm upgrades.BaseAppParamManager, lk *keepers.LavaKeepers) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + return m.RunMigrations(ctx, c, vm) + } + }, // create CreateUpgradeHandler in upgrades.go below + StoreUpgrades: store.StoreUpgrades{}, // StoreUpgrades has 3 fields: Added/Renamed/Deleted any module that fits these description should be added in the way below +} + var ( // add here future upgrades (upgrades.Upgrade) - Upgrades = []upgrades.Upgrade{Upgrade2, Upgrade3, v4.Upgrade, v5.Upgrade, Upgrade6, Upgrade010} + Upgrades = []upgrades.Upgrade{Upgrade2, Upgrade3, v4.Upgrade, v5.Upgrade, Upgrade6, Upgrade010, Upgrade011} ) // this line is used by starport scaffolding # stargate/wasm/app/enabledProposals @@ -209,7 +218,7 @@ var ( evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, - specmodule.AppModuleBasic{}, + spec.AppModuleBasic{}, epochstoragemodule.AppModuleBasic{}, pairingmodule.AppModuleBasic{}, conflictmodule.AppModuleBasic{}, @@ -391,7 +400,7 @@ func New( keys[specmoduletypes.MemStoreKey], app.GetSubspace(specmoduletypes.ModuleName), ) - specModule := specmodule.NewAppModule(appCodec, app.SpecKeeper, app.AccountKeeper, app.BankKeeper) + specModule := spec.NewAppModule(appCodec, app.SpecKeeper, app.AccountKeeper, app.BankKeeper) // register the proposal types govRouter := govtypes.NewRouter()