diff --git a/app/upgrades.go b/app/upgrades.go index 01e34518db..b6c7ae1845 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -13,6 +13,7 @@ import ( paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/ibc-go/v8/modules/core/exported" ibctmmigrations "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint/migrations" + attributetypes "github.com/provenance-io/provenance/x/attribute/types" ) // appUpgrade is an internal structure for defining all things for an upgrade. @@ -282,3 +283,14 @@ func migrateBaseappParams(ctx sdk.Context, app *App) error { ctx.Logger().Info("Done migrating legacy params.") return nil } + +// migrateAttributeParams migrates to new Attribute Params store +// TODO: Remove with the umber handlers. +func migrateAttributeParams(ctx sdk.Context, app *App) { + attributeParamSpace := app.ParamsKeeper.Subspace(attributetypes.ModuleName) + maxValueLength := attributetypes.DefaultMaxValueLength + if attributeParamSpace.Has(ctx, attributetypes.ParamStoreKeyMaxValueLength) { + attributeParamSpace.Get(ctx, attributetypes.ParamStoreKeyMaxValueLength, &maxValueLength) + } + app.AttributeKeeper.SetParams(ctx, attributetypes.Params{MaxValueLength: uint32(maxValueLength)}) +} diff --git a/x/attribute/types/params.go b/x/attribute/types/params.go index aaaad66488..ee7f1f7084 100644 --- a/x/attribute/types/params.go +++ b/x/attribute/types/params.go @@ -14,6 +14,7 @@ const ( ) // Parameter store keys +// TODO: remove with the umber (v1.19.x) handlers. var ( ParamStoreKeyMaxValueLength = []byte("MaxValueLength") )