diff --git a/app/app.go b/app/app.go index a99fe948..75d331d6 100644 --- a/app/app.go +++ b/app/app.go @@ -52,8 +52,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades/v7_0_1" - // bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "cosmossdk.io/x/evidence" evidencetypes "cosmossdk.io/x/evidence/types" @@ -133,6 +131,7 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" upgrades "github.com/notional-labs/composable/v6/app/upgrades" + "github.com/notional-labs/composable/v6/app/upgrades/v7_0_3" ibctransfermiddlewaretypes "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" stakingmiddlewaretypes "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" ) @@ -152,7 +151,7 @@ var ( // https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 EnableSpecificProposals = "" - Upgrades = []upgrades.Upgrade{v7_0_1.Upgrade} + Upgrades = []upgrades.Upgrade{v7_0_3.Upgrade} Forks = []upgrades.Fork{} ) diff --git a/app/upgrades/v7_0_3/constants.go b/app/upgrades/v7_0_3/constants.go new file mode 100644 index 00000000..e6aaa551 --- /dev/null +++ b/app/upgrades/v7_0_3/constants.go @@ -0,0 +1,20 @@ +package v7_0_3 + +import ( + store "cosmossdk.io/store/types" + "github.com/notional-labs/composable/v6/app/upgrades" +) + +const ( + // UpgradeName defines the on-chain upgrade name for the composable upgrade. + UpgradeName = "v7_0_3" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{}, + Deleted: []string{}, + }, +} diff --git a/app/upgrades/v7_0_3/upgrade.go b/app/upgrades/v7_0_3/upgrade.go new file mode 100644 index 00000000..91ec859c --- /dev/null +++ b/app/upgrades/v7_0_3/upgrade.go @@ -0,0 +1,25 @@ +package v7_0_3 + +import ( + "context" + + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "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.Codec, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(goCtx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + return mm.RunMigrations(ctx, configurator, vm) + } +} diff --git a/scripts/test-upgrade.sh b/scripts/test-upgrade.sh index 0201d5bc..1fd9b52e 100755 --- a/scripts/test-upgrade.sh +++ b/scripts/test-upgrade.sh @@ -3,18 +3,13 @@ # the upgrade is a fork, "true" otherwise FORK=${FORK:-"false"} -OLD_VERSION=v6.6.41 +OLD_VERSION=v7_0_2 UPGRADE_WAIT=${UPGRADE_WAIT:-20} HOME=mytestnet ROOT=$(pwd) DENOM=ppica CHAIN_ID=localpica -SOFTWARE_UPGRADE_NAME="v7_0_1" -ADDITIONAL_PRE_SCRIPTS="" -ADDITIONAL_AFTER_SCRIPTS="" -SOFTWARE_UPGRADE_NAME="v6_6_1" -ADDITIONAL_PRE_SCRIPTS="./scripts/upgrade/v_6_4_8/pre-script.sh" -ADDITIONAL_AFTER_SCRIPTS="./scripts/upgrade/v_6_4_8/post-script.sh" +SOFTWARE_UPGRADE_NAME="v7_0_3" SLEEP_TIME=1