From 67ac8c55b9494a8d2bd0d88163f45da01b12d91e Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 26 Sep 2018 11:36:26 -0400 Subject: [PATCH] More minor cleanup --- x/params/keeper.go | 2 +- x/params/store.go | 15 +++++++++------ x/params/store/doc.go | 9 +++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/x/params/keeper.go b/x/params/keeper.go index 8677c63d53..8a5bb6605f 100644 --- a/x/params/keeper.go +++ b/x/params/keeper.go @@ -16,7 +16,7 @@ type Keeper struct { stores map[string]*Store } -// NewKeeper construct a params keeper +// NewKeeper constructs a params keeper func NewKeeper(cdc *codec.Codec, key *sdk.KVStoreKey, tkey *sdk.TransientStoreKey) (k Keeper) { k = Keeper{ cdc: cdc, diff --git a/x/params/store.go b/x/params/store.go index 39b2c2a510..19aa3038a4 100644 --- a/x/params/store.go +++ b/x/params/store.go @@ -5,13 +5,16 @@ import ( "github.com/cosmos/cosmos-sdk/x/params/store" ) -// nolint - reexport -type Store = store.Store -type ReadOnlyStore = store.ReadOnlyStore -type ParamStruct = store.ParamStruct -type KeyFieldPairs = store.KeyFieldPairs +// re-export types from store +type ( + Store = store.Store + ReadOnlyStore = store.ReadOnlyStore + ParamStruct = store.ParamStruct + KeyFieldPairs = store.KeyFieldPairs +) -// nolint - reexport +// UnmarshalParamsFromMap deserializes parameters from a given map. It returns +// an error upon failure. func UnmarshalParamsFromMap(m map[string][]byte, cdc *codec.Codec, ps store.ParamStruct) error { return store.UnmarshalParamsFromMap(m, cdc, ps) } diff --git a/x/params/store/doc.go b/x/params/store/doc.go index 67a64e0a17..0298976483 100644 --- a/x/params/store/doc.go +++ b/x/params/store/doc.go @@ -1,13 +1,14 @@ package store /* -To prevent namespace collision between comsumer modules, we define type +To prevent namespace collision between consumer modules, we define type "space". A Space can only be generated by the keeper, and the keeper checks the existence of the space having the same name before generating the space. -Consumer modules must take a space(via Keeper.Subspace), not the keeper -itself. This isolates each modules from the others and make them modify theparameters safely. Keeper can be treated as master permission for all -subspaces(via Keeper.GetSubspace), so should be passed to proper modules +Consumer modules must take a space (via Keeper.Subspace), not the keeper +itself. This isolates each modules from the others and make them modify the +parameters safely. Keeper can be treated as master permission for all +subspaces (via Keeper.GetSubspace), so should be passed to proper modules (ex. gov) */