keeper

package
v0.0.0-...-fb8f645 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LabelExecuteReadySchedules   = "execute_ready_schedules"
	LabelScheduleCount           = "schedule_count"
	LabelScheduleExecutionsCount = "schedule_executions_count"

	MetricLabelSuccess      = "success"
	MetricLabelScheduleName = "schedule_name"
)

Functions

This section is empty.

Types

type Keeper

type Keeper struct {
	WasmMsgServer types.WasmMsgServer
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	accountKeeper types.AccountKeeper,
) *Keeper

func (*Keeper) AddSchedule

func (k *Keeper) AddSchedule(ctx sdk.Context, name string, period uint64, msgs []types.MsgExecuteContract) error

AddSchedule adds new schedule to execution for every block `period`. First schedule execution is supposed to be on `now + period` block.

func (*Keeper) ExecuteReadySchedules

func (k *Keeper) ExecuteReadySchedules(ctx sdk.Context)

ExecuteReadySchedules gets all schedules that are due for execution (with limit that is equal to Params.Limit) and executes messages in each one NOTE that errors in contract calls rollback all already executed messages

func (*Keeper) GetAllSchedules

func (k *Keeper) GetAllSchedules(ctx sdk.Context) []types.Schedule

GetAllSchedules returns all schedules

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams get all parameters as types.Params

func (*Keeper) GetSchedule

func (k *Keeper) GetSchedule(ctx sdk.Context, name string) (*types.Schedule, bool)

GetSchedule returns schedule with a given `name`

func (*Keeper) GetScheduleCount

func (k *Keeper) GetScheduleCount(ctx sdk.Context) int32

func (*Keeper) Logger

func (k *Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) Params

func (*Keeper) RemoveSchedule

func (k *Keeper) RemoveSchedule(ctx sdk.Context, name string)

RemoveSchedule removes schedule with a given `name`

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

Jump to

Keyboard shortcuts

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