Skip to content

Commit

Permalink
working fork
Browse files Browse the repository at this point in the history
  • Loading branch information
nghuyenthevinh2000 committed Sep 18, 2023
1 parent 727349a commit fd726e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/upgrades/forks/forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scripts/upgrade-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fd726e4

Please sign in to comment.