ante

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAdmissionRefused = sdkerrors.ErrMempoolIsFull

TODO: We don't have a more appropriate error type for this.

View Source
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

func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

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.

type SwingsetKeeper added in v0.32.0

type SwingsetKeeper interface {
	InboundQueueLength(ctx sdk.Context) (int32, error)
	GetState(ctx sdk.Context) swingtypes.State
}

Jump to

Keyboard shortcuts

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