diff --git a/app/app.go b/app/app.go index cdd662ab8..4b393b934 100644 --- a/app/app.go +++ b/app/app.go @@ -50,6 +50,7 @@ import ( v6 "github.com/classic-terra/core/v2/app/upgrades/v6" v6_1 "github.com/classic-terra/core/v2/app/upgrades/v6_1" v7 "github.com/classic-terra/core/v2/app/upgrades/v7" + v7_testnet "github.com/classic-terra/core/v2/app/upgrades/v7_testnet" customante "github.com/classic-terra/core/v2/custom/auth/ante" custompost "github.com/classic-terra/core/v2/custom/auth/post" @@ -68,7 +69,7 @@ var ( DefaultNodeHome string // Upgrades defines upgrades to be applied to the network - Upgrades = []upgrades.Upgrade{v2.Upgrade, v3.Upgrade, v4.Upgrade, v5.Upgrade, v6.Upgrade, v6_1.Upgrade, v7.Upgrade} + Upgrades = []upgrades.Upgrade{v2.Upgrade, v3.Upgrade, v4.Upgrade, v5.Upgrade, v6.Upgrade, v6_1.Upgrade, v7.Upgrade, v7_testnet.Upgrade} // Forks defines forks to be applied to the network Forks = []upgrades.Fork{} diff --git a/app/upgrades/v7_testnet/constants.go b/app/upgrades/v7_testnet/constants.go new file mode 100644 index 000000000..264e40cb3 --- /dev/null +++ b/app/upgrades/v7_testnet/constants.go @@ -0,0 +1,19 @@ +package v7 + +import ( + "github.com/classic-terra/core/v2/app/upgrades" + store "github.com/cosmos/cosmos-sdk/store/types" + forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/router/types" +) + +const UpgradeName = "v7_testnet" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateV7TestnetUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Deleted: []string{ + forwardtypes.StoreKey, + }, + }, +} diff --git a/app/upgrades/v7_testnet/upgrades.go b/app/upgrades/v7_testnet/upgrades.go new file mode 100644 index 000000000..ab1b39cc5 --- /dev/null +++ b/app/upgrades/v7_testnet/upgrades.go @@ -0,0 +1,20 @@ +package v7 + +import ( + "github.com/classic-terra/core/v2/app/keepers" + "github.com/classic-terra/core/v2/app/upgrades" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +func CreateV7TestnetUpgradeHandler( + mm *module.Manager, + cfg module.Configurator, + _ upgrades.BaseAppParamManager, + _ *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, cfg, fromVM) + } +} diff --git a/go.mod b/go.mod index 7f57c8f7f..e56ed419b 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/CosmWasm/wasmvm v1.1.2 github.com/cosmos/cosmos-sdk v0.46.15 github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.1 github.com/cosmos/ibc-go/v6 v6.2.1 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.3 @@ -40,6 +41,7 @@ require ( github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect + github.com/iancoleman/orderedmap v0.2.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect diff --git a/go.sum b/go.sum index 026fa3dd3..d78a6afe6 100644 --- a/go.sum +++ b/go.sum @@ -393,6 +393,8 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.7 h1:ij32FaEnwxfEurtK0QKDNhTWFnz6NUmrI5gky/WnoY0= github.com/cosmos/iavl v0.19.7/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.1 h1:2geCtV4PoNPeRnVc0HMAcRcv+7W3Mvk2nmASkGkOdzE= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.1/go.mod h1:ovYRGX7P7Vq0D54JIVlIm/47STEKgWJfw9frvL0AWGQ= github.com/cosmos/ibc-go/v6 v6.2.1 h1:NiaDXTRhKwf3n9kELD4VRIe5zby1yk1jBvaz9tXTQ6k= github.com/cosmos/ibc-go/v6 v6.2.1/go.mod h1:XLsARy4Y7+GtAqzMcxNdlQf6lx+ti1e8KcMGv5NIK7A= github.com/cosmos/interchain-accounts v0.4.3 h1:WedxEa/Hj/2GY7AF6CafkEPJ/Z9rhl3rT1mRwNHsdts= @@ -764,6 +766,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= +github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=