utils

package
v3.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IBCRegexp = regexp.MustCompile("^ibc/[a-fA-F0-9]{64}$")

Functions

func CalculateTaxesAndPayableFee

func CalculateTaxesAndPayableFee(gasPrices sdk.DecCoins, feeCoins sdk.Coins, taxGas sdkmath.Int, totalGasRemaining sdkmath.Int) (taxes, payableFees sdk.Coins, gasRemaining sdkmath.Int)

func ComputeFeesOnGasConsumed

func ComputeFeesOnGasConsumed(tx sdk.Tx, gasPrices sdk.DecCoins, gas sdkmath.Int) (sdk.Coins, error)

func ComputeGas

func ComputeGas(gasPrices sdk.DecCoins, taxes sdk.Coins) (sdkmath.Int, error)

func ComputeTax

func ComputeTax(burnTaxRate sdk.Dec, principal sdk.Coins) sdk.Coins

computes the stability tax according to tax-rate and tax-cap

func FilterMsgAndComputeTax

func FilterMsgAndComputeTax(ctx sdk.Context, tk types.TreasuryKeeper, burnTaxRate sdk.Dec, msgs ...sdk.Msg) sdk.Coins

FilterMsgAndComputeTax computes the stability tax on messages.

func GetGasPriceByDenom

func GetGasPriceByDenom(gasPrices sdk.DecCoins, denom string) (bool, sdk.Dec)

Find returns true and Dec amount if the denom exists in gasPrices. Otherwise it returns false and a zero dec. Uses binary search. CONTRACT: gasPrices must be valid (sorted).

func IsOracleTx

func IsOracleTx(msgs []sdk.Msg) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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