Documentation ¶
Index ¶
- Constants
- func TimerVersion() uint64
- type AppModule
- type AppModuleBasic
- func (a AppModuleBasic) GetQueryCmd() *cobra.Command
- func (a AppModuleBasic) GetTxCmd() *cobra.Command
- func (a AppModuleBasic) Name() string
- func (a AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux)
- func (a AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry)
- func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino)
- type Keeper
- type TimerCallback
- type TimerStore
- func (tstore *TimerStore) AddTimerByBlockHeight(ctx sdk.Context, block uint64, key, data []byte)
- func (tstore *TimerStore) AddTimerByBlockTime(ctx sdk.Context, timestamp uint64, key, 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) Export(ctx sdk.Context) []types.RawMessage
- func (tstore *TimerStore) HasTimerByBlockHeight(ctx sdk.Context, block uint64, key []byte) bool
- func (tstore *TimerStore) HasTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte) bool
- func (tstore *TimerStore) Init(ctx sdk.Context, data []types.RawMessage)
- 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 ¶
const (
ConsensusVersion = 1
)
const (
ModuleName = "timerstore"
)
Variables ¶
This section is empty.
Functions ¶
func TimerVersion ¶ added in v0.25.0
func TimerVersion() uint64
TimerVersion returns the timer library version
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
func NewAppModule ¶
func (AppModule) BeginBlock ¶
func (a AppModule) BeginBlock(context sdk.Context, _ abci.RequestBeginBlock)
func (AppModule) ConsensusVersion ¶
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic implements the module.AppModuleBasic interface for the downtime module.
func (AppModuleBasic) GetQueryCmd ¶
func (a AppModuleBasic) GetQueryCmd() *cobra.Command
func (AppModuleBasic) GetTxCmd ¶
func (a AppModuleBasic) GetTxCmd() *cobra.Command
func (AppModuleBasic) Name ¶
func (a AppModuleBasic) Name() string
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶
func (a AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux)
func (AppModuleBasic) RegisterInterfaces ¶
func (a AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry)
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino)
type Keeper ¶ added in v0.24.1
type Keeper struct {
// contains filtered or unexported fields
}
Keeper is the timerstore keeper. The keeper retains all the fixation stores used by modules, it also manages their lifecycle.
func NewKeeper ¶ added in v0.24.1
func NewKeeper(cdc codec.BinaryCodec) *Keeper
func (*Keeper) BeginBlock ¶ added in v0.24.1
func (*Keeper) NewTimerStore ¶ added in v0.24.1
func (k *Keeper) NewTimerStore(storeKey storetypes.StoreKey, prefix string) *TimerStore
type TimerCallback ¶ added in v0.25.0
TimerCallback defined the callback handler function
type TimerStore ¶ added in v0.25.0
type TimerStore struct {
// contains filtered or unexported fields
}
TimerStore represents a timer store to manager timers and timeouts
func NewTimerStore ¶ added in v0.25.0
func NewTimerStore(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, prefix string) *TimerStore
NewTimerStore returns a new TimerStore object
func (*TimerStore) AddTimerByBlockHeight ¶ added in v0.25.0
func (tstore *TimerStore) AddTimerByBlockHeight(ctx sdk.Context, block uint64, key, 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.25.0
func (tstore *TimerStore) AddTimerByBlockTime(ctx sdk.Context, timestamp uint64, key, 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.25.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.25.0
func (tstore *TimerStore) DelTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte)
DelTimerByBlockTime removes an existing timer for the <timestamp, key> tuple.
func (*TimerStore) DumpAllTimers ¶ added in v0.25.0
DumpAllTimers dumps the details of all existing timers (of a type) into a string (for test/debug).
func (*TimerStore) Export ¶ added in v0.25.0
func (tstore *TimerStore) Export(ctx sdk.Context) []types.RawMessage
func (*TimerStore) HasTimerByBlockHeight ¶ added in v0.25.0
HasTimerByBlockHeight checks whether a timer exists for the <block, key> tuple.
func (*TimerStore) HasTimerByBlockTime ¶ added in v0.25.0
HasTimerByBlockTime checks whether a timer exists for the <timestamp, key> tuple.
func (*TimerStore) Init ¶ added in v0.25.0
func (tstore *TimerStore) Init(ctx sdk.Context, data []types.RawMessage)
func (*TimerStore) MigrateVersion ¶ added in v0.25.0
func (tstore *TimerStore) MigrateVersion(ctx sdk.Context) (err error)
func (*TimerStore) Tick ¶ added in v0.25.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.25.0
func (tstore *TimerStore) WithCallbackByBlockHeight(callback TimerCallback) *TimerStore
WithCallbackByBlockHeight sets a callback handler for timeouts (by block height)
func (*TimerStore) WithCallbackByBlockTime ¶ added in v0.25.0
func (tstore *TimerStore) WithCallbackByBlockTime(callback TimerCallback) *TimerStore
WithCallbackByBlockHeight sets a callback handler for timeouts (by block timestamp)