Skip to content

Commit

Permalink
chore: try fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kioqq committed Dec 11, 2023
1 parent dcc4825 commit b39aaf4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
3 changes: 1 addition & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1148,8 +1148,7 @@ func (app *Haqq) setupUpgradeHandlers() {
app.configurator,
app.GetKey(coinomicstypes.StoreKey),
app.GetKey(paramstypes.StoreKey),
app.ParamsKeeper.Subspace(coinomicstypes.ModuleName),
),
app.GetSubspace(coinomicstypes.ModuleName)),
)

// When a planned update height is reached, the old binary will panic
Expand Down
27 changes: 14 additions & 13 deletions app/upgrades/v1.6.4/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
coinomicstypes "github.com/haqq-network/haqq/x/coinomics/types"
)

const ModuleName = "coinomics"
Expand Down Expand Up @@ -40,21 +41,21 @@ func CreateUpgradeHandler(

logger.Info("start cleaning params for module")

if paramsSubspace.HasKeyTable() {
paramsSubspace.IterateKeys(ctx, func(key []byte) bool {
println("params store key for delete")
println(string(key))
return false
})
keyTable := coinomicstypes.ParamKeyTable()
paramsSubspace = paramsSubspace.WithKeyTable(keyTable)

// paramsSubspace.WithKeyTable(paramtypes.NewKeyTable())
// // paramsSubspace.IterateKeys(ctx, func(key []byte) bool {
// // println(string(key))
paramsSubspace.SetParamSet(ctx, &coinomicstypes.Params{})

// // paramsSubspace.Update(ctx, key, nil)
// // return false
// // })
}
// if paramsSubspace.HasKeyTable() {

// paramsSubspace.WithKeyTable(paramtypes.NewKeyTable())
// // paramsSubspace.IterateKeys(ctx, func(key []byte) bool {
// // println(string(key))

// // paramsSubspace.Update(ctx, key, nil)
// // return false
// // })
// }

// if !ps.HasKeyTable() {
// ps = ps.WithKeyTable(types.ParamKeyTable())
Expand Down

0 comments on commit b39aaf4

Please sign in to comment.