ante

package
v23.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyAnte = func(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) {
		return ctx, nil
	}
)

This empty ante is used to call AnteHandles that are not attached to the main AnteHandler.

Functions

func DeductFees

func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc types.AccountI, fees sdk.Coins) error

DeductFees deducts fees from the given account.

Types

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

Additionally, the Deduct Fee ante is a fork of the SDK's DeductFeeDecorator. This decorator looks for single message transactions with no provided fee. If they correspond to a registered FeePay Contract, the FeePay module will cover the cost of the fee (if the balance permits).

func NewDeductFeeDecorator

func NewDeductFeeDecorator(fpk feepaykeeper.Keeper, gfk globalfeekeeper.Keeper, ak ante.AccountKeeper, bk bankkeeper.Keeper, fgk ante.FeegrantKeeper, bondDenom string, isFeePayTx *bool) DeductFeeDecorator

func (DeductFeeDecorator) AnteHandle

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

type MsgIsFeePayTx

type MsgIsFeePayTx struct {
	// contains filtered or unexported fields
}

MsgIsFeePayTx defines an AnteHandler decorator that only checks and saves if a

func NewFeeRouteDecorator

func NewFeeRouteDecorator(feePayKeeper feepaykeeper.Keeper, feePayDecorator *DeductFeeDecorator, globalFeeDecorator *globalfeeante.FeeDecorator, isFeePayTx *bool) MsgIsFeePayTx

func (MsgIsFeePayTx) AnteHandle

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

This handle is responsible for routing the transaction to the fee decorators in the right order.

Jump to

Keyboard shortcuts

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