Documentation ¶
Index ¶
- Constants
- type KeyValuePair
- type KeyValuePairs
- type ParamSet
- type ReadOnlySubspace
- func (ros ReadOnlySubspace) Get(ctx sdk.Context, key []byte, ptr interface{})
- func (ros ReadOnlySubspace) GetRaw(ctx sdk.Context, key []byte) []byte
- func (ros ReadOnlySubspace) Has(ctx sdk.Context, key []byte) bool
- func (ros ReadOnlySubspace) Modified(ctx sdk.Context, key []byte) bool
- func (ros ReadOnlySubspace) Name() string
- type Subspace
- func (s Subspace) Get(ctx sdk.Context, key []byte, ptr interface{})
- func (s Subspace) GetIfExists(ctx sdk.Context, key []byte, ptr interface{})
- func (s Subspace) GetParamSet(ctx sdk.Context, ps ParamSet)
- func (s Subspace) GetRaw(ctx sdk.Context, key []byte) []byte
- func (s Subspace) Has(ctx sdk.Context, key []byte) bool
- func (s Subspace) Modified(ctx sdk.Context, key []byte) bool
- func (s Subspace) Name() string
- func (s Subspace) Set(ctx sdk.Context, key []byte, param interface{})
- func (s Subspace) SetParamSet(ctx sdk.Context, ps ParamSet)
- func (s Subspace) WithTypeTable(table TypeTable) Subspace
- type TypeTable
Constants ¶
const (
TestParamStore = "ParamsTest"
)
Keys for parameter access
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyValuePair ¶
type KeyValuePair struct { Key []byte Value interface{} }
Used for associating paramsubspace key and field of param structs
type ParamSet ¶
type ParamSet interface {
KeyValuePairs() KeyValuePairs
}
Interface for structs containing parameters for a module
type ReadOnlySubspace ¶
type ReadOnlySubspace struct {
// contains filtered or unexported fields
}
Wrapper of Subspace, provides immutable functions only
func (ReadOnlySubspace) Get ¶
func (ros ReadOnlySubspace) Get(ctx sdk.Context, key []byte, ptr interface{})
Exposes Get
func (ReadOnlySubspace) GetRaw ¶
func (ros ReadOnlySubspace) GetRaw(ctx sdk.Context, key []byte) []byte
Exposes GetRaw
func (ReadOnlySubspace) Has ¶
func (ros ReadOnlySubspace) Has(ctx sdk.Context, key []byte) bool
Exposes Has
type Subspace ¶
type Subspace struct {
// contains filtered or unexported fields
}
Individual parameter store for each keeper Transient store persists for a block, so we use it for recording whether the parameter has been changed or not
func DefaultTestComponents ¶
func DefaultTestComponents(t *testing.T, table TypeTable) (sdk.Context, Subspace, func() sdk.CommitID)
Returns components for testing
func NewSubspace ¶
NewSubspace constructs a store with namestore
func (Subspace) GetIfExists ¶
GetIfExists do not modify ptr if the stored parameter is nil
func (Subspace) GetParamSet ¶
Get to ParamSet
func (Subspace) Set ¶
Set parameter, return error if stored parameter has different type from input Also set to the transient store to record change
func (Subspace) SetParamSet ¶
Set from ParamSet
func (Subspace) WithTypeTable ¶
WithTypeTable initializes TypeTable and returns modified Subspace
type TypeTable ¶
type TypeTable struct {
// contains filtered or unexported fields
}
TypeTable subspaces appropriate type for each parameter key
func (TypeTable) RegisterParamSet ¶
Register multiple pairs from ParamSet
func (TypeTable) RegisterType ¶
Register single key-type pair