Documentation ¶
Index ¶
- Variables
- func Dec(denom, amount string) sdk.DecCoin
- func DecF(denom string, amount float64) sdk.DecCoin
- func New(denom string, amount int64) sdk.Coin
- func Normalize(cs sdk.Coins) sdk.Coins
- func UmeeDec(amount string) sdk.DecCoin
- func Utoken(denom string, amount int64) sdk.Coin
- func UtokenDec(denom string, amount string) sdk.DecCoin
- func UtokenDecF(denom string, amount float64) sdk.DecCoin
- func Zero(denom string) sdk.Coin
- func ZeroDec(denom string) sdk.DecCoin
- type DecBld
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // the uToken denom "u/uumee" UumeeDenom = leveragetypes.ToUTokenDenom(umee) // 1uumee Coin Umee1 = New(umee, 1) // 10_000uumee Coin Umee10k = New(umee, 10_000) // 1u/uumee Coin UUmee1 = Utoken(umee, 1) // Xuumee DecCoin Umee0dec = DecF(umee, 0) Umee1dec = DecF(umee, 1) Atom = "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9" // 1<atom ibc denom> Coin Atom1 = New(Atom, 1) // 1u/<atom ibc denom> Coin UAtom1 = Utoken(Atom, 1) Atom1dec = DecF(Atom, 1) // 1.25<atom ibc denom> DecCoin Atom1_25dec = DecF(Atom, 1.25) // a test denom Dollar = "dollar" )
common coins used in tests
Functions ¶
func DecF ¶
DecF creates a DecCoin based on float amount. MUST not be used in production code. Can only be used in tests.
func UtokenDecF ¶
UtokenDecF creates a uToken DecCoin.
Types ¶
type DecBld ¶
TODO: add unit tests for `util/coin/math.go` DecBld is a Builder pattern for dec coin
func (*DecBld) ScaleStr ¶
Scale scales dec coin by given factor provided as string. Panics if f is not a correct decimal number.
func (*DecBld) ToDecCoins ¶
ToCoin converts DecCoin to sdk.DecCoins
Click to show internal directories.
Click to hide internal directories.