ante

package
v7.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsumeMultisignatureVerificationGas

func ConsumeMultisignatureVerificationGas(
	meter sdk.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey,
	params authtypes.Params, accSeq uint64,
) error

ConsumeMultisignatureVerificationGas consumes gas from a GasMeter for verifying a multisig pubkey signature

func DefaultSigVerificationGasConsumer

func DefaultSigVerificationGasConsumer(
	meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params,
) error

DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas for signature verification based upon the public key type. The cost is fetched from the given params and is matched by the concrete type.

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) sdk.AnteHandler

Types

type AccountKeeper

type AccountKeeper interface {
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
	GetModuleAddress(moduleName string) sdk.AccAddress
	GetAllAccounts(ctx sdk.Context) (accounts []authtypes.AccountI)
	IterateAccounts(ctx sdk.Context, cb func(account authtypes.AccountI) bool)
	GetSequence(sdk.Context, sdk.AccAddress) (uint64, error)
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
	SetAccount(ctx sdk.Context, account authtypes.AccountI)
	RemoveAccount(ctx sdk.Context, account authtypes.AccountI)
	GetParams(ctx sdk.Context) (params authtypes.Params)
}

AccountKeeper defines the expected account keeper interface

type CheckTxFeees

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

func NewCheckTxFeees

func NewCheckTxFeees(bypassMinFeeMsgTypes []string, maxBypassMinFeeMsgGasUsage uint64) CheckTxFeees

func (CheckTxFeees) Check

func (ctf CheckTxFeees) Check(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error)

type DisableMsgDecorator

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

func NewDisableMsgDecorator

func NewDisableMsgDecorator(disabledMsgTypes []string, govKeeper Govkeeper) DisableMsgDecorator

func (DisableMsgDecorator) AnteHandle

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

type EthPubKeyDecorator

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

func NewEthPubKeyDecorator

func NewEthPubKeyDecorator(ak ante.AccountKeeper) EthPubKeyDecorator

func (EthPubKeyDecorator) AnteHandle

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

type FeeMarketKeeper

type FeeMarketKeeper interface {
	GetParams(ctx sdk.Context) (params feemarkettypes.Params)
	AddTransientGasWanted(ctx sdk.Context, gasWanted uint64) (uint64, error)
	GetBaseFeeEnabled(ctx sdk.Context) bool
}

FeeMarketKeeper defines the expected keeper interface used on the AnteHandler

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 Govkeeper

type Govkeeper interface {
	GetDisabledMsgs(ctx sdk.Context) []string
}

type HandlerOptions

type HandlerOptions struct {
	AccountKeeper     AccountKeeper
	BankKeeper        authtypes.BankKeeper
	FeegrantKeeper    FeegrantKeeper
	EvmKeeper         ethante.EVMKeeper
	FeeMarketKeeper   FeeMarketKeeper
	IbcKeeper         *ibckeeper.Keeper
	GovKeeper         Govkeeper
	SignModeHandler   authsigning.SignModeHandler
	SigGasConsumer    ante.SignatureVerificationGasConsumer
	TxFeeChecker      ante.TxFeeChecker
	MaxTxGasWanted    uint64
	InterceptMsgTypes map[int64][]string
	DisabledAuthzMsgs []string
	PendingTxListener ethante.PendingTxListener
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper, EVM Keeper and Fee Market Keeper.

func (HandlerOptions) Validate

func (options HandlerOptions) Validate() error

type PubKeyDecorator

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

func NewPubKeyDecorator

func NewPubKeyDecorator(ak ante.AccountKeeper) PubKeyDecorator

func (PubKeyDecorator) AnteHandle

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

type RejectExtensionOptionsDecorator

type RejectExtensionOptionsDecorator struct{}

RejectExtensionOptionsDecorator is an AnteDecorator that rejects all extension options which can optionally be included in protobuf transactions. Users that need extension options should create a custom AnteHandler chain that handles needed extension options properly and rejects unknown ones.

func NewRejectExtensionOptionsDecorator

func NewRejectExtensionOptionsDecorator() RejectExtensionOptionsDecorator

NewRejectExtensionOptionsDecorator creates a new RejectExtensionOptionsDecorator

func (RejectExtensionOptionsDecorator) AnteHandle

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

AnteHandle implements the AnteDecorator.AnteHandle method

type TxListenerDecorator

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

func (TxListenerDecorator) AnteHandle

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

Jump to

Keyboard shortcuts

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