Documentation ¶
Index ¶
- func CombinedFeeRequirement(globalFees, minGasPrices sdk.Coins) sdk.Coins
- func ContainZeroCoins(coins sdk.Coins) bool
- func Find(coins sdk.Coins, denom string) (bool, sdk.Coin)
- func GetMinGasPrice(ctx sdk.Context, gasLimit int64) sdk.Coins
- func PrettyPrint(coins sdk.Coins) string
- type FeeDecorator
- func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)
- func (mfd FeeDecorator) ContainsOnlyBypassMinFeeMsgs(msgs []sdk.Msg) bool
- func (mfd FeeDecorator) DefaultZeroGlobalFee(ctx sdk.Context) ([]sdk.DecCoin, error)
- func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) (sdk.Coins, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombinedFeeRequirement ¶
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 ¶
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 GetMinGasPrice ¶
GetMinGasPrice returns the validator's minimum gas prices fees given a gas limit
func PrettyPrint ¶
PrettyPrint returns a pretty printed representation of the given coins.
Types ¶
type FeeDecorator ¶
type FeeDecorator struct { BypassMinFeeMsgTypes []string GlobalFeeKeeper globalfeekeeper.Keeper StakingKeeper stakingkeeper.Keeper MaxTotalBypassMinFeeMsgGasUsage uint64 IsFeePayTx *bool }
func NewFeeDecorator ¶
func NewFeeDecorator(bypassMsgTypes []string, gfk globalfeekeeper.Keeper, sk stakingkeeper.Keeper, maxTotalBypassMinFeeMsgGasUsage uint64, isFeePayTx *bool) 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(msgs []sdk.Msg) bool
ContainsOnlyBypassMinFeeMsgs returns true if all the given msgs type are listed in the BypassMinFeeMsgTypes of the FeeDecorator.
func (FeeDecorator) DefaultZeroGlobalFee ¶
func (FeeDecorator) GetGlobalFee ¶
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.