manager

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeApp

type FakeApp interface {
	Hourly(ctx sdk.Context) []linotypes.BCEventErr
	Daily(ctx sdk.Context) []linotypes.BCEventErr
	Monthly(ctx sdk.Context) []linotypes.BCEventErr
	Yearly(ctx sdk.Context) []linotypes.BCEventErr
}

type GlobalManager

type GlobalManager struct {
	// contains filtered or unexported fields
}

GlobalManager - a event manager module, it schedules event, execute events and store errors of executed events.

func NewGlobalManager

func NewGlobalManager(key sdk.StoreKey, keeper param.ParamKeeper, cdc *codec.Codec,
	hourly linotypes.BCEventExec,
	daily linotypes.BCEventExec,
	monthly linotypes.BCEventExec,
	yearly linotypes.BCEventExec,
) GlobalManager

NewGlobalManager - return the global manager

func (GlobalManager) ExecuteEvents

func (gm GlobalManager) ExecuteEvents(ctx sdk.Context, exec linotypes.EventExec)

ExecuteEvents - execute events, log errors to storage, up to current time (exclusively).

func (GlobalManager) ExportToFile

func (gm GlobalManager) ExportToFile(ctx sdk.Context, cdc *codec.Codec, filepath string) error

func (GlobalManager) GetBCEventErrors

func (gm GlobalManager) GetBCEventErrors(ctx sdk.Context) []linotypes.BCEventErr

func (GlobalManager) GetEventErrors

func (gm GlobalManager) GetEventErrors(ctx sdk.Context) []model.EventError

func (GlobalManager) GetGlobalTime

func (gm GlobalManager) GetGlobalTime(ctx sdk.Context) model.GlobalTime

func (GlobalManager) GetLastBlockTime

func (gm GlobalManager) GetLastBlockTime(ctx sdk.Context) int64

GetLastBlockTime - get last block time from KVStore

func (GlobalManager) GetPastDay

func (gm GlobalManager) GetPastDay(ctx sdk.Context, unixTime int64) int64

GetPastDay - get start time from KVStore to calculate past day

func (GlobalManager) ImportFromFile

func (gm GlobalManager) ImportFromFile(ctx sdk.Context, cdc *codec.Codec, filepath string) error

func (GlobalManager) InitGenesis

func (gm GlobalManager) InitGenesis(ctx sdk.Context)

func (GlobalManager) OnBeginBlock

func (gm GlobalManager) OnBeginBlock(ctx sdk.Context)

OnBeginBlock - update internal time related fields and execute blockchain scheduled events.

func (GlobalManager) OnEndBlock

func (gm GlobalManager) OnEndBlock(ctx sdk.Context)

OnEndBlock - update last block time.

func (GlobalManager) RegisterEventAtTime

func (gm GlobalManager) RegisterEventAtTime(ctx sdk.Context, unixTime int64, event linotypes.Event) sdk.Error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL