Documentation ¶
Index ¶
- func CombinedFeeRequirement(globalFees, minGasPrices sdk.Coins) sdk.Coins
- func ContainZeroCoins(coinsB sdk.Coins) bool
- func DenomsSubsetOfIncludingZero(coins, coinsB sdk.Coins) bool
- func Find(coins sdk.Coins, denom string) (bool, sdk.Coin)
- func GetTxPriority(fee sdk.Coins) int64
- func IsAnyGTEIncludingZero(coins, coinsB sdk.Coins) bool
- type FeeDecorator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombinedFeeRequirement ¶
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 ¶
return true if coinsB is empty or contains zero coins, CoinsB must be validate coins !!!
func DenomsSubsetOfIncludingZero ¶
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 GetTxPriority ¶
getTxPriority returns a naive tx priority based on the amount of the smallest denomination of the fee provided in a transaction.
func IsAnyGTEIncludingZero ¶
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