ante

package
v5.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinedFeeRequirement

func CombinedFeeRequirement(globalFees, minGasPrices sdk.Coins) (sdk.Coins, error)

CombinedFeeRequirement returns the global fee and min_gas_price combined and sorted. Both globalFees and minGasPrices must be valid, but CombinedFeeRequirement does not validate them, so it may return 0denom. if globalfee is empty, CombinedFeeRequirement return sdk.Coins{}

func ContainZeroCoins

func ContainZeroCoins(coins sdk.Coins) bool

ContainZeroCoins returns true if the given coins are empty or contain zero coins, Note that the coins denoms must be validated, see sdk.ValidateDenom

func Find

func Find(coins sdk.Coins, denom string) (bool, sdk.Coin)

Find replaces the functionality of Coins.Find from SDK v0.46.x

func GetMinGasPrice

func GetMinGasPrice(ctx sdk.Context, gasLimit int64) sdk.Coins

GetMinGasPrice returns a nodes's local minimum gas prices fees given a gas limit

Types

type FeeDecorator

type FeeDecorator struct {
	GlobalMinFeeKeeper globalfeekeeper.Keeper
}

func NewFeeDecorator

func NewFeeDecorator(keeper globalfeekeeper.Keeper) FeeDecorator

func (FeeDecorator) AnteHandle

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

AnteHandle implements the AnteDecorator interface

func (FeeDecorator) ContainsOnlyBypassMinFeeMsgs

func (mfd FeeDecorator) ContainsOnlyBypassMinFeeMsgs(ctx sdk.Context, msgs []sdk.Msg) bool

func (FeeDecorator) GetBypassMsgTypes

func (mfd FeeDecorator) GetBypassMsgTypes(ctx sdk.Context) []string

func (FeeDecorator) GetGlobalFee

func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) sdk.Coins

GetGlobalFee returns the global fees for a given fee tx's gas (might also return 0denom if globalMinGasPrice is 0) sorted in ascending order. Note that ParamStoreKeyMinGasPrices type requires coins sorted.

func (FeeDecorator) GetMaxTotalBypassMinFeeMsgGasUsage

func (mfd FeeDecorator) GetMaxTotalBypassMinFeeMsgGasUsage(ctx sdk.Context) uint64

func (FeeDecorator) GetTxFeeRequired

func (mfd FeeDecorator) GetTxFeeRequired(ctx sdk.Context, tx sdk.FeeTx) (sdk.Coins, error)

GetTxFeeRequired returns the required fees for the given FeeTx. In case the FeeTx's mode is CheckTx, it returns the combined requirements of local min gas prices and global fees. Otherwise, in DeliverTx, it returns the global fee.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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