Documentation ¶
Overview ¶
Package params provides a lightweight implementation inspired by the x/params module of the Cosmos SDK.
It includes a keeper for managing key-value pairs with module identifiers as prefixes, along with a global querier for retrieving any key from any module.
Changes: This version removes the concepts of subspaces and proposals, allowing the creation of multiple keepers identified by a provided prefix. Proposals may be added later when governance modules are introduced. The transient store and .Modified helper have also been removed but can be implemented later if needed. Keys are represented as strings instead of []byte.
XXX: removes isAlphaNum validation for keys.
Index ¶
- Constants
- func NewHandler(params ParamsKeeper) paramsHandler
- type ParamsKeeper
- func (pk ParamsKeeper) GetBool(ctx sdk.Context, key string, ptr *bool)
- func (pk ParamsKeeper) GetBytes(ctx sdk.Context, key string, ptr *[]byte)
- func (pk ParamsKeeper) GetInt64(ctx sdk.Context, key string, ptr *int64)
- func (pk ParamsKeeper) GetRaw(ctx sdk.Context, key string) []byte
- func (pk ParamsKeeper) GetString(ctx sdk.Context, key string, ptr *string)
- func (pk ParamsKeeper) GetUint64(ctx sdk.Context, key string, ptr *uint64)
- func (pk ParamsKeeper) Has(ctx sdk.Context, key string) bool
- func (pk ParamsKeeper) Logger(ctx sdk.Context) *slog.Logger
- func (pk ParamsKeeper) SetBool(ctx sdk.Context, key string, value bool)
- func (pk ParamsKeeper) SetBytes(ctx sdk.Context, key string, value []byte)
- func (pk ParamsKeeper) SetInt64(ctx sdk.Context, key string, value int64)
- func (pk ParamsKeeper) SetString(ctx sdk.Context, key, value string)
- func (pk ParamsKeeper) SetUint64(ctx sdk.Context, key string, value uint64)
- type ParamsKeeperI
Constants ¶
const ( ModuleName = "params" StoreKey = ModuleName )
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(params ParamsKeeper) paramsHandler
Types ¶
type ParamsKeeper ¶
type ParamsKeeper struct {
// contains filtered or unexported fields
}
global paramstore Keeper.
func NewParamsKeeper ¶
func NewParamsKeeper(key store.StoreKey, prefix string) ParamsKeeper
NewParamsKeeper returns a new ParamsKeeper.
func (ParamsKeeper) GetBool ¶
func (pk ParamsKeeper) GetBool(ctx sdk.Context, key string, ptr *bool)
func (ParamsKeeper) GetBytes ¶
func (pk ParamsKeeper) GetBytes(ctx sdk.Context, key string, ptr *[]byte)
func (ParamsKeeper) GetInt64 ¶
func (pk ParamsKeeper) GetInt64(ctx sdk.Context, key string, ptr *int64)
func (ParamsKeeper) GetString ¶
func (pk ParamsKeeper) GetString(ctx sdk.Context, key string, ptr *string)
func (ParamsKeeper) GetUint64 ¶
func (pk ParamsKeeper) GetUint64(ctx sdk.Context, key string, ptr *uint64)
func (ParamsKeeper) Logger ¶
func (pk ParamsKeeper) Logger(ctx sdk.Context) *slog.Logger
Logger returns a module-specific logger. XXX: why do we expose this?
func (ParamsKeeper) SetBool ¶
func (pk ParamsKeeper) SetBool(ctx sdk.Context, key string, value bool)
func (ParamsKeeper) SetBytes ¶
func (pk ParamsKeeper) SetBytes(ctx sdk.Context, key string, value []byte)
func (ParamsKeeper) SetInt64 ¶
func (pk ParamsKeeper) SetInt64(ctx sdk.Context, key string, value int64)
type ParamsKeeperI ¶
type ParamsKeeperI interface { GetString(ctx sdk.Context, key string, ptr *string) GetInt64(ctx sdk.Context, key string, ptr *int64) GetUint64(ctx sdk.Context, key string, ptr *uint64) GetBool(ctx sdk.Context, key string, ptr *bool) GetBytes(ctx sdk.Context, key string, ptr *[]byte) SetString(ctx sdk.Context, key string, value string) SetInt64(ctx sdk.Context, key string, value int64) SetUint64(ctx sdk.Context, key string, value uint64) SetBool(ctx sdk.Context, key string, value bool) SetBytes(ctx sdk.Context, key string, value []byte) Has(ctx sdk.Context, key string) bool GetRaw(ctx sdk.Context, key string) []byte }