Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockMeter ¶ added in v0.15.0
BlockMeter calculates block time interval dynamically.
func StaticBlockMeter ¶ added in v0.15.0
func StaticBlockMeter(d uint32) BlockMeter
StaticBlockMeter returns BlockMeters that always returns (d, nil).
type BlockTickHandler ¶ added in v0.15.0
type BlockTickHandler func()
BlockTickHandler is a callback of a certain block advance.
type BlockTimer ¶ added in v0.15.0
type BlockTimer struct {
// contains filtered or unexported fields
}
BlockTimer represents block timer.
It can tick the blocks and perform certain actions on block time intervals.
func NewBlockTimer ¶ added in v0.15.0
func NewBlockTimer(dur BlockMeter, h BlockTickHandler) *BlockTimer
NewBlockTimer creates a new BlockTimer.
Reset should be called before timer ticking.
func (*BlockTimer) OnDelta ¶ added in v0.15.0
func (t *BlockTimer) OnDelta(mul, div uint32, h BlockTickHandler, opts ...DeltaOption)
OnDelta registers handler which is executed on (mul / div * BlockMeter()) block after basic interval reset.
If WithPulse option is provided, handler is executed (mul / div * BlockMeter()) block during base interval.
func (*BlockTimer) Reset ¶ added in v0.15.0
func (t *BlockTimer) Reset() error
Reset resets previous ticks of the BlockTimer.
Returns BlockMeter's error upon occurrence.
func (*BlockTimer) Tick ¶ added in v0.15.0
func (t *BlockTimer) Tick()
Tick ticks one block in the BlockTimer.
Executes all callbacks which are awaiting execution at the new block.
type DeltaOption ¶ added in v0.15.0
type DeltaOption func(*deltaCfg)
DeltaOption is an option of delta-interval handler.
func WithPulse ¶ added in v0.15.0
func WithPulse() DeltaOption
WithPulse returns option to call delta-interval handler multiple times
type NewAlphabetEmitTick ¶ added in v0.12.0
type NewAlphabetEmitTick struct{}
NewAlphabetEmitTick is a event for gas emission from alphabet contract.
func (NewAlphabetEmitTick) MorphEvent ¶ added in v0.12.0
func (NewAlphabetEmitTick) MorphEvent()
MorphEvent implements Event interface.
type NewEpochTick ¶
type NewEpochTick struct{}
NewEpochTick is a new epoch local ticker event.
func (NewEpochTick) MorphEvent ¶
func (NewEpochTick) MorphEvent()
MorphEvent implements Event interface.