diff --git a/app/app.go b/app/app.go index 73a944da7..823d41c85 100644 --- a/app/app.go +++ b/app/app.go @@ -55,6 +55,7 @@ import ( v7 "github.com/classic-terra/core/v3/app/upgrades/v7" v7_1 "github.com/classic-terra/core/v3/app/upgrades/v7_1" v8 "github.com/classic-terra/core/v3/app/upgrades/v8" + v8_1 "github.com/classic-terra/core/v3/app/upgrades/v8_1" customante "github.com/classic-terra/core/v3/custom/auth/ante" custompost "github.com/classic-terra/core/v3/custom/auth/post" @@ -75,7 +76,18 @@ 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, v7_1.Upgrade, v8.Upgrade} + Upgrades = []upgrades.Upgrade{ + v2.Upgrade, + v3.Upgrade, + v4.Upgrade, + v5.Upgrade, + v6.Upgrade, + v6_1.Upgrade, + v7.Upgrade, + v7_1.Upgrade, + v8.Upgrade, + v8_1.Upgrade, + } // Forks defines forks to be applied to the network Forks = []upgrades.Fork{} diff --git a/app/upgrades/v8_1/constants.go b/app/upgrades/v8_1/constants.go new file mode 100644 index 000000000..7dccc2a08 --- /dev/null +++ b/app/upgrades/v8_1/constants.go @@ -0,0 +1,21 @@ +package v8_1 + +import ( + "github.com/classic-terra/core/v3/app/upgrades" + store "github.com/cosmos/cosmos-sdk/store/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + crisistpyes "github.com/cosmos/cosmos-sdk/x/crisis/types" +) + +const UpgradeName = "v8_1" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateV81UpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + consensustypes.ModuleName, + crisistpyes.ModuleName, + }, + }, +} diff --git a/app/upgrades/v8_1/upgrades.go b/app/upgrades/v8_1/upgrades.go new file mode 100644 index 000000000..079017625 --- /dev/null +++ b/app/upgrades/v8_1/upgrades.go @@ -0,0 +1,25 @@ +package v8_1 + +import ( + "github.com/classic-terra/core/v3/app/keepers" + "github.com/classic-terra/core/v3/app/upgrades" + treasurykeeper "github.com/classic-terra/core/v3/x/treasury/keeper" + treasurytypes "github.com/classic-terra/core/v3/x/treasury/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +func CreateV81UpgradeHandler( + mm *module.Manager, + cfg module.Configurator, + _ upgrades.BaseAppParamManager, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + + // set default oracle split + mm.Modules[treasurytypes.ModuleName].(*treasurykeeper.Keeper).SetOracleSplit(ctx, treasurytypes.DefaultOracleSplit) + return mm.RunMigrations(ctx, cfg, fromVM) + } +}