From 636ce15f5eda0d911a07a0ba5c0c794d883776d5 Mon Sep 17 00:00:00 2001 From: Yaroms <103432884+Yaroms@users.noreply.github.com> Date: Thu, 2 Feb 2023 13:29:58 +0200 Subject: [PATCH] CNS upgrade plan 0.5.0 (#284) * rename to 0.5.0 * lint fix * lint fix --------- Co-authored-by: Yarom Swisa --- app/app.go | 4 ++-- app/upgrades/{v0_4_6 => v0_5_0}/upgrade.go | 6 +++--- x/epochstorage/keeper/stake_storage.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename app/upgrades/{v0_4_6 => v0_5_0}/upgrade.go (95%) diff --git a/app/app.go b/app/app.go index f61f6014ae..926bfaefa2 100644 --- a/app/app.go +++ b/app/app.go @@ -86,7 +86,7 @@ import ( "github.com/ignite-hq/cli/ignite/pkg/openapiconsole" "github.com/lavanet/lava/app/keepers" "github.com/lavanet/lava/app/upgrades" - "github.com/lavanet/lava/app/upgrades/v0_4_6" + "github.com/lavanet/lava/app/upgrades/v0_5_0" "github.com/lavanet/lava/docs" conflictmodule "github.com/lavanet/lava/x/conflict" conflictmodulekeeper "github.com/lavanet/lava/x/conflict/keeper" @@ -116,7 +116,7 @@ const ( ) // Upgrades add here future upgrades (upgrades.Upgrade) -var Upgrades = []upgrades.Upgrade{upgrades.Upgrade_0_4_0, upgrades.Upgrade_0_4_3, upgrades.Upgrade_0_4_4, upgrades.Upgrade_0_4_5, v0_4_6.Upgrade_v0_4_6} +var Upgrades = []upgrades.Upgrade{upgrades.Upgrade_0_4_0, upgrades.Upgrade_0_4_3, upgrades.Upgrade_0_4_4, upgrades.Upgrade_0_4_5, v0_5_0.Upgrade} // this line is used by starport scaffolding # stargate/wasm/app/enabledProposals diff --git a/app/upgrades/v0_4_6/upgrade.go b/app/upgrades/v0_5_0/upgrade.go similarity index 95% rename from app/upgrades/v0_4_6/upgrade.go rename to app/upgrades/v0_5_0/upgrade.go index 5c07e23e6a..65398235ee 100644 --- a/app/upgrades/v0_4_6/upgrade.go +++ b/app/upgrades/v0_5_0/upgrade.go @@ -1,4 +1,4 @@ -package v0_4_6 +package v0_5_0 import ( "log" @@ -13,9 +13,9 @@ import ( spectypes "github.com/lavanet/lava/x/spec/types" ) -const UpgradeName = "v0.4.6" +const UpgradeName = "v0.5.0" -var Upgrade_v0_4_6 = upgrades.Upgrade{ +var Upgrade = upgrades.Upgrade{ UpgradeName: UpgradeName, // upgrade name defined few lines above CreateUpgradeHandler: CreateUpgradeHandler, // 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 diff --git a/x/epochstorage/keeper/stake_storage.go b/x/epochstorage/keeper/stake_storage.go index 8d81859a29..c1aa6292f5 100644 --- a/x/epochstorage/keeper/stake_storage.go +++ b/x/epochstorage/keeper/stake_storage.go @@ -230,7 +230,7 @@ func (k Keeper) RemoveStakeEntryCurrent(ctx sdk.Context, storageType string, cha func (k Keeper) AppendStakeEntryCurrent(ctx sdk.Context, storageType string, chainID string, stakeEntry types.StakeEntry) { // this stake storage entries are sorted by stake amount stakeStorage, found := k.GetStakeStorageCurrent(ctx, storageType, chainID) - entries := []types.StakeEntry{} + var entries []types.StakeEntry if !found { entries = []types.StakeEntry{stakeEntry} // create a new one @@ -354,7 +354,7 @@ func (k Keeper) AppendUnstakeEntry(ctx sdk.Context, storageType string, stakeEnt // this stake storage entries are sorted by deadline stakeStorage, found := k.GetStakeStorageUnstake(ctx, storageType) - entries := []types.StakeEntry{} + var entries []types.StakeEntry if !found { entries = []types.StakeEntry{stakeEntry} // create a new one