Skip to content

Commit 67947f6

Browse files
committed
feat: add v4.1.6 handler
1 parent f8932e7 commit 67947f6

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

app/app.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ import (
158158
v3_0_2 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v3_0_2"
159159
v42 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_2"
160160
v45 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_5"
161+
v46 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_6"
161162
"github.com/rakyll/statik/fs"
162163

163164
// unnamed import of statik for swagger UI support
@@ -1172,6 +1173,13 @@ func (app *MigalooApp) setupUpgradeHandlers() {
11721173
app.configurator,
11731174
),
11741175
)
1176+
app.UpgradeKeeper.SetUpgradeHandler(
1177+
v46.UpgradeName,
1178+
v46.CreateUpgradeHandler(
1179+
app.mm,
1180+
app.configurator,
1181+
),
1182+
)
11751183

11761184
// When a planned update height is reached, the old binary will panic
11771185
// writing on disk the height and name of the update that triggered it
@@ -1185,7 +1193,7 @@ func (app *MigalooApp) setupUpgradeHandlers() {
11851193
return
11861194
}
11871195

1188-
if upgradeInfo.Name == v45.UpgradeName {
1196+
if upgradeInfo.Name == v46.UpgradeName {
11891197
storeUpgrades := &storetypes.StoreUpgrades{
11901198
Added: []string{},
11911199
Deleted: []string{},

app/upgrades/v4_1_6/constants.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package v4
2+
3+
// UpgradeName defines the on-chain upgrade name for the Migaloo v4.1.5 upgrade.
4+
// this upgrade includes the fix for pfm
5+
const (
6+
UpgradeName = "v4.1.6"
7+
)

app/upgrades/v4_1_6/upgrades.go

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package v4
2+
3+
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
5+
"github.com/cosmos/cosmos-sdk/types/module"
6+
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
7+
)
8+
9+
// CreateUpgradeHandler that migrates the chain from v4.1.5 to v4.1.6
10+
func CreateUpgradeHandler(
11+
mm *module.Manager,
12+
configurator module.Configurator,
13+
) upgradetypes.UpgradeHandler {
14+
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
15+
return mm.RunMigrations(ctx, configurator, fromVM)
16+
}
17+
}

scripts/upgrade_test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# the upgrade is a fork, "true" otherwise
44
FORK=${FORK:-"false"}
55

6-
OLD_VERSION=v4.1.4
6+
OLD_VERSION=v4.1.5
77
UPGRADE_WAIT=${UPGRADE_WAIT:-20}
88
HOME=mytestnet
99
ROOT=$(pwd)
1010
DENOM=uwhale
1111
CHAIN_ID=localmigaloo
12-
SOFTWARE_UPGRADE_NAME="v4.1.5"
12+
SOFTWARE_UPGRADE_NAME="v4.1.6"
1313
ADDITIONAL_PRE_SCRIPTS=${ADDITIONAL_PRE_SCRIPTS:-""}
1414
ADDITIONAL_AFTER_SCRIPTS=${ADDITIONAL_AFTER_SCRIPTS:-""}
1515

0 commit comments

Comments
 (0)