Documentation
¶
Index ¶
- Variables
- func FormatTx(tx sdk.Tx) string
- func NewAnteHandler(accountKeeper ante.AccountKeeper, bankKeeper authtypes.BankKeeper, ...) sdk.AnteHandler
- func ValidateTxFee(ctx sdk.Context, tx sdk.Tx, minfeeKeeper *minfeekeeper.Keeper) (sdk.Coins, int64, error)
- func ValidateTxFeeWrapper(minfeeKeeper *minfeekeeper.Keeper) ante.TxFeeChecker
- type ConsumeTxSizeGasDecorator
- type HandlePanicDecorator
- type MsgExecDecorator
- type ParamFilter
- type ParamFilterDecorator
Constants ¶
This section is empty.
Variables ¶
var DefaultSigVerificationGasConsumer = ante.DefaultSigVerificationGasConsumer
Functions ¶
func NewAnteHandler ¶
func NewAnteHandler( accountKeeper ante.AccountKeeper, bankKeeper authtypes.BankKeeper, blobKeeper blob.Keeper, feegrantKeeper ante.FeegrantKeeper, signModeHandler *txsigning.HandlerMap, sigGasConsumer ante.SignatureVerificationGasConsumer, channelKeeper *ibckeeper.Keeper, minfeeKeeper *minfeekeeper.Keeper, circuitkeeper *circuitkeeper.Keeper, paramFilters map[string]ParamFilter, ) sdk.AnteHandler
func ValidateTxFee ¶
func ValidateTxFee(ctx sdk.Context, tx sdk.Tx, minfeeKeeper *minfeekeeper.Keeper) (sdk.Coins, int64, error)
ValidateTxFee implements default fee validation logic for transactions. It ensures that the provided transaction fee meets a minimum threshold for the node as well as a network minimum threshold and computes the tx priority based on the gas price.
func ValidateTxFeeWrapper ¶
func ValidateTxFeeWrapper(minfeeKeeper *minfeekeeper.Keeper) ante.TxFeeChecker
ValidateTxFeeWrapper enables the passing of an additional minfeeKeeper parameter in ante.NewDeductFeeDecorator whilst still satisfying the ante.TxFeeChecker type.
Types ¶
type ConsumeTxSizeGasDecorator ¶
type ConsumeTxSizeGasDecorator struct {
// contains filtered or unexported fields
}
ConsumeTxSizeGasDecorator will take in parameters and consume gas proportional to the size of tx before calling next AnteHandler. Note, the gas costs will be slightly overestimated due to the fact that any given signing account may need to be retrieved from state.
CONTRACT: If simulate=true, then signatures must either be completely filled in or empty. CONTRACT: To use this decorator, signatures of transaction must be represented as legacytx.StdSignature otherwise simulate mode will incorrectly estimate gas cost.
The code was copied from celestia's fork of the cosmos-sdk: https://github.com/celestiaorg/cosmos-sdk/blob/release/v0.46.x-celestia/x/auth/ante/basic.go In app versions v2 and below, the txSizeCostPerByte used for gas cost estimation is taken from the auth module. In app v3 and above, the versioned constant appconsts.TxSizeCostPerByte is used. In app v4 getting the account has been removed, which is in line with the cosmos-sdk v0.50.x.
func NewConsumeGasForTxSizeDecorator ¶
func NewConsumeGasForTxSizeDecorator(ak ante.AccountKeeper) ConsumeTxSizeGasDecorator
func (ConsumeTxSizeGasDecorator) AnteHandle ¶
type HandlePanicDecorator ¶
type HandlePanicDecorator struct{}
HandlePanicDecorator that catches panics and wraps them in the transaction that caused the panic
func NewHandlePanicDecorator ¶
func NewHandlePanicDecorator() HandlePanicDecorator
func (HandlePanicDecorator) AnteHandle ¶
type MsgExecDecorator ¶
type MsgExecDecorator struct{}
MsgExecDecorator ensures that the tx does not contain a MsgExec with a nested MsgExec or MsgPayForBlobs.
func NewMsgExecDecorator ¶
func NewMsgExecDecorator() *MsgExecDecorator
func (MsgExecDecorator) AnteHandle ¶
type ParamFilter ¶
ParamFilter is a type alias for a filtering function which accepts an sdk.Msg and returns an error.
type ParamFilterDecorator ¶
type ParamFilterDecorator struct {
// contains filtered or unexported fields
}
ParamFilterDecorator checks tx msgs for gov.MsgSubmitProposal and authz.MsgExec and ensures that param updates within these conform to the rules defined in paramFilters. ParamFilters are keyed by MsgTypeURL. NOTE: This replaces the param filter governance proposal handler from v3 and earlier.
func NewParamFilterDecorator ¶
func NewParamFilterDecorator(paramFilters map[string]ParamFilter) ParamFilterDecorator
NewParamFilterDecorator creates and returns a new ParamFilterDecorator to be used in the ante handler chain.
func (ParamFilterDecorator) AnteHandle ¶
func (d ParamFilterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)
AnteHandle implements the AnteHandler interface. It ensures that MsgSubmitProposal has at least one message. It ensures params are filtered within messages.