Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migration and version chaning #135

Merged
merged 4 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ import (

v2_2_0 "github.com/terra-money/core/v2/app/upgrades/v2.2.0"
v2_3_0 "github.com/terra-money/core/v2/app/upgrades/v2.3.0"
v2_4_0 "github.com/terra-money/core/v2/app/upgrades/v2.4.0"

// unnamed import of statik for swagger UI support
_ "github.com/terra-money/core/v2/client/docs/statik"
Expand Down Expand Up @@ -1007,6 +1008,10 @@ func (app *TerraApp) RegisterUpgradeHandlers(cfg module.Configurator) {
terraappconfig.Upgrade2_3_0,
v2_3_0.CreateUpgradeHandler(app.mm, app.configurator, app.TokenFactoryKeeper),
)
app.UpgradeKeeper.SetUpgradeHandler(
terraappconfig.Upgrade2_4_0,
v2_4_0.CreateUpgradeHandler(app.mm, app.configurator),
)
}

// RegisterSwaggerAPI registers swagger route with API Server
Expand Down
1 change: 1 addition & 0 deletions app/config/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ const (
// UpgradeName gov proposal name
Upgrade2_2_0 = "2.2.0"
Upgrade2_3_0 = "2.3.0"
Upgrade2_4_0 = "2.4.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think @gregnuj wanted to rename this to v2.4.0 to keep it aligned to our tagged releases.

)
14 changes: 14 additions & 0 deletions app/upgrades/v2.4.0/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package v2_2_0

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateUpgradeHandler(mm *module.Manager,
cfg module.Configurator) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, cfg, fromVM)
}
}
4 changes: 2 additions & 2 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"swagger": "2.0",
"info": {
"title": "Terra Core Rest API",
"description": "Rest Interface for Terra Core v2.3.1 https://github.com/terra-money/core",
"version": "2.3.1"
"description": "Rest Interface for Terra Core v2.4.0 https://github.com/terra-money/core",
"version": "2.4.0"
},
"apis": [
{
Expand Down
4 changes: 2 additions & 2 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
swagger: '2.0'
info:
title: Terra Core Rest API
description: Rest Interface for Terra Core v2.3.1 https://github.com/terra-money/core
version: 2.3.1
description: Rest Interface for Terra Core v2.4.0 https://github.com/terra-money/core
version: 2.4.0
paths:
/terra/alliances:
get:
Expand Down
2 changes: 1 addition & 1 deletion scripts/chain-upgrade-tester/chain-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CHAIN_ID=pisco-1
CHAIN_HOME=.testnet
ROOT=$(pwd)
DENOM=uluna
SOFTWARE_UPGRADE_NAME="2.3.1"
SOFTWARE_UPGRADE_NAME="2.4.0"
GOV_PERIOD="10s"

VAL_MNEMONIC_1="clock post desk civil pottery foster expand merit dash seminar song memory figure uniform spice circle try happy obvious trash crime hybrid hood cushion"
Expand Down