Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) ExportErrors(ctx sdk.Context) (sudoErrs []types.SudoError, err error)
- func (k Keeper) GetAllSudoErrorCallbacks(ctx sdk.Context) (sudoErrs []types.SudoError)
- func (k Keeper) GetErrorsByContractAddress(ctx sdk.Context, contractAddress []byte) (sudoErrs []types.SudoError, err error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params, err error)
- func (k Keeper) GetSubscription(ctx sdk.Context, contractAddress sdk.AccAddress) (bool, int64)
- func (k Keeper) HasSubscription(ctx sdk.Context, contractAddress sdk.AccAddress) bool
- func (k Keeper) IterateSudoErrorCallbacks(ctx sdk.Context, exec func(types.SudoError) bool)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) PruneErrorsCurrentBlock(ctx sdk.Context) (err error)
- func (k Keeper) PruneSubscriptionsEndBlock(ctx sdk.Context) (err error)
- func (k Keeper) SetError(ctx sdk.Context, sudoErr types.SudoError) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k Keeper) SetSubscription(ctx sdk.Context, sender, contractAddress sdk.AccAddress, fee sdk.Coin) (int64, error)
- func (k Keeper) SetSudoErrorCallback(ctx sdk.Context, errorId uint64, sudoErr types.SudoError)
- func (k *Keeper) SetWasmKeeper(wk types.WasmKeeperExpected)
- func (k Keeper) StoreErrorInState(ctx sdk.Context, contractAddr sdk.AccAddress, sudoErr types.SudoError) error
- type MsgServer
- type QueryServer
- func (qs *QueryServer) Errors(c context.Context, request *types.QueryErrorsRequest) (*types.QueryErrorsResponse, error)
- func (qs *QueryServer) IsSubscribed(c context.Context, request *types.QueryIsSubscribedRequest) (*types.QueryIsSubscribedResponse, error)
- func (qs *QueryServer) Params(c context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
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 ¶
func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, tStoreKey storetypes.StoreKey, wk types.WasmKeeperExpected, bk types.BankKeeperExpected, ) Keeper
NewKeeper creates a new Keeper instance.
func (Keeper) ExportErrors ¶
ExportErrors returns all errors in state. Used for genesis export
func (Keeper) GetAllSudoErrorCallbacks ¶
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) GetSubscription ¶
GetSubscription returns the subscription end height for a contract
func (Keeper) HasSubscription ¶
HasSubscription checks if a contract has a subscription
func (Keeper) IterateSudoErrorCallbacks ¶
IterateSudoErrorCallbacks iterates over all sudo error callbacks from the transient store
func (Keeper) PruneErrorsCurrentBlock ¶
PruneErrorsCurrentBlock removes all errors that are queued to be deleted the given block height
func (Keeper) PruneSubscriptionsEndBlock ¶
PruneSubscriptionsEndBlock prunes subscriptions that have ended at the given block. This is executed at the module endblocker
func (Keeper) SetError ¶
SetError stores a sudo error and queues it for deletion after a certain block height
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 ¶
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 ¶
NewMsgServer creates a new gRPC messaging server.
func (*MsgServer) SubscribeToError ¶
func (s *MsgServer) SubscribeToError(c context.Context, request *types.MsgSubscribeToError) (*types.MsgSubscribeToErrorResponse, error)
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 ¶
func (qs *QueryServer) Errors(c context.Context, request *types.QueryErrorsRequest) (*types.QueryErrorsResponse, error)
Errors implements types.QueryServer.
func (*QueryServer) IsSubscribed ¶
func (qs *QueryServer) IsSubscribed(c context.Context, request *types.QueryIsSubscribedRequest) (*types.QueryIsSubscribedResponse, error)
IsSubscribed implements types.QueryServer.
func (*QueryServer) Params ¶
func (qs *QueryServer) Params(c context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params implements types.QueryServer.