Skip to content

Commit

Permalink
add upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarom Swisa authored and Yarom Swisa committed Oct 13, 2024
1 parent f4cc0bf commit fac7543
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const (
// Upgrades add here future upgrades (upgrades.Upgrade)
var Upgrades = []upgrades.Upgrade{
upgrades.Upgrade_3_1_0,
upgrades.Upgrade_3_2_0,
}

// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals
Expand Down
6 changes: 6 additions & 0 deletions app/upgrades/empty_upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ var Upgrade_3_1_0 = Upgrade{
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_3_2_0 = Upgrade{
UpgradeName: "v3.2.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}
6 changes: 5 additions & 1 deletion x/protocol/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,14 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
// panic:ok: at start up, migration cannot proceed anyhow
panic(fmt.Errorf("%s: failed to register migration to v22: %w", types.ModuleName, err))
}
if err := cfg.RegisterMigration(types.ModuleName, 22, migrator.MigrateVersion); err != nil {
// panic:ok: at start up, migration cannot proceed anyhow
panic(fmt.Errorf("%s: failed to register migration to v23: %w", types.ModuleName, err))
}
}

// ConsensusVersion implements ConsensusVersion.
func (AppModule) ConsensusVersion() uint64 { return 22 }
func (AppModule) ConsensusVersion() uint64 { return 23 }

// RegisterInvariants registers the capability module's invariants.
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
Expand Down
4 changes: 2 additions & 2 deletions x/protocol/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
var _ paramtypes.ParamSet = (*Params)(nil)

const (
TARGET_VERSION = "3.1.7"
MIN_VERSION = "2.2.2"
TARGET_VERSION = "3.2.0"
MIN_VERSION = "3.1.0"
)

var (
Expand Down

0 comments on commit fac7543

Please sign in to comment.