From 23e917963313069ce4771ab0f445d791b551ce77 Mon Sep 17 00:00:00 2001 From: Khanh Hoa Date: Mon, 8 Apr 2024 10:47:47 +0700 Subject: [PATCH] remove old upgrade --- app/upgrades/v6_4_4/constants.go | 15 ---------- app/upgrades/v6_4_4/upgrade.go | 23 --------------- app/upgrades/v6_4_5/constants.go | 15 ---------- app/upgrades/v6_4_5/upgrade.go | 27 ------------------ app/upgrades/v6_4_6/constants.go | 22 --------------- app/upgrades/v6_4_6/contants.go | 22 --------------- app/upgrades/v6_4_6/upgrade.go | 28 ------------------ app/upgrades/v6_4_7/constants.go | 21 -------------- app/upgrades/v6_4_7/upgrade.go | 23 --------------- app/upgrades/v6_4_8/constants.go | 21 -------------- app/upgrades/v6_4_8/upgrade.go | 47 ------------------------------- app/upgrades/v6_4_9/constants.go | 20 ------------- app/upgrades/v6_4_9/upgrade.go | 23 --------------- app/upgrades/v6_4_91/constants.go | 20 ------------- app/upgrades/v6_4_91/upgrade.go | 23 --------------- 15 files changed, 350 deletions(-) delete mode 100644 app/upgrades/v6_4_4/constants.go delete mode 100644 app/upgrades/v6_4_4/upgrade.go delete mode 100644 app/upgrades/v6_4_5/constants.go delete mode 100644 app/upgrades/v6_4_5/upgrade.go delete mode 100644 app/upgrades/v6_4_6/constants.go delete mode 100644 app/upgrades/v6_4_6/contants.go delete mode 100644 app/upgrades/v6_4_6/upgrade.go delete mode 100644 app/upgrades/v6_4_7/constants.go delete mode 100644 app/upgrades/v6_4_7/upgrade.go delete mode 100644 app/upgrades/v6_4_8/constants.go delete mode 100644 app/upgrades/v6_4_8/upgrade.go delete mode 100644 app/upgrades/v6_4_9/constants.go delete mode 100644 app/upgrades/v6_4_9/upgrade.go delete mode 100644 app/upgrades/v6_4_91/constants.go delete mode 100644 app/upgrades/v6_4_91/upgrade.go diff --git a/app/upgrades/v6_4_4/constants.go b/app/upgrades/v6_4_4/constants.go deleted file mode 100644 index dac6950a1..000000000 --- a/app/upgrades/v6_4_4/constants.go +++ /dev/null @@ -1,15 +0,0 @@ -package v6_4_4 - -import ( - "github.com/notional-labs/composable/v6/app/upgrades" -) - -const ( - // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_4_47" -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, -} diff --git a/app/upgrades/v6_4_4/upgrade.go b/app/upgrades/v6_4_4/upgrade.go deleted file mode 100644 index b3273193a..000000000 --- a/app/upgrades/v6_4_4/upgrade.go +++ /dev/null @@ -1,23 +0,0 @@ -package v6_4_4 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - _ upgrades.BaseAppParamManager, - _ codec.Codec, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/app/upgrades/v6_4_5/constants.go b/app/upgrades/v6_4_5/constants.go deleted file mode 100644 index 55b602bb3..000000000 --- a/app/upgrades/v6_4_5/constants.go +++ /dev/null @@ -1,15 +0,0 @@ -package v6_4_5 - -import ( - "github.com/notional-labs/composable/v6/app/upgrades" -) - -const ( - // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_4_55" -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, -} diff --git a/app/upgrades/v6_4_5/upgrade.go b/app/upgrades/v6_4_5/upgrade.go deleted file mode 100644 index 72dbebe02..000000000 --- a/app/upgrades/v6_4_5/upgrade.go +++ /dev/null @@ -1,27 +0,0 @@ -package v6_4_5 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - _ upgrades.BaseAppParamManager, - _ codec.Codec, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - BrokenProposals := [3]uint64{2, 6, 11} - for _, proposal := range BrokenProposals { - keepers.GovKeeper.DeleteProposal(ctx, proposal) - } - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/app/upgrades/v6_4_6/constants.go b/app/upgrades/v6_4_6/constants.go deleted file mode 100644 index cbb8a3658..000000000 --- a/app/upgrades/v6_4_6/constants.go +++ /dev/null @@ -1,22 +0,0 @@ -package v6_4_6 - -import ( - store "github.com/cosmos/cosmos-sdk/store/types" - - "github.com/notional-labs/composable/v6/app/upgrades" - ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" -) - -const ( - // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_4_5" -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{ibctransfermiddleware.StoreKey}, - Deleted: []string{}, - }, -} diff --git a/app/upgrades/v6_4_6/contants.go b/app/upgrades/v6_4_6/contants.go deleted file mode 100644 index cbb8a3658..000000000 --- a/app/upgrades/v6_4_6/contants.go +++ /dev/null @@ -1,22 +0,0 @@ -package v6_4_6 - -import ( - store "github.com/cosmos/cosmos-sdk/store/types" - - "github.com/notional-labs/composable/v6/app/upgrades" - ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" -) - -const ( - // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_4_5" -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{ibctransfermiddleware.StoreKey}, - Deleted: []string{}, - }, -} diff --git a/app/upgrades/v6_4_6/upgrade.go b/app/upgrades/v6_4_6/upgrade.go deleted file mode 100644 index 183e63e80..000000000 --- a/app/upgrades/v6_4_6/upgrade.go +++ /dev/null @@ -1,28 +0,0 @@ -package v6_4_6 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades" - ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - _ upgrades.BaseAppParamManager, - _ codec.Codec, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - // Add params for custom middleware - custommiddlewareparams := ibctransfermiddleware.DefaultGenesisState() - keepers.IbcTransferMiddlewareKeeper.SetParams(ctx, custommiddlewareparams.Params) - - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/app/upgrades/v6_4_7/constants.go b/app/upgrades/v6_4_7/constants.go deleted file mode 100644 index 549c1e41e..000000000 --- a/app/upgrades/v6_4_7/constants.go +++ /dev/null @@ -1,21 +0,0 @@ -package v6_4_7 - -import ( - store "github.com/cosmos/cosmos-sdk/store/types" - - "github.com/notional-labs/composable/v6/app/upgrades" -) - -const ( - // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_4_6" -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{}, - Deleted: []string{}, - }, -} diff --git a/app/upgrades/v6_4_7/upgrade.go b/app/upgrades/v6_4_7/upgrade.go deleted file mode 100644 index 682c58a62..000000000 --- a/app/upgrades/v6_4_7/upgrade.go +++ /dev/null @@ -1,23 +0,0 @@ -package v6_4_7 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - _ upgrades.BaseAppParamManager, - _ codec.Codec, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/app/upgrades/v6_4_8/constants.go b/app/upgrades/v6_4_8/constants.go deleted file mode 100644 index bb164f5ca..000000000 --- a/app/upgrades/v6_4_8/constants.go +++ /dev/null @@ -1,21 +0,0 @@ -package v6_4_8 - -import ( - store "github.com/cosmos/cosmos-sdk/store/types" - "github.com/notional-labs/composable/v6/app/upgrades" - ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" -) - -const ( - // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_4_8" -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{ibctransfermiddleware.StoreKey}, - Deleted: []string{}, - }, -} diff --git a/app/upgrades/v6_4_8/upgrade.go b/app/upgrades/v6_4_8/upgrade.go deleted file mode 100644 index 58fe2a14d..000000000 --- a/app/upgrades/v6_4_8/upgrade.go +++ /dev/null @@ -1,47 +0,0 @@ -package v6_4_8 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades" - ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - _ upgrades.BaseAppParamManager, - _ codec.Codec, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - custommiddlewareparams := ibctransfermiddleware.DefaultGenesisState() - keepers.IbcTransferMiddlewareKeeper.SetParams(ctx, custommiddlewareparams.Params) - - // remove broken proposals - BrokenProposals := [3]uint64{2, 6, 11} - for _, proposal_id := range BrokenProposals { - _, ok := keepers.GovKeeper.GetProposal(ctx, proposal_id) - if ok { - keepers.GovKeeper.DeleteProposal(ctx, proposal_id) - } - - } - - // burn extra ppica in escrow account - // this ppica is unused because it is a native token stored in escrow account - // it was unnecessarily minted to match pica escrowed on picasso to ppica minted - // in genesis, to make initial native ppica transferrable to picasso - amount, ok := sdk.NewIntFromString("1066669217167120000000") - if ok { - coins := sdk.Coins{sdk.NewCoin("ppica", amount)} - keepers.BankKeeper.SendCoinsFromAccountToModule(ctx, sdk.MustAccAddressFromBech32("centauri12k2pyuylm9t7ugdvz67h9pg4gmmvhn5vmvgw48"), "gov", coins) - keepers.BankKeeper.BurnCoins(ctx, "gov", coins) - } - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/app/upgrades/v6_4_9/constants.go b/app/upgrades/v6_4_9/constants.go deleted file mode 100644 index 4572af53f..000000000 --- a/app/upgrades/v6_4_9/constants.go +++ /dev/null @@ -1,20 +0,0 @@ -package v6_4_9 - -import ( - store "github.com/cosmos/cosmos-sdk/store/types" - "github.com/notional-labs/composable/v6/app/upgrades" -) - -const ( - // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_4_9" -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{}, - Deleted: []string{}, - }, -} diff --git a/app/upgrades/v6_4_9/upgrade.go b/app/upgrades/v6_4_9/upgrade.go deleted file mode 100644 index 70b06b6a6..000000000 --- a/app/upgrades/v6_4_9/upgrade.go +++ /dev/null @@ -1,23 +0,0 @@ -package v6_4_9 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - _ upgrades.BaseAppParamManager, - _ codec.Codec, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/app/upgrades/v6_4_91/constants.go b/app/upgrades/v6_4_91/constants.go deleted file mode 100644 index 83a2fb7f7..000000000 --- a/app/upgrades/v6_4_91/constants.go +++ /dev/null @@ -1,20 +0,0 @@ -package v6_4_91 - -import ( - store "github.com/cosmos/cosmos-sdk/store/types" - "github.com/notional-labs/composable/v6/app/upgrades" -) - -const ( - // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_4_91" -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{}, - Deleted: []string{}, - }, -} diff --git a/app/upgrades/v6_4_91/upgrade.go b/app/upgrades/v6_4_91/upgrade.go deleted file mode 100644 index a1888ea62..000000000 --- a/app/upgrades/v6_4_91/upgrade.go +++ /dev/null @@ -1,23 +0,0 @@ -package v6_4_91 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - _ upgrades.BaseAppParamManager, - _ codec.Codec, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, configurator, vm) - } -}