Documentation ¶
Index ¶
- Constants
- type KeyTable
- type ParamSet
- type ParamSetPair
- type ParamSetPairs
- 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) GetWithSubkey(ctx sdk.Context, key, subkey []byte, ptr interface{})
- func (s Subspace) GetWithSubkeyIfExists(ctx sdk.Context, key, subkey []byte, ptr interface{})
- 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) SetWithSubkey(ctx sdk.Context, key []byte, subkey []byte, param interface{})
- func (s Subspace) Update(ctx sdk.Context, key []byte, param []byte) error
- func (s Subspace) UpdateWithSubkey(ctx sdk.Context, key []byte, subkey []byte, param []byte) error
- func (s Subspace) WithKeyTable(table KeyTable) Subspace
Constants ¶
const ( // StoreKey is the string store key for the param store StoreKey = "params" // TStoreKey is the string store key for the param transient store TStoreKey = "transient_params" )
const (
TestParamStore = "ParamsTest"
)
Keys for parameter access
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyTable ¶ added in v0.31.0
type KeyTable struct {
// contains filtered or unexported fields
}
KeyTable subspaces appropriate type for each parameter key
func NewKeyTable ¶ added in v0.31.0
func NewKeyTable(keytypes ...interface{}) (res KeyTable)
Constructs new table
func (KeyTable) RegisterParamSet ¶ added in v0.31.0
Register multiple pairs from ParamSet
func (KeyTable) RegisterType ¶ added in v0.31.0
Register single key-type pair
type ParamSet ¶
type ParamSet interface {
ParamSetPairs() ParamSetPairs
}
Interface for structs containing parameters for a module
type ParamSetPair ¶ added in v0.31.0
type ParamSetPair struct { Key []byte Value interface{} }
Used for associating paramsubspace key and field of param structs
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 ¶
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) GetWithSubkey ¶ added in v0.31.0
GetWithSubkey returns a parameter with a given key and a subkey.
func (Subspace) GetWithSubkeyIfExists ¶ added in v0.31.0
GetWithSubkeyIfExists returns a parameter with a given key and a subkey but does not modify ptr if the stored parameter is nil.
func (Subspace) Set ¶
Set stores the parameter. It returns error if stored parameter has different type from input. It also set to the transient store to record change.
func (Subspace) SetParamSet ¶
Set from ParamSet
func (Subspace) SetWithSubkey ¶ added in v0.31.0
SetWithSubkey set a parameter with a key and subkey Checks parameter type only over the key
func (Subspace) Update ¶ added in v0.36.0
Update stores raw parameter bytes. It returns error if the stored parameter has a different type from the input. It also sets to the transient store to record change.
func (Subspace) UpdateWithSubkey ¶ added in v0.36.0
UpdateWithSubkey stores raw parameter bytes with a key and subkey. It checks the parameter type only over the key.
func (Subspace) WithKeyTable ¶ added in v0.31.0
WithKeyTable initializes KeyTable and returns modified Subspace