Documentation ¶
Index ¶
- Constants
- type KeyTable
- type ParamSet
- type ParamSetPair
- type ParamSetPairs
- type Subspace
- func (s Subspace) Get(ctx types.Context, key []byte, ptr interface{})
- func (s Subspace) GetParamSet(ctx types.Context, ps ParamSet)
- func (s Subspace) HasKeyTable() bool
- func (s Subspace) Set(ctx types.Context, key []byte, param interface{})
- func (s Subspace) SetParamSet(ctx types.Context, ps ParamSet)
- func (s Subspace) WithKeyTable(table KeyTable) Subspace
- type ValueValidatorFn
Constants ¶
const ( // StoreKey is the string store types for the param store StoreKey = "params" // TStoreKey is the string store types for the param transient store TStoreKey = "transient_params" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyTable ¶
type KeyTable struct {
// contains filtered or unexported fields
}
KeyTable subspaces appropriate types for each parameter types
func (KeyTable) RegisterParamSet ¶
Register multiple pairs from ParamSet
func (KeyTable) RegisterType ¶
Register single types-types pair
type ParamSet ¶
type ParamSet interface {
ParamSetPairs() ParamSetPairs
}
type ParamSetPair ¶
type ParamSetPair struct { Key []byte Value interface{} ValidatorFn ValueValidatorFn }
ParamSetPair is used for associating paramsubspace key and field of param structs.
func NewParamSetPair ¶
func NewParamSetPair(key []byte, value interface{}, vfn ValueValidatorFn) ParamSetPair
NewParamSetPair creates a new ParamSetPair instance.
type ParamSetPairs ¶
type ParamSetPairs []ParamSetPair
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 NewSubspace ¶
func NewSubspace(cdc *codec.Codec, key types.StoreKey, tkey types.StoreKey, name string) (res Subspace)
NewSubspace constructs a store with namestore
func (Subspace) GetParamSet ¶
Get to ParamSet
func (Subspace) HasKeyTable ¶
HasKeyTable returns if the Subspace has a KeyTable registered.
func (Subspace) Set ¶
Set stores the parameter. It returns error if stored parameter has different types from input. It also set to the transient store to record change.
func (Subspace) SetParamSet ¶
Set from ParamSet
func (Subspace) WithKeyTable ¶
WithKeyTable initializes KeyTable and returns modified Subspace
type ValueValidatorFn ¶
type ValueValidatorFn func(value interface{}) error
types ParamSetPair struct { Key []byte Value interface{} }
func NewParamSetPair(key []byte, value interface{}) ParamSetPair { return ParamSetPair{key, value} }