diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c21ef5290..15eaf9f494 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Add CLI commands for the exchange module endpoints and queries [#1701](https://github.com/provenance-io/provenance/issues/1701). * Add CLI command to generate autocomplete shell scripts [#1762](https://github.com/provenance-io/provenance/pull/1762). * Create CLI commands for adding a market to a genesis file [#1757](https://github.com/provenance-io/provenance/issues/1757). +* Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760). * Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760). ### Improvements diff --git a/app/upgrades.go b/app/upgrades.go index 171081948c..99ce8a1dd8 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -15,6 +15,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" @@ -200,6 +201,34 @@ var upgrades = map[string]appUpgrade{ return vm, nil }, }, + "umber-rc1": { // upgrade for v1.19.0-rc1 + Added: []string{crisistypes.ModuleName}, + 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 + } + + removeInactiveValidatorDelegations(ctx, app) + + return vm, nil + }, + }, + "umber": { // upgrade for v1.19.0 + Added: []string{crisistypes.ModuleName}, + 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 + } + + removeInactiveValidatorDelegations(ctx, app) + + return vm, nil + }, + }, // TODO - Add new upgrade definitions here. } diff --git a/app/upgrades_test.go b/app/upgrades_test.go index 2c7c57445f..2e8d2e51b3 100644 --- a/app/upgrades_test.go +++ b/app/upgrades_test.go @@ -496,6 +496,21 @@ func (s *UpgradeTestSuite) TestTourmaline() { s.AssertUpgradeHandlerLogs("tourmaline", expInLog, nil) } +func (s *UpgradeTestSuite) TestUmberRC1() { + expInLog := []string{ + "INF Starting module migrations. This may take a significant amount of time to complete. Do not restart node.", + "INF removing all delegations from validators that have been inactive (unbonded) for 21 days", + } + + s.AssertUpgradeHandlerLogs("umber-rc1", expInLog, nil) +} + +func (s *UpgradeTestSuite) TestUmber() { + expInLog := []string{} + + s.AssertUpgradeHandlerLogs("umber", expInLog, nil) +} + func (s *UpgradeTestSuite) TestRemoveInactiveValidatorDelegations() { addr1 := s.CreateAndFundAccount(sdk.NewInt64Coin("stake", 1000000)) addr2 := s.CreateAndFundAccount(sdk.NewInt64Coin("stake", 1000000))