Skip to content

Commit

Permalink
UpgradeHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
codehans committed May 6, 2024
1 parent 682a20d commit 0f2f0af
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
16 changes: 16 additions & 0 deletions UPGRADES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# kujira

**kujira** is a blockchain built using Cosmos SDK and Comet BFT

Please refer to [docs.kujira.app](https://docs.kujira.app/) and join our [Discord](https://t.co/kur923FTZk) for guidance in getting set up.

## Upgrades

- 0 -> v0.4.0
- 01764000 -> v0.5.0
- 03495000 -> v0.6.0
- 04553726 -> v0.6.4 **manual halt-height required**
- 05196234 -> v0.7.1
- 09226200 -> v0.8.4 **tag `v0.8.4-mainnet`**
- 11478516 -> v0.8.7 **manual halt-height required**
- 16610000 -> v0.9.3-1 (note `-1` suffix)
24 changes: 1 addition & 23 deletions app/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
package app

import (
batchtypes "github.com/Team-Kujira/core/x/batch/types"
cwicatypes "github.com/Team-Kujira/core/x/cw-ica/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
)

const UpgradeName = "v1.0.2"
const UpgradeName = "v1.1.0-beta"

func (app App) RegisterUpgradeHandlers() {
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
panic(err)
}

if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) && upgradeInfo.Info != "skip-store-upgrades" {
storeUpgrades := storetypes.StoreUpgrades{
Added: []string{
ibcwasmtypes.ModuleName,
batchtypes.ModuleName,
cwicatypes.ModuleName,
},
}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}

app.UpgradeKeeper.SetUpgradeHandler(
UpgradeName,
func(ctx sdk.Context,
Expand Down

0 comments on commit 0f2f0af

Please sign in to comment.