From 66d7a5d0ea912d44d0c89190a1848dcdffe49353 Mon Sep 17 00:00:00 2001 From: Adam Fraser Date: Fri, 18 Oct 2024 11:10:31 -0400 Subject: [PATCH] Drop patch number from upgrade name, v7.0.0 to v7.0 (#2512) --- protocol/app/upgrades.go | 12 ++++++------ protocol/app/upgrades/{v7.0.0 => v7.0}/constants.go | 4 ++-- protocol/app/upgrades/{v7.0.0 => v7.0}/upgrade.go | 2 +- .../{v7.0.0 => v7.0}/upgrade_container_test.go | 6 +++--- protocol/testing/version/VERSION_CURRENT | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) rename protocol/app/upgrades/{v7.0.0 => v7.0}/constants.go (89%) rename protocol/app/upgrades/{v7.0.0 => v7.0}/upgrade.go (99%) rename protocol/app/upgrades/{v7.0.0 => v7.0}/upgrade_container_test.go (97%) diff --git a/protocol/app/upgrades.go b/protocol/app/upgrades.go index 8c16de0aab..207a5ba815 100644 --- a/protocol/app/upgrades.go +++ b/protocol/app/upgrades.go @@ -3,7 +3,7 @@ package app import ( "fmt" - v7_0_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0.0" + v7_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0" upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,7 +14,7 @@ var ( // `Upgrades` defines the upgrade handlers and store loaders for the application. // New upgrades should be added to this slice after they are implemented. Upgrades = []upgrades.Upgrade{ - v7_0_0.Upgrade, + v7_0.Upgrade, } Forks = []upgrades.Fork{} ) @@ -22,12 +22,12 @@ var ( // setupUpgradeHandlers registers the upgrade handlers to perform custom upgrade // logic and state migrations for software upgrades. func (app *App) setupUpgradeHandlers() { - if app.UpgradeKeeper.HasHandler(v7_0_0.UpgradeName) { - panic(fmt.Sprintf("Cannot register duplicate upgrade handler '%s'", v7_0_0.UpgradeName)) + if app.UpgradeKeeper.HasHandler(v7_0.UpgradeName) { + panic(fmt.Sprintf("Cannot register duplicate upgrade handler '%s'", v7_0.UpgradeName)) } app.UpgradeKeeper.SetUpgradeHandler( - v7_0_0.UpgradeName, - v7_0_0.CreateUpgradeHandler( + v7_0.UpgradeName, + v7_0.CreateUpgradeHandler( app.ModuleManager, app.configurator, app.AccountKeeper, diff --git a/protocol/app/upgrades/v7.0.0/constants.go b/protocol/app/upgrades/v7.0/constants.go similarity index 89% rename from protocol/app/upgrades/v7.0.0/constants.go rename to protocol/app/upgrades/v7.0/constants.go index 505ecf220c..6fa36c8276 100644 --- a/protocol/app/upgrades/v7.0.0/constants.go +++ b/protocol/app/upgrades/v7.0/constants.go @@ -1,4 +1,4 @@ -package v_7_0_0 +package v_7_0 import ( store "cosmossdk.io/store/types" @@ -7,7 +7,7 @@ import ( ) const ( - UpgradeName = "v7.0.0" + UpgradeName = "v7.0" ) var Upgrade = upgrades.Upgrade{ diff --git a/protocol/app/upgrades/v7.0.0/upgrade.go b/protocol/app/upgrades/v7.0/upgrade.go similarity index 99% rename from protocol/app/upgrades/v7.0.0/upgrade.go rename to protocol/app/upgrades/v7.0/upgrade.go index dbf8f5644c..0c520e8177 100644 --- a/protocol/app/upgrades/v7.0.0/upgrade.go +++ b/protocol/app/upgrades/v7.0/upgrade.go @@ -1,4 +1,4 @@ -package v_7_0_0 +package v_7_0 import ( "context" diff --git a/protocol/app/upgrades/v7.0.0/upgrade_container_test.go b/protocol/app/upgrades/v7.0/upgrade_container_test.go similarity index 97% rename from protocol/app/upgrades/v7.0.0/upgrade_container_test.go rename to protocol/app/upgrades/v7.0/upgrade_container_test.go index 069c647b19..d65a77d568 100644 --- a/protocol/app/upgrades/v7.0.0/upgrade_container_test.go +++ b/protocol/app/upgrades/v7.0/upgrade_container_test.go @@ -1,6 +1,6 @@ //go:build all || container_test -package v_7_0_0_test +package v_7_0_test import ( "math/big" @@ -11,7 +11,7 @@ import ( "github.com/cosmos/gogoproto/proto" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - v_7_0_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0.0" + v_7_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0" "github.com/dydxprotocol/v4-chain/protocol/dtypes" "github.com/dydxprotocol/v4-chain/protocol/testing/containertest" "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" @@ -38,7 +38,7 @@ func TestStateUpgrade(t *testing.T) { preUpgradeSetups(node, t) preUpgradeChecks(node, t) - err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_0_0.UpgradeName) + err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_0.UpgradeName) require.NoError(t, err) postUpgradeChecks(node, t) diff --git a/protocol/testing/version/VERSION_CURRENT b/protocol/testing/version/VERSION_CURRENT index 52b9e4083c..5593dc1fd4 100644 --- a/protocol/testing/version/VERSION_CURRENT +++ b/protocol/testing/version/VERSION_CURRENT @@ -1 +1 @@ -v7.0.0 \ No newline at end of file +v7.0 \ No newline at end of file