keeper

package
v0.46.16 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEpochActionID = 1
	DefaultEpochNumber   = 0
)

Variables

View Source
var (
	NextEpochActionID      = []byte{0x11}
	EpochNumberID          = []byte{0x12}
	EpochActionQueuePrefix = []byte{0x13} // prefix for the epoch
)

Functions

func ActionStoreKey

func ActionStoreKey(epochNumber int64, actionID uint64) []byte

ActionStoreKey returns action store key from ID

Types

type Keeper

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

Keeper of the store

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, commitTimeout time.Duration) Keeper

NewKeeper creates a epoch queue manager

func (Keeper) DeleteByKey

func (k Keeper) DeleteByKey(ctx sdk.Context, key []byte)

DeleteByKey delete item by key

func (Keeper) DequeueEpochActions

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

DequeueEpochActions dequeue all the actions store on epoch

func (Keeper) GetEpochActionByIterator

func (k Keeper) GetEpochActionByIterator(iterator db.Iterator) sdk.Msg

GetEpochActionByIterator get action by iterator

func (Keeper) GetEpochActions

func (k Keeper) GetEpochActions(ctx sdk.Context) []sdk.Msg

GetEpochActions get all actions

func (Keeper) GetEpochActionsIterator

func (k Keeper) GetEpochActionsIterator(ctx sdk.Context) db.Iterator

GetEpochActionsIterator returns iterator for EpochActions

func (Keeper) GetEpochMsg

func (k Keeper) GetEpochMsg(ctx sdk.Context, epochNumber int64, actionID uint64) sdk.Msg

GetEpochMsg gets a msg by ID

func (Keeper) GetEpochNumber

func (k Keeper) GetEpochNumber(ctx sdk.Context) int64

GetEpochNumber fetches epoch number

func (Keeper) GetNewActionID

func (k Keeper) GetNewActionID(ctx sdk.Context) uint64

GetNewActionID returns ID to be used for next epoch

func (Keeper) GetNextEpochHeight

func (k Keeper) GetNextEpochHeight(ctx sdk.Context, epochInterval int64) int64

GetNextEpochHeight returns next epoch block height

func (Keeper) GetNextEpochTime

func (k Keeper) GetNextEpochTime(ctx sdk.Context, epochInterval int64) time.Time

GetNextEpochTime returns estimated next epoch time

func (Keeper) IncreaseEpochNumber

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

IncreaseEpochNumber increases epoch number

func (Keeper) QueueMsgForEpoch

func (k Keeper) QueueMsgForEpoch(ctx sdk.Context, epochNumber int64, msg sdk.Msg)

QueueMsgForEpoch save the actions that need to be executed on next epoch

func (Keeper) RestoreEpochAction

func (k Keeper) RestoreEpochAction(ctx sdk.Context, epochNumber int64, action *codectypes.Any)

RestoreEpochAction restore the actions that need to be executed on next epoch

func (Keeper) SetEpochNumber

func (k Keeper) SetEpochNumber(ctx sdk.Context, epochNumber int64)

SetEpochNumber set epoch number

Jump to

Keyboard shortcuts

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