keeper

package
v1.0.0-rc05 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 13 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]
	// Callbacks key: CallbackKeyPrefix | value: []Callback
	Callbacks collections.Map[collections.Triple[int64, []byte, uint64], types.Callback]
	// contains filtered or unexported fields
}

Keeper provides module state operations.

func NewKeeper

NewKeeper creates a new Keeper instance.

func (Keeper) CalculateTransactionFees

func (k Keeper) CalculateTransactionFees(ctx sdk.Context, gasAmount uint64, minPriceOfGas sdk.Coin) sdk.Coin

func (Keeper) DeleteCallback

func (k Keeper) DeleteCallback(ctx sdk.Context, sender string, callback types.Callback) error

DeleteCallback deletes a callback given the height, contract address and job id

func (Keeper) EstimateCallbackFees

func (k Keeper) EstimateCallbackFees(ctx sdk.Context, blockHeight int64) (sdk.Coin, sdk.Coin, sdk.Coin, error)

EstimateCallbackFees returns the fees that will be charged for registering a callback at the given block height The returned value is in the order of: 1. Future reservation fees 2. Block reservation fees 3. Transaction fees 4. Errors, if any

func (Keeper) ExistsCallback

func (k Keeper) ExistsCallback(ctx sdk.Context, height int64, contractAddr string, jobID uint64) (bool, error)

ExistsCallback returns true if the callback exists for height with same contract address and same job id

func (Keeper) GetAllCallbacks

func (k Keeper) GetAllCallbacks(ctx sdk.Context) (callbacks []types.Callback, err error)

GetAllCallbacks lists all the pending callbacks

func (Keeper) GetCallback

func (k Keeper) GetCallback(ctx sdk.Context, height int64, contractAddr string, jobID uint64) (types.Callback, error)

GetCallback returns the callback given the height, contract address and job id

func (Keeper) GetCallbacksByHeight

func (k Keeper) GetCallbacksByHeight(ctx sdk.Context, height int64) (callbacks []*types.Callback, err error)

GetCallbacksByHeight returns the callbacks registered for the given height

func (Keeper) GetParams

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

GetParams return all module parameters.

func (Keeper) IterateCallbacksByHeight

func (k Keeper) IterateCallbacksByHeight(ctx sdk.Context, height int64, exec func(types.Callback) bool)

IterateCallbacksByHeight iterates over callbacks for registered for the given height and executes them

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) RefundFromCallbackModule

func (k Keeper) RefundFromCallbackModule(ctx sdk.Context, recipient string, amount sdk.Coin) error

RefundFromCallbackModule sends coins from the x/callback module account to the recipient.

func (Keeper) SaveCallback

func (k Keeper) SaveCallback(ctx sdk.Context, callback types.Callback) error

SaveCallback saves a callback given the height, contract address and job id and callback data

func (Keeper) SendToCallbackModule

func (k Keeper) SendToCallbackModule(ctx sdk.Context, sender string, amount sdk.Coin) error

SendToCallbackModule sends coins from the sender to the x/callback module account.

func (Keeper) SendToFeeCollector

func (k Keeper) SendToFeeCollector(ctx sdk.Context, amount sdk.Coin) error

SendToFeeCollector sends coins from the x/callback module account to the fee collector account.

func (Keeper) SetParams

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

SetParams sets all module parameters.

func (*Keeper) SetWasmKeeper

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

SetWasmKeeper sets the given wasm keeper. Only for testing purposes

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) CancelCallback

CancelCallback implements types.MsgServer.

func (MsgServer) RequestCallback

RequestCallback 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) Callbacks

Callbacks implements types.QueryServer.

func (*QueryServer) EstimateCallbackFees

EstimateCallbackFees 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