Documentation ¶
Index ¶
- func TimerVersion() uint64
- type FixationStore
- func (fs *FixationStore) AdvanceBlock(ctx sdk.Context)
- func (fs *FixationStore) AppendEntry(ctx sdk.Context, index string, block uint64, entryData codec.ProtoMarshaler) error
- func (fs *FixationStore) FindEntry(ctx sdk.Context, index string, block uint64, entryData codec.ProtoMarshaler) bool
- func (fs FixationStore) GetAllEntryIndices(ctx sdk.Context) []string
- func (fs FixationStore) GetAllEntryIndicesWithPrefix(ctx sdk.Context, prefix string) []string
- func (fs *FixationStore) GetAllEntryVersions(ctx sdk.Context, index string, stale bool) (blocks []uint64)
- func (fs *FixationStore) GetEntry(ctx sdk.Context, index string, entryData codec.ProtoMarshaler) bool
- func (fs *FixationStore) GetEntryVersionsRange(ctx sdk.Context, index string, block, delta uint64) (blocks []uint64)
- func (fs *FixationStore) MigrateVersion(ctx sdk.Context) (err error)
- func (fs *FixationStore) MigrateVersionAndPrefix(ctx sdk.Context, oldPrefix string) (err error)
- func (fs *FixationStore) ModifyEntry(ctx sdk.Context, index string, block uint64, entryData codec.ProtoMarshaler)
- func (fs *FixationStore) PutEntry(ctx sdk.Context, index string, block uint64)
- func (fs *FixationStore) ReadEntry(ctx sdk.Context, index string, block uint64, entryData codec.ProtoMarshaler)
- type TimerCallback
- type TimerStore
- func (tstore *TimerStore) AddTimerByBlockHeight(ctx sdk.Context, block uint64, key []byte, data []byte)
- func (tstore *TimerStore) AddTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte, data []byte)
- func (tstore *TimerStore) DelTimerByBlockHeight(ctx sdk.Context, block uint64, key []byte)
- func (tstore *TimerStore) DelTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte)
- func (tstore *TimerStore) DumpAllTimers(ctx sdk.Context, which types.TimerType) string
- func (tstore *TimerStore) MigrateVersion(ctx sdk.Context) (err error)
- func (tstore *TimerStore) Tick(ctx sdk.Context)
- func (tstore *TimerStore) WithCallbackByBlockHeight(callback TimerCallback) *TimerStore
- func (tstore *TimerStore) WithCallbackByBlockTime(callback TimerCallback) *TimerStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimerVersion ¶ added in v0.10.0
func TimerVersion() uint64
TimerVersion returns the timer library version
Types ¶
type FixationStore ¶
type FixationStore struct {
// contains filtered or unexported fields
}
func NewFixationStore ¶
func NewFixationStore(storeKey sdk.StoreKey, cdc codec.BinaryCodec, prefix string) *FixationStore
NewFixationStore returns a new FixationStore object
func (*FixationStore) AdvanceBlock ¶ added in v0.10.0
func (fs *FixationStore) AdvanceBlock(ctx sdk.Context)
func (*FixationStore) AppendEntry ¶
func (fs *FixationStore) AppendEntry( ctx sdk.Context, index string, block uint64, entryData codec.ProtoMarshaler, ) error
AppendEntry adds a new entry to the store
func (*FixationStore) FindEntry ¶
func (fs *FixationStore) FindEntry(ctx sdk.Context, index string, block uint64, entryData codec.ProtoMarshaler) bool
FindEntry returns the entry by index and block without changing the refcount
func (FixationStore) GetAllEntryIndices ¶
func (fs FixationStore) GetAllEntryIndices(ctx sdk.Context) []string
GetAllEntryIndices returns all Entry indices
func (FixationStore) GetAllEntryIndicesWithPrefix ¶ added in v0.10.0
func (fs FixationStore) GetAllEntryIndicesWithPrefix(ctx sdk.Context, prefix string) []string
GetAllEntryIndexWithPrefix returns all Entry indices with a given prefix
func (*FixationStore) GetAllEntryVersions ¶ added in v0.10.0
func (fs *FixationStore) GetAllEntryVersions(ctx sdk.Context, index string, stale bool) (blocks []uint64)
GetAllEntryVersions returns a list of all versions (blocks) of an entry. If stale == true, then the output will include stale versions (for testing).
func (*FixationStore) GetEntry ¶
func (fs *FixationStore) GetEntry(ctx sdk.Context, index string, entryData codec.ProtoMarshaler) bool
GetEntry returns the latest entry by index and increments the refcount
func (*FixationStore) GetEntryVersionsRange ¶ added in v0.12.0
func (fs *FixationStore) GetEntryVersionsRange(ctx sdk.Context, index string, block, delta uint64) (blocks []uint64)
GetEntryVersionsRange returns a list of versions from nearest-smaller block and onward, and not more than delta blocks further (skip stale entries).
func (*FixationStore) MigrateVersion ¶ added in v0.10.0
func (fs *FixationStore) MigrateVersion(ctx sdk.Context) (err error)
MigrateVerrsion performs pending internal version migration(s), if any.
func (*FixationStore) MigrateVersionAndPrefix ¶ added in v0.12.0
func (fs *FixationStore) MigrateVersionAndPrefix(ctx sdk.Context, oldPrefix string) (err error)
MigrateVersionAndPrefix performs pending internal version migration(s), if any, and then replaces the old prefix with a new (current) one. (For the version migration(s) it uses the old prefix).
func (*FixationStore) ModifyEntry ¶
func (fs *FixationStore) ModifyEntry(ctx sdk.Context, index string, block uint64, entryData codec.ProtoMarshaler)
ModifyEntry modifies an existing entry in the store
func (*FixationStore) PutEntry ¶
func (fs *FixationStore) PutEntry(ctx sdk.Context, index string, block uint64)
PutEntry finds the entry by index and block and decrements the refcount
func (*FixationStore) ReadEntry ¶ added in v0.12.0
func (fs *FixationStore) ReadEntry(ctx sdk.Context, index string, block uint64, entryData codec.ProtoMarshaler)
ReadEntry returns and existing entry with index and specific block
type TimerCallback ¶ added in v0.10.0
TimerCallback defined the callback handler function
type TimerStore ¶ added in v0.10.0
type TimerStore struct {
// contains filtered or unexported fields
}
TimerStore represents a timer store to manager timers and timeouts
func NewTimerStore ¶ added in v0.10.0
func NewTimerStore(storeKey sdk.StoreKey, cdc codec.BinaryCodec, prefix string) *TimerStore
NewTimerStore returns a new TimerStore object
func (*TimerStore) AddTimerByBlockHeight ¶ added in v0.10.0
func (tstore *TimerStore) AddTimerByBlockHeight(ctx sdk.Context, block uint64, key []byte, data []byte)
AddTimerByBlockHeight adds a new timer to expire on a given block height. If a timer for that <block, key> tuple exists, it will be overridden.
func (*TimerStore) AddTimerByBlockTime ¶ added in v0.10.0
func (tstore *TimerStore) AddTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte, data []byte)
AddTimerByBlockTime adds a new timer to expire on a future block with the given timestamp. If a timer for that <timestamp, key> tuple exists, it will be overridden.
func (*TimerStore) DelTimerByBlockHeight ¶ added in v0.12.0
func (tstore *TimerStore) DelTimerByBlockHeight(ctx sdk.Context, block uint64, key []byte)
DelTimerByBlockHeight removes an existing timer for the <block, key> tuple.
func (*TimerStore) DelTimerByBlockTime ¶ added in v0.12.0
func (tstore *TimerStore) DelTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte)
DelTimerByBlockHeight removes an existing timer for the <timestamp, key> tuple.
func (*TimerStore) DumpAllTimers ¶ added in v0.12.0
DumpAllTimers dumps the details of all existing timers (of a type) into a string (for test/debug).
func (*TimerStore) MigrateVersion ¶ added in v0.10.0
func (tstore *TimerStore) MigrateVersion(ctx sdk.Context) (err error)
func (*TimerStore) Tick ¶ added in v0.10.0
func (tstore *TimerStore) Tick(ctx sdk.Context)
Tick advances the timer by a block. It should be called at the beginning of each block.
func (*TimerStore) WithCallbackByBlockHeight ¶ added in v0.10.0
func (tstore *TimerStore) WithCallbackByBlockHeight(callback TimerCallback) *TimerStore
WithCallbackByBlockHeight sets a callback handler for timeouts (by block height)
func (*TimerStore) WithCallbackByBlockTime ¶ added in v0.10.0
func (tstore *TimerStore) WithCallbackByBlockTime(callback TimerCallback) *TimerStore
WithCallbackByBlockHeight sets a callback handler for timeouts (by block timestamp)