diff --git a/app/app.go b/app/app.go index 0608dc9404..89585bbf11 100644 --- a/app/app.go +++ b/app/app.go @@ -576,7 +576,7 @@ func New( ) app.MetadataKeeper = metadatakeeper.NewKeeper( - appCodec, keys[metadatatypes.StoreKey], app.GetSubspace(metadatatypes.ModuleName), app.AccountKeeper, app.AuthzKeeper, app.AttributeKeeper, app.MarkerKeeper, + appCodec, keys[metadatatypes.StoreKey], app.AccountKeeper, app.AuthzKeeper, app.AttributeKeeper, app.MarkerKeeper, ) app.HoldKeeper = holdkeeper.NewKeeper( @@ -1361,7 +1361,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypesv1.ParamKeyTable()) paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(metadatatypes.ModuleName) // TODO[1760]: params: Migrate metadata params. paramsKeeper.Subspace(markertypes.ModuleName) // TODO[1760]: params: Migrate marker params. paramsKeeper.Subspace(nametypes.ModuleName) // TODO[1760]: params: Migrate name params. paramsKeeper.Subspace(attributetypes.ModuleName) // TODO[1760]: params: Migrate attribute params. diff --git a/x/metadata/keeper/genesis.go b/x/metadata/keeper/genesis.go index df232c508a..f2607b3931 100644 --- a/x/metadata/keeper/genesis.go +++ b/x/metadata/keeper/genesis.go @@ -10,7 +10,6 @@ import ( // InitGenesis creates the initial genesis state for the metadata module. func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) { - k.SetParams(ctx, data.Params) k.SetOSLocatorParams(ctx, data.OSLocatorParams) if err := data.Validate(); err != nil { panic(err) @@ -78,7 +77,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) { // ExportGenesis exports the current keeper state of the metadata module.ExportGenesis func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState) { - params := k.GetParams(ctx) oslocatorparams := k.GetOSLocatorParams(ctx) scopes := make([]types.Scope, 0) sessions := make([]types.Session, 0) @@ -163,5 +161,5 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState) { markerNetAssetValues[i] = markerNavs } - return types.NewGenesisState(params, oslocatorparams, scopes, sessions, records, scopeSpecs, contractSpecs, recordSpecs, objectStoreLocators, markerNetAssetValues) + return types.NewGenesisState(types.Params{}, oslocatorparams, scopes, sessions, records, scopeSpecs, contractSpecs, recordSpecs, objectStoreLocators, markerNetAssetValues) } diff --git a/x/metadata/keeper/keeper.go b/x/metadata/keeper/keeper.go index 76eea40fef..1f9258e666 100644 --- a/x/metadata/keeper/keeper.go +++ b/x/metadata/keeper/keeper.go @@ -10,7 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/provenance-io/provenance/x/metadata/types" ) @@ -108,9 +107,8 @@ type MetadataKeeperI interface { // Keeper is the concrete state-based API for the metadata module. type Keeper struct { // Key to access the key-value store from sdk.Context - storeKey storetypes.StoreKey - cdc codec.BinaryCodec - paramSpace paramtypes.Subspace + storeKey storetypes.StoreKey + cdc codec.BinaryCodec // To check if accounts exist and set public keys. authKeeper AuthKeeper @@ -127,17 +125,12 @@ type Keeper struct { // NewKeeper creates new instances of the metadata Keeper. func NewKeeper( - cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace, - authKeeper AuthKeeper, authzKeeper AuthzKeeper, attrKeeper AttrKeeper, markerKeeper MarkerKeeper, + cdc codec.BinaryCodec, key storetypes.StoreKey, authKeeper AuthKeeper, + authzKeeper AuthzKeeper, attrKeeper AttrKeeper, markerKeeper MarkerKeeper, ) Keeper { - // set KeyTable if it has not already been set - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.OSParamKeyTable()) - } return Keeper{ storeKey: key, cdc: cdc, - paramSpace: paramSpace, authKeeper: authKeeper, authzKeeper: authzKeeper, attrKeeper: attrKeeper, diff --git a/x/metadata/keeper/keeper_test.go b/x/metadata/keeper/keeper_test.go index 3ccc26b5b8..e73f9c3cd3 100644 --- a/x/metadata/keeper/keeper_test.go +++ b/x/metadata/keeper/keeper_test.go @@ -113,10 +113,7 @@ func ownerPartyList(addresses ...string) []types.Party { } func (s *KeeperTestSuite) TestParams() { - s.T().Run("param tests", func(t *testing.T) { - p := s.app.MetadataKeeper.GetParams(s.ctx) - assert.NotNil(t, p) - + s.T().Run("os param tests", func(t *testing.T) { osp := s.app.MetadataKeeper.GetOSLocatorParams(s.ctx) assert.NotNil(t, osp) assert.Equal(t, osp.MaxUriLength, s.app.MetadataKeeper.GetMaxURILength(s.ctx)) diff --git a/x/metadata/keeper/oslocatorparams.go b/x/metadata/keeper/oslocatorparams.go index 7f9f511649..0f218f5fdf 100644 --- a/x/metadata/keeper/oslocatorparams.go +++ b/x/metadata/keeper/oslocatorparams.go @@ -15,14 +15,14 @@ func (k Keeper) GetOSLocatorParams(ctx sdk.Context) (osLocatorParams types.OSLoc // SetParams sets the distribution parameters to the param space. func (k Keeper) SetOSLocatorParams(ctx sdk.Context, params types.OSLocatorParams) { - k.paramSpace.SetParamSet(ctx, ¶ms) + // k.paramSpace.SetParamSet(ctx, ¶ms) } // GetMaxURILength gets the configured parameter for max uri length on a locator record (or the default if unset) func (k Keeper) GetMaxURILength(ctx sdk.Context) (max uint32) { - max = types.DefaultMaxURILength - if k.paramSpace.Has(ctx, types.ParamStoreKeyMaxValueLength) { - k.paramSpace.Get(ctx, types.ParamStoreKeyMaxValueLength, &max) - } - return + // max = types.DefaultMaxURILength + // if k.paramSpace.Has(ctx, types.ParamStoreKeyMaxValueLength) { + // k.paramSpace.Get(ctx, types.ParamStoreKeyMaxValueLength, &max) + // } + return 0 } diff --git a/x/metadata/keeper/params.go b/x/metadata/keeper/params.go deleted file mode 100644 index f0b7a22ee9..0000000000 --- a/x/metadata/keeper/params.go +++ /dev/null @@ -1,15 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/provenance-io/provenance/x/metadata/types" -) - -// GetParams returns the total set of metadata parameters. -func (k Keeper) GetParams(_ sdk.Context) (params types.Params) { - return types.Params{} // there are currently no params so no further action required here. -} - -// SetParams sets the metadata parameters to the param space. -func (k Keeper) SetParams(_ sdk.Context, _ types.Params) {} // currently no params are supported diff --git a/x/metadata/keeper/query_server.go b/x/metadata/keeper/query_server.go index 9373370878..b5985ea01e 100644 --- a/x/metadata/keeper/query_server.go +++ b/x/metadata/keeper/query_server.go @@ -25,11 +25,7 @@ var _ types.QueryServer = Keeper{} // Params queries params of metadata module. func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { defer telemetry.MeasureSince(time.Now(), types.ModuleName, "query", "Params") - ctx := sdk.UnwrapSDKContext(c) - var params types.Params - k.paramSpace.GetParamSet(ctx, ¶ms) - - resp := &types.QueryParamsResponse{Params: params} + resp := &types.QueryParamsResponse{Params: types.Params{}} if req != nil && req.IncludeRequest { resp.Request = req } @@ -1046,9 +1042,7 @@ func (k Keeper) GetByAddr(c context.Context, req *types.GetByAddrRequest) (*type func (k Keeper) OSLocatorParams(c context.Context, request *types.OSLocatorParamsRequest) (*types.OSLocatorParamsResponse, error) { defer telemetry.MeasureSince(time.Now(), types.ModuleName, "query", "OSLocatorParams") ctx := sdk.UnwrapSDKContext(c) - var params types.OSLocatorParams - k.paramSpace.GetParamSet(ctx, ¶ms) - + params := k.GetOSLocatorParams(ctx) resp := &types.OSLocatorParamsResponse{Params: params} if request != nil && request.IncludeRequest { resp.Request = request