diff --git a/app/app.go b/app/app.go index 97a55009..6db5ca25 100644 --- a/app/app.go +++ b/app/app.go @@ -1175,7 +1175,7 @@ func (app *Haqq) setupUpgradeHandlers() { } case v164.UpgradeName: storeUpgrades = &storetypes.StoreUpgrades{ - Deleted: []string{coinomicstypes.ModuleName}, + Added: []string{coinomicstypes.ModuleName}, } default: // no-op diff --git a/app/upgrades/v1.6.4/upgrades.go b/app/upgrades/v1.6.4/upgrades.go index 306e6eca..991007d6 100644 --- a/app/upgrades/v1.6.4/upgrades.go +++ b/app/upgrades/v1.6.4/upgrades.go @@ -6,6 +6,8 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) +const ModuleName = "coinomics" + // CreateUpgradeHandler creates an SDK upgrade handler for v1.6.4 func CreateUpgradeHandler( mm *module.Manager, @@ -15,6 +17,16 @@ func CreateUpgradeHandler( logger := ctx.Logger() logger.Info("run migration v1.6.4") + storeKey := sdk.NewKVStoreKey(ModuleName) + store := ctx.KVStore(storeKey) + + iterator := sdk.KVStorePrefixIterator(store, nil) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } + return mm.RunMigrations(ctx, configurator, vm) } }