Skip to content

Commit

Permalink
Add 1.18 upgrade handler (#1756)
Browse files Browse the repository at this point in the history
* Add upgrade handler.

* Fix link to PR in changelog.

* Add needed upgrade handler for rc1.
  • Loading branch information
Taztingo authored Nov 20, 2023
1 parent 8a4c11a commit 9d436b6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Improvements

* Add upgrade handler for 1.18 [#1756](https://github.com/provenance-io/provenance/pull/1756).

### Dependencies

- Bump `bufbuild/buf-setup-action` from 1.27.1 to 1.28.1 ([#1724](https://github.com/provenance-io/provenance/pull/1724), [#1744](https://github.com/provenance-io/provenance/pull/1744), [#1750](https://github.com/provenance-io/provenance/pull/1750))
Expand Down
22 changes: 22 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,28 @@ var upgrades = map[string]appUpgrade{
},
Added: []string{icqtypes.ModuleName, oracletypes.ModuleName, ibchookstypes.StoreKey, hold.ModuleName, exchange.ModuleName},
},
"tourmaline-rc1": { // upgrade for v1.18.0-rc1
Handler: func(ctx sdk.Context, app *App, vm module.VersionMap) (module.VersionMap, error) {
var err error
vm, err = runModuleMigrations(ctx, app, vm)
if err != nil {
return nil, err
}

return vm, nil
},
},
"tourmaline": { // upgrade for v1.18.0
Handler: func(ctx sdk.Context, app *App, vm module.VersionMap) (module.VersionMap, error) {
var err error
vm, err = runModuleMigrations(ctx, app, vm)
if err != nil {
return nil, err
}

return vm, nil
},
},
// TODO - Add new upgrade definitions here.
}

Expand Down
12 changes: 12 additions & 0 deletions app/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,18 @@ func (s *UpgradeTestSuite) TestSaffron() {
s.AssertUpgradeHandlerLogs("saffron", expInLog, nil)
}

func (s *UpgradeTestSuite) TestTourmalineRC1() {
expInLog := []string{}

s.AssertUpgradeHandlerLogs("tourmaline-rc1", expInLog, nil)
}

func (s *UpgradeTestSuite) TestTourmaline() {
expInLog := []string{}

s.AssertUpgradeHandlerLogs("tourmaline", expInLog, nil)
}

func (s *UpgradeTestSuite) TestRemoveInactiveValidatorDelegations() {
addr1 := s.CreateAndFundAccount(sdk.NewInt64Coin("stake", 1000000))
addr2 := s.CreateAndFundAccount(sdk.NewInt64Coin("stake", 1000000))
Expand Down

0 comments on commit 9d436b6

Please sign in to comment.