ante

package
v10.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinedFeeRequirement

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

CombinedFeeRequirement will combine the global fee and min_gas_price. Both globalFees and minGasPrices must be valid, but CombinedFeeRequirement does not validate them, so it may return 0denom.

func ContainZeroCoins

func ContainZeroCoins(coinsB sdk.Coins) bool

return true if coinsB is empty or contains zero coins, CoinsB must be validate coins !!!

func DenomsSubsetOfIncludingZero

func DenomsSubsetOfIncludingZero(coins, coinsB sdk.Coins) bool

DenomsSubsetOfIncludingZero and IsAnyGTEIncludingZero are similar to DenomsSubsetOf and IsAnyGTE in sdk. Since we allow zero coins in global fee(zero coins means the chain does not want to set a global fee but still want to define the fee's denom)

overwrite DenomsSubsetOfIncludingZero from sdk, to allow zero amt coins in superset. e.g. 1stake is DenomsSubsetOfIncludingZero 0stake. [] is the DenomsSubsetOfIncludingZero of [0stake] but not [1stake]. DenomsSubsetOfIncludingZero returns true if coins's denoms is subset of coinsB's denoms. if coins is empty set, empty set is any sets' subset

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 GetTxPriority

func GetTxPriority(fee sdk.Coins) int64

getTxPriority returns a naive tx priority based on the amount of the smallest denomination of the fee provided in a transaction.

func IsAnyGTEIncludingZero

func IsAnyGTEIncludingZero(coins, coinsB sdk.Coins) bool

overwrite the IsAnyGTEIncludingZero from sdk to allow zero coins in coins and coinsB. IsAnyGTEIncludingZero returns true if coins contain at least one denom that is present at a greater or equal amount in coinsB; it returns false otherwise. if CoinsB is emptyset, no coins sets are IsAnyGTEIncludingZero coinsB unless coins is also empty set. NOTE: IsAnyGTEIncludingZero operates under the invariant that both coin sets are sorted by denoms. contract !!!! coins must be DenomsSubsetOfIncludingZero of coinsB

Types

type FeeDecorator

type FeeDecorator struct {
	BypassMinFeeMsgTypes       []string
	GlobalMinFee               globalfee.ParamSource
	StakingSubspace            paramtypes.Subspace
	MaxBypassMinFeeMsgGasUsage uint64
}

func NewFeeDecorator

func NewFeeDecorator(bypassMsgTypes []string, globalfeeSubspace, stakingSubspace paramtypes.Subspace, maxBypassMinFeeMsgGasUsage uint64) FeeDecorator

func (FeeDecorator) AnteHandle

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

func (FeeDecorator) DefaultZeroGlobalFee

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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