ante

package
v0.0.0-...-837776e Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 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 NewAnteHandler

func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error)

func NewInboundDecorator

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

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