ante

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnteHandler

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

Types

type GovPreventSpamDecorator

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

func NewGovPreventSpamDecorator

func NewGovPreventSpamDecorator(cdc codec.BinaryCodec, govKeeper *govkeeper.Keeper) GovPreventSpamDecorator

func (GovPreventSpamDecorator) AnteHandle

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

func (GovPreventSpamDecorator) ValidateGovMsgs

func (g GovPreventSpamDecorator) ValidateGovMsgs(ctx sdk.Context, msgs []sdk.Msg) error

validateGovMsgs checks if the InitialDeposit amounts are greater than the minimum initial deposit amount

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions
	Codec           codec.BinaryCodec
	GovKeeper       *govkeeper.Keeper
	StakingSubspace paramtypes.Subspace
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.

type MempoolFeeDecorator

type MempoolFeeDecorator struct{}

MempoolFeeDecorator will check if the transaction's fee is at least as large as the local validator's minimum gasFee (defined in validator config).

If fee is too low, decorator returns error and tx is rejected from mempool. Note this only applies when ctx.CheckTx = true. If fee is high enough or not CheckTx, then call next AnteHandler.

CONTRACT: Tx must implement FeeTx to use MempoolFeeDecorator

func NewMempoolFeeDecorator

func NewMempoolFeeDecorator() MempoolFeeDecorator

func (MempoolFeeDecorator) AnteHandle

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

Jump to

Keyboard shortcuts

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