ante

package
v0.3.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinedFeeRequirement

func CombinedFeeRequirement(globalFees, minGasPrices sdk.DecCoins) (sdk.DecCoins, 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 DenomsSubsetOf added in v0.3.8

func DenomsSubsetOf(a, b sdk.DecCoins) bool

func Find

func Find(coins sdk.DecCoins, denom string) (bool, sdk.DecCoin)

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

func GetMinGasPrice

func GetMinGasPrice(ctx sdk.Context) sdk.DecCoins

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

func IsAllGT added in v0.3.8

func IsAllGT(a, b sdk.DecCoins) bool

func MaxCoins

func MaxCoins(a, b sdk.DecCoins) sdk.DecCoins

Returns the largest coins given 2 sets of coins

Types

type AccountKeeper

type AccountKeeper interface {
	GetParams(ctx sdk.Context) (params types.Params)
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
	SetAccount(ctx sdk.Context, acc types.AccountI)
	GetModuleAddress(moduleName string) sdk.AccAddress
}

AccountKeeper defines the contract needed for AccountKeeper related APIs. Interface provides support to use non-sdk AccountKeeper for AnteHandler's decorators.

type FeeDecorator

type FeeDecorator struct {
	GlobalMinFeeParamSource globalfee.ParamSource
	StakingKeeperBondDenom  func(sdk.Context) string
}

func NewFeeDecorator

func NewFeeDecorator(globalfeeSubspace paramtypes.Subspace, stakingKeeperDenom func(sdk.Context) string) 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) DefaultZeroGlobalFee

func (mfd FeeDecorator) DefaultZeroGlobalFee(ctx sdk.Context) ([]sdk.DecCoin, error)

DefaultZeroGlobalFee returns a zero coin with the staking module bond denom

func (FeeDecorator) GetBypassMsgTypes

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

func (FeeDecorator) GetGlobalFee

func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context) (sdk.DecCoins, error)

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) (res uint64)

func (FeeDecorator) GetTxFeeRequired

func (mfd FeeDecorator) GetTxFeeRequired(ctx sdk.Context, tx sdk.FeeTx) (sdk.DecCoins, 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.

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.

Jump to

Keyboard shortcuts

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