Skip to content

Commit 1259b72

Browse files
committed
Add prev upgrade handlers 102 and store upgrades
1 parent fa3a874 commit 1259b72

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

app/app.go

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package app
33
import (
44
"context"
55
"fmt"
6+
storetypes "github.com/cosmos/cosmos-sdk/store/types"
67
"io"
78
"os"
89
"path/filepath"
@@ -651,6 +652,19 @@ func New(
651652
app.sm.RegisterStoreDecoders()
652653

653654
app.RegisterUpgradeHandlers()
655+
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
656+
if err != nil {
657+
panic(err)
658+
}
659+
660+
if upgradeInfo.Name == "1.0.4beta" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
661+
storeUpgrades := storetypes.StoreUpgrades{
662+
Added: []string{oracletypes.StoreKey},
663+
}
664+
665+
// configure store loader that checks if version == upgradeHeight and applies store upgrades
666+
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
667+
}
654668

655669
// initialize stores
656670
app.MountKVStores(keys)

app/upgrades.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
// for both the current (n) and the previous (n-1) upgrade name. There is a bug
1414
// in a missing value in a log statement for which the fix is not released
1515
var upgradesList = []string{
16+
// 1.0.2beta
17+
"1.0.2beta",
1618
// 1.0.3beta
1719
"1.0.3beta",
1820
// 1.0.4beta

0 commit comments

Comments
 (0)