utils

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBalance

func GetBalance(ctx context.Context, table api.BatchBalanceTable, addr types.AccAddress, key uint64) (*api.BatchBalance, error)

GetBalance gets the balance from the account, returning a default, zero value balance if no balance is found. NOTE: the default value is not inserted into the balance table in the `not found` case. Calling Update when the default value is returned will cause an error. The `Save` method should be used when dealing with balances from this function.

func GetCreditTypeFromBatchDenom

func GetCreditTypeFromBatchDenom(ctx context.Context, store api.StateStore, denom string) (*api.CreditType, error)

GetCreditTypeFromBatchDenom extracts the classID from a batch denom string, then retrieves it from the params.

func GetNonNegativeFixedDecs

func GetNonNegativeFixedDecs(precision uint32, decimals ...string) ([]math.Dec, error)

GetNonNegativeFixedDecs takes an arbitrary amount of decimal strings, and returns their corresponding fixed decimals in a slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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