keeper

package
v1.0.0-rc04 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

type Keeper struct {
	Schema collections.Schema

	// Params key: ParamsKeyPrefix | value: Params
	Params collections.Item[types.Params]
	// ErrorID key: ErrorsCountKey | value: ErrorID
	ErrorID collections.Sequence
	// ContractErrors key: ContractErrorsKeyPrefix + contractAddress + ErrorId | value: nil
	ContractErrors collections.Map[collections.Pair[[]byte, uint64], []byte]
	// ContractErrors key: ErrorsKeyPrefix + ErrorId | value: SudoError
	Errors collections.Map[uint64, types.SudoError]
	// DeletionBlocks key: DeletionBlocksKeyPrefix + BlockHeight + ErrorId | value: nil
	DeletionBlocks collections.Map[collections.Pair[int64, uint64], []byte]
	// ContractSubscriptions key: ContractSubscriptionsKeyPrefix + contractAddress | value: deletionHeight
	ContractSubscriptions collections.Map[[]byte, int64]
	// SubscriptionEndBlock key: SubscriptionEndBlockKeyPrefix + BlockHeight + contractAddress | value: nil
	SubscriptionEndBlock collections.Map[collections.Pair[int64, []byte], []byte]
	// contains filtered or unexported fields
}

Keeper provides module state operations.

func NewKeeper

NewKeeper creates a new Keeper instance.

func (Keeper) ExportErrors

func (k Keeper) ExportErrors(ctx sdk.Context) (sudoErrs []types.SudoError, err error)

ExportErrors returns all errors in state. Used for genesis export

func (Keeper) GetAllSudoErrorCallbacks

func (k Keeper) GetAllSudoErrorCallbacks(ctx sdk.Context) (sudoErrs []types.SudoError)

GetAllSudoErrorCallbacks returns all sudo error callbacks from the transient store

func (Keeper) GetErrorsByContractAddress

func (k Keeper) GetErrorsByContractAddress(ctx sdk.Context, contractAddress []byte) (sudoErrs []types.SudoError, err error)

GetErrosByContractAddress returns all errors (in state) for a given contract address

func (Keeper) GetParams

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

GetParams return all module parameters.

func (Keeper) GetSubscription

func (k Keeper) GetSubscription(ctx sdk.Context, contractAddress sdk.AccAddress) (bool, int64)

GetSubscription returns the subscription end height for a contract

func (Keeper) HasSubscription

func (k Keeper) HasSubscription(ctx sdk.Context, contractAddress sdk.AccAddress) bool

HasSubscription checks if a contract has a subscription

func (Keeper) IterateSudoErrorCallbacks

func (k Keeper) IterateSudoErrorCallbacks(ctx sdk.Context, exec func(types.SudoError) bool)

IterateSudoErrorCallbacks iterates over all sudo error callbacks from the transient store

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) PruneErrorsCurrentBlock

func (k Keeper) PruneErrorsCurrentBlock(ctx sdk.Context) (err error)

PruneErrorsCurrentBlock removes all errors that are queued to be deleted the given block height

func (Keeper) PruneSubscriptionsEndBlock

func (k Keeper) PruneSubscriptionsEndBlock(ctx sdk.Context) (err error)

PruneSubscriptionsEndBlock prunes subscriptions that have ended at the given block. This is executed at the module endblocker

func (Keeper) SetError

func (k Keeper) SetError(ctx sdk.Context, sudoErr types.SudoError) error

SetError stores a sudo error and queues it for deletion after a certain block height

func (Keeper) SetParams

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

SetParams sets all module parameters.

func (Keeper) SetSubscription

func (k Keeper) SetSubscription(ctx sdk.Context, sender, contractAddress sdk.AccAddress, fee sdk.Coin) (int64, error)

SetSubscription sets a subscription for a contract so the contract can receive error callbacks

func (Keeper) SetSudoErrorCallback

func (k Keeper) SetSudoErrorCallback(ctx sdk.Context, errorId uint64, sudoErr types.SudoError)

SetSudoErrorCallback stores a sudo error callback in the transient store

func (*Keeper) SetWasmKeeper

func (k *Keeper) SetWasmKeeper(wk types.WasmKeeperExpected)

SetWasmKeeper sets the given wasm keeper. Only for testing purposes

func (Keeper) StoreErrorInState

func (k Keeper) StoreErrorInState(ctx sdk.Context, contractAddr sdk.AccAddress, sudoErr types.SudoError) error

StoreErrorInState stores the error in the state and queues it for deletion after a certain block height

type MsgServer

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

MsgServer implements the module gRPC messaging service.

func NewMsgServer

func NewMsgServer(keeper Keeper) *MsgServer

NewMsgServer creates a new gRPC messaging server.

func (*MsgServer) SubscribeToError

SubscribeToError implements types.MsgServer.

type QueryServer

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

QueryServer implements the module gRPC query service.

func NewQueryServer

func NewQueryServer(keeper Keeper) *QueryServer

NewQueryServer creates a new gRPC query server.

func (*QueryServer) Errors

Errors implements types.QueryServer.

func (*QueryServer) IsSubscribed

IsSubscribed implements types.QueryServer.

func (*QueryServer) Params

Params implements types.QueryServer.

Jump to

Keyboard shortcuts

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