Some checks failed
CodeQL / Analyze (push) Waiting to run
golangci-lint / lint (push) Waiting to run
Tests / Code Coverage / build (amd64) (push) Waiting to run
Tests / Code Coverage / build (arm64) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[additional-args:-tags="test_e2e" name:e2e path:./e2e]) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[name:08-wasm path:./modules/light-clients/08-wasm]) (push) Waiting to run
Tests / Code Coverage / unit-tests (map[name:ibc-go path:.]) (push) Waiting to run
Docker Build & Push Simapp (main) / docker-build (push) Has been cancelled
32 lines
904 B
Go
32 lines
904 B
Go
package keeper
|
|
|
|
import (
|
|
sdk "git.cw.tr/mukan-network/mukan-sdk/types"
|
|
|
|
controllertypes "git.cw.tr/mukan-network/mukan-ibc/modules/apps/27-interchain-accounts/controller/types"
|
|
)
|
|
|
|
// Migrator is a struct for handling in-place store migrations.
|
|
type Migrator struct {
|
|
keeper *Keeper
|
|
}
|
|
|
|
// NewMigrator returns Migrator instance for the state migration.
|
|
func NewMigrator(k *Keeper) Migrator {
|
|
return Migrator{
|
|
keeper: k,
|
|
}
|
|
}
|
|
|
|
// MigrateParams migrates the controller submodule's parameters from the x/params to self store.
|
|
func (m Migrator) MigrateParams(ctx sdk.Context) error {
|
|
if m.keeper != nil {
|
|
params := controllertypes.DefaultParams()
|
|
if m.keeper.legacySubspace != nil {
|
|
m.keeper.legacySubspace.GetParamSetIfExists(ctx, ¶ms)
|
|
}
|
|
m.keeper.SetParams(ctx, params)
|
|
m.keeper.Logger(ctx).Info("successfully migrated ica/controller submodule to self-manage params")
|
|
}
|
|
return nil
|
|
}
|