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

Add 1.18 upgrade handler #1756

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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 @@
},
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
}

Check warning on line 182 in app/upgrades.go

View check run for this annotation

Codecov / codecov/patch

app/upgrades.go#L181-L182

Added lines #L181 - L182 were not covered by tests

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
}

Check warning on line 193 in app/upgrades.go

View check run for this annotation

Codecov / codecov/patch

app/upgrades.go#L192-L193

Added lines #L192 - L193 were not covered by tests

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
Loading