Documentation
¶
Index ¶
- Variables
- func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc types.AccountI, ...) error
- func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error)
- func NewInboundDecorator(sk SwingsetKeeper) sdk.AnteDecorator
- type AccountKeeper
- type AdmissionDecorator
- type DeductFeeDecorator
- type FeegrantKeeper
- type HandlerOptions
- type SwingsetKeeper
Constants ¶
This section is empty.
Variables ¶
var ErrAdmissionRefused = sdkerrors.ErrMempoolIsFull
TODO: We don't have a more appropriate error type for this.
var ErrInboundQueueFull = sdkerrors.ErrMempoolIsFull
TODO: We don't have a more appropriate error type for this.
Functions ¶
func DeductFees ¶
func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc types.AccountI, fees sdk.Coins, feeCollectorName string) error
DeductFees deducts fees from the given account.
func NewAnteHandler ¶
func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error)
func NewInboundDecorator ¶ added in v0.32.0
func NewInboundDecorator(sk SwingsetKeeper) sdk.AnteDecorator
NewInboundDecorator returns an AnteDecorator which honors the allowed size of the inbound queue.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { GetParams(ctx sdk.Context) (params authtypes.Params) GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI SetAccount(ctx sdk.Context, acc authtypes.AccountI) GetModuleAddress(moduleName string) sdk.AccAddress }
AccountKeeper defines the contract needed for AccountKeeper related APIs. Interface provides support to use non-sdk AccountKeeper for AnteHandler's decorators.
type AdmissionDecorator ¶
type AdmissionDecorator struct {
// contains filtered or unexported fields
}
AdmissionDecorator will ask the Controller (such as SwingSet) if it is temporarily rejecting inbound messages. If CheckAdmissibility passes for all messages, decorator calls next AnteHandler in chain.
func NewAdmissionDecorator ¶
func NewAdmissionDecorator(data interface{}) AdmissionDecorator
func (AdmissionDecorator) AnteHandle ¶
func (ad AdmissionDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)
AnteHandle calls CheckAdmissibility for all messages that implement the vm.ControllerAdmissionMsg interface. If it returns an error, refuse the entire transaction.
type DeductFeeDecorator ¶
type DeductFeeDecorator struct {
// contains filtered or unexported fields
}
DeductFeeDecorator deducts fees from the first signer of the tx If the first signer does not have the funds to pay for the fees, return with InsufficientFunds error Call next AnteHandler if fees successfully deducted CONTRACT: Tx must implement FeeTx interface to use DeductFeeDecorator
func NewDeductFeeDecorator ¶
func NewDeductFeeDecorator(ak AccountKeeper, bk types.BankKeeper, fk FeegrantKeeper, feeCollectorName string) DeductFeeDecorator
func (DeductFeeDecorator) AnteHandle ¶
type FeegrantKeeper ¶
type FeegrantKeeper interface {
UseGrantedFees(ctx sdk.Context, granter, grantee sdk.AccAddress, fee sdk.Coins, msgs []sdk.Msg) error
}
FeegrantKeeper defines the expected feegrant keeper.
type HandlerOptions ¶
type HandlerOptions struct { ante.HandlerOptions IBCKeeper *ibckeeper.Keeper FeeCollectorName string AdmissionData interface{} SwingsetKeeper SwingsetKeeper }
HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.