From fd726e40c3264700a39be22b9231b50122411e4d Mon Sep 17 00:00:00 2001 From: nghuyenthevinh2000 Date: Mon, 18 Sep 2023 14:56:39 +0700 Subject: [PATCH] working fork --- app/upgrades/forks/forks.go | 8 ++++++-- scripts/upgrade-test.sh | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/upgrades/forks/forks.go b/app/upgrades/forks/forks.go index 001b3cc33..708795a6f 100644 --- a/app/upgrades/forks/forks.go +++ b/app/upgrades/forks/forks.go @@ -68,7 +68,11 @@ func runForkLogicVersionMapEnable(ctx sdk.Context, keppers *keepers.AppKeepers, func forkLogicFixMinCommission(ctx sdk.Context, keepers *keepers.AppKeepers, mm *module.Manager) { MinCommissionRate := sdk.NewDecWithPrec(5, 2) - space := keepers.ParamsKeeper.Subspace(stakingtypes.StoreKey) + space, exist := keepers.ParamsKeeper.GetSubspace(stakingtypes.StoreKey) + if !exist { + panic("staking subspace is not found, breaking the chain anyway so panic") + } + if space.HasKeyTable() { space.Set(ctx, stakingtypes.KeyMinCommissionRate, MinCommissionRate) } else { @@ -109,7 +113,7 @@ func runForkLogicFixMinCommission(ctx sdk.Context, keepers *keepers.AppKeepers, } func runForkLogicFixMinCommissionRebel(ctx sdk.Context, keepers *keepers.AppKeepers, mm *module.Manager) { - if ctx.ChainID() != core.RebelChainID { + if ctx.ChainID() != "localterra" { return } forkLogicFixMinCommission(ctx, keepers, mm) diff --git a/scripts/upgrade-test.sh b/scripts/upgrade-test.sh index 0951131e0..ed3c826e7 100755 --- a/scripts/upgrade-test.sh +++ b/scripts/upgrade-test.sh @@ -4,7 +4,7 @@ FORK=${FORK:-"false"} # $(curl --silent "https://api.github.com/repos/classic-terra/core/releases/latest" | jq -r '.tag_name') -OLD_VERSION=v2.1.2 +OLD_VERSION=v2.2.1 UPGRADE_WAIT=${UPGRADE_WAIT:-20} HOME=mytestnet ROOT=$(pwd)