Documentation ¶
Index ¶
- func DispatchMessagesForBlock(k types.DelayMsgKeeper, ctx sdk.Context)
- func NewMsgServerImpl(keeper types.DelayMsgKeeper) types.MsgServer
- type Keeper
- func (k Keeper) BlockMessageIds(c context.Context, req *types.QueryBlockMessageIdsRequest) (*types.QueryBlockMessageIdsResponse, error)
- func (k Keeper) DelayMessageByBlocks(ctx sdk.Context, msg sdk.Msg, blockDelay uint32) (id uint32, err error)
- func (k Keeper) DeleteMessage(ctx sdk.Context, id uint32) (err error)
- func (k Keeper) GetAllDelayedMessages(ctx sdk.Context) []*types.DelayedMessage
- func (k Keeper) GetBlockMessageIds(ctx sdk.Context, blockHeight uint32) (blockMessageIds types.BlockMessageIds, found bool)
- func (k Keeper) GetMessage(ctx sdk.Context, id uint32) (delayedMessage types.DelayedMessage, found bool)
- func (k Keeper) GetNextDelayedMessageId(ctx sdk.Context) uint32
- func (k Keeper) HasAuthority(authority string) bool
- func (k Keeper) InitializeForGenesis(ctx sdk.Context)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Message(c context.Context, req *types.QueryMessageRequest) (*types.QueryMessageResponse, error)
- func (k Keeper) NextDelayedMessageId(c context.Context, req *types.QueryNextDelayedMessageIdRequest) (*types.QueryNextDelayedMessageIdResponse, error)
- func (k Keeper) Router() lib.MsgRouter
- func (k Keeper) SetDelayedMessage(ctx sdk.Context, msg *types.DelayedMessage) (err error)
- func (k Keeper) SetNextDelayedMessageId(ctx sdk.Context, nextId uint32)
- func (k Keeper) ValidateMsg(msg sdk.Msg) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DispatchMessagesForBlock ¶
func DispatchMessagesForBlock(k types.DelayMsgKeeper, ctx sdk.Context)
DispatchMessagesForBlock executes all delayed messages scheduled for the given block height and deletes the messages. If there are no delayed messages scheduled for this block, this function does nothing. It is expected that this function is called at the end of every block.
func NewMsgServerImpl ¶
func NewMsgServerImpl(keeper types.DelayMsgKeeper) types.MsgServer
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, router *baseapp.MsgServiceRouter, authorities []string, ) *Keeper
NewKeeper creates a new x/delaymsg keeper.
func (Keeper) BlockMessageIds ¶
func (k Keeper) BlockMessageIds( c context.Context, req *types.QueryBlockMessageIdsRequest, ) ( *types.QueryBlockMessageIdsResponse, error, )
BlockMessageIds processes a query request/response for the BlockMessageIds from state.
func (Keeper) DelayMessageByBlocks ¶
func (k Keeper) DelayMessageByBlocks( ctx sdk.Context, msg sdk.Msg, blockDelay uint32, ) ( id uint32, err error, )
DelayMessageByBlocks registers an sdk.Msg to be executed after blockDelay blocks.
func (Keeper) DeleteMessage ¶
DeleteMessage deletes a message from the store.
func (Keeper) GetAllDelayedMessages ¶
func (k Keeper) GetAllDelayedMessages(ctx sdk.Context) []*types.DelayedMessage
GetAllDelayedMessages returns all messages in the store, sorted by id ascending. This is primarily used to export the genesis state.
func (Keeper) GetBlockMessageIds ¶
func (k Keeper) GetBlockMessageIds( ctx sdk.Context, blockHeight uint32, ) ( blockMessageIds types.BlockMessageIds, found bool, )
GetBlockMessageIds gets the ids of delayed messages to execute at a given block height. `found` is false is there is no delayed message for the given block height.
func (Keeper) GetMessage ¶
func (k Keeper) GetMessage( ctx sdk.Context, id uint32, ) ( delayedMessage types.DelayedMessage, found bool, )
GetMessage returns a message from its id.
func (Keeper) GetNextDelayedMessageId ¶ added in v0.4.0
GetNextDelayedMessageId returns the next delayed message id in the store.
func (Keeper) HasAuthority ¶
func (Keeper) InitializeForGenesis ¶
InitializeForGenesis initializes the x/delaymsg keeper for genesis.
func (Keeper) Message ¶
func (k Keeper) Message( c context.Context, req *types.QueryMessageRequest, ) ( *types.QueryMessageResponse, error, )
Message processes a query request/response for the Message from state.
func (Keeper) NextDelayedMessageId ¶ added in v0.4.0
func (k Keeper) NextDelayedMessageId( c context.Context, req *types.QueryNextDelayedMessageIdRequest, ) ( *types.QueryNextDelayedMessageIdResponse, error, )
NextDelayedMessageId processes a query request/response for the NextDelayedMessageId from state.
func (Keeper) SetDelayedMessage ¶
SetDelayedMessage delays a message to be executed at the specified block height. The delayed message is assigned the specified id. This method is suitable for initializing from genesis state.
func (Keeper) SetNextDelayedMessageId ¶ added in v0.4.0
SetNextDelayedMessageId sets the next delayed message id in the store.