keeper

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SetGasLimitCost   uint64 = 2510
	MaximumTriggerGas uint64 = 2000000
)
View Source
const (
	MaximumActions  uint64 = 5
	MaximumQueueGas uint64 = 2000000
)

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the account MsgServer interface for the provided Keeper.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	key storetypes.StoreKey,
	router baseapp.IMsgServiceRouter,
) Keeper

func (Keeper) Dequeue

func (k Keeper) Dequeue(ctx sdk.Context)

DequeueTrigger Removes the first item from the queue and updates the internal counters.

func (Keeper) DetectBlockEvents

func (k Keeper) DetectBlockEvents(ctx sdk.Context)

DetectBlockEvents Detects triggers that have been activated by their corresponding events.

func (Keeper) Enqueue

func (k Keeper) Enqueue(ctx sdk.Context, item types.QueuedTrigger)

Enqueue Adds an item to the end of the queue and adjusts the internal counters.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns a GenesisState for a given context.

func (Keeper) GetAllGasLimits

func (k Keeper) GetAllGasLimits(ctx sdk.Context) (gasLimits []types.GasLimit, err error)

GetAllGasLimits Gets all the gas limits within the store.

func (Keeper) GetAllQueueItems

func (k Keeper) GetAllQueueItems(ctx sdk.Context) (items []types.QueuedTrigger, err error)

GetAllQueueItems Gets all the queue items within the store.

func (Keeper) GetAllTriggers

func (k Keeper) GetAllTriggers(ctx sdk.Context) (triggers []types.Trigger, err error)

GetAllTriggers Gets all the triggers within the store.

func (Keeper) GetEventListener

func (k Keeper) GetEventListener(ctx sdk.Context, eventName string, order uint64, triggerID triggertypes.TriggerID) (trigger triggertypes.Trigger, err error)

GetEventListener Gets the event listener from the store.

func (Keeper) GetGasLimit

func (k Keeper) GetGasLimit(ctx sdk.Context, id types.TriggerID) (gasLimit uint64)

GetGasLimit Gets a gas limit by id

func (Keeper) GetTrigger

func (k Keeper) GetTrigger(ctx sdk.Context, id types.TriggerID) (trigger types.Trigger, err error)

GetTrigger Gets a trigger from the store by id.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)

InitGenesis new trigger genesis

func (Keeper) IterateEventListeners

func (k Keeper) IterateEventListeners(ctx sdk.Context, eventName string, handle func(trigger triggertypes.Trigger) (stop bool, err error)) error

IterateEventListeners Iterates through all the event listeners.

func (Keeper) IterateGasLimits

func (k Keeper) IterateGasLimits(ctx sdk.Context, handle func(gasLimit types.GasLimit) (stop bool, err error)) error

IterateGasLimits Iterates through all the gas limits.

func (Keeper) IterateTriggers

func (k Keeper) IterateTriggers(ctx sdk.Context, handle func(trigger types.Trigger) (stop bool, err error)) error

IterateTriggers Iterates through all the triggers.

func (Keeper) Logger

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

func (Keeper) NewTriggerWithID

func (k Keeper) NewTriggerWithID(ctx sdk.Context, owner string, event *codectypes.Any, actions []*codectypes.Any) types.Trigger

NewTriggerWithID Creates a trigger with the latest ID.

func (Keeper) ProcessTriggers

func (k Keeper) ProcessTriggers(ctx sdk.Context)

ProcessTriggers Reads triggers from queues and attempts to run them.

func (Keeper) QueueIsEmpty

func (k Keeper) QueueIsEmpty(ctx sdk.Context) bool

QueueIsEmpty Checks if the queue is empty.

func (Keeper) QueuePeek

func (k Keeper) QueuePeek(ctx sdk.Context) *types.QueuedTrigger

QueuePeek Returns the next item to be dequeued.

func (Keeper) QueueTrigger

func (k Keeper) QueueTrigger(ctx sdk.Context, trigger types.Trigger)

QueueTrigger Creates a QueuedTrigger and Enqueues it

func (Keeper) RegisterTrigger

func (k Keeper) RegisterTrigger(ctx sdk.Context, trigger triggertypes.Trigger)

RegisterTrigger Adds the trigger to the trigger, event listener, and gas store

func (Keeper) RemoveEventListener

func (k Keeper) RemoveEventListener(ctx sdk.Context, trigger triggertypes.Trigger) bool

RemoveEventListener Removes the trigger from the event listener store.

func (Keeper) RemoveGasLimit

func (k Keeper) RemoveGasLimit(ctx sdk.Context, id types.TriggerID) bool

RemoveGasLimit Removes a gas limit for a trigger

func (Keeper) RemoveTrigger

func (k Keeper) RemoveTrigger(ctx sdk.Context, id types.TriggerID) bool

RemoveTrigger Removes a trigger from the store.

func (Keeper) SetEventListener

func (k Keeper) SetEventListener(ctx sdk.Context, trigger triggertypes.Trigger)

SetEventListener Adds the trigger to the event listener store.

func (Keeper) SetGasLimit

func (k Keeper) SetGasLimit(ctx sdk.Context, id types.TriggerID, gasLimit uint64)

SetGasLimit Sets a gas limit for a trigger

func (Keeper) SetTrigger

func (k Keeper) SetTrigger(ctx sdk.Context, trigger types.Trigger)

SetTrigger Sets the trigger in the store.

func (Keeper) TriggerByID

TriggerByID returns a trigger matching the ID.

func (Keeper) Triggers

Triggers returns the list of triggers.

func (Keeper) UnregisterTrigger

func (k Keeper) UnregisterTrigger(ctx sdk.Context, trigger triggertypes.Trigger)

UnregisterTrigger Removes the trigger from the trigger, and event listener

Jump to

Keyboard shortcuts

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