Documentation ¶
Index ¶
- func DateRangeIncludes(startTime, endTime, targetTime time.Time) bool
- func DateRangesOverlap(startTimeA, endTimeA, startTimeB, endTimeB time.Time) bool
- func DecApproxEqual(a, b sdk.Dec) bool
- func DecApproxSqrt(x sdk.Dec) (r sdk.Dec)
- func GenAndDeliverTx(txCtx simulation.OperationInput, fees sdk.Coins, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
- func GenAndDeliverTxWithFees(txCtx simulation.OperationInput, gas uint64, fees sdk.Coins) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
- func GetShareValue(amount sdk.Int, ratio sdk.Dec) sdk.Int
- func IsOverflow(r interface{}) bool
- func LengthPrefixString(s string) []byte
- func PP(data interface{})
- func ParseCoin(s string) sdk.Coin
- func ParseCoins(s string) sdk.Coins
- func ParseDec(s string) sdk.Dec
- func ParseDecCoin(s string) sdk.DecCoin
- func ParseDecCoins(s string) sdk.DecCoins
- func ParseDecP(s string) *sdk.Dec
- func ParseTime(s string) time.Time
- func RandomDec(r *rand.Rand, min, max sdk.Dec) sdk.Dec
- func RandomInt(r *rand.Rand, min, max sdk.Int) sdk.Int
- func SafeMath(f, onOverflow func())
- func ShuffleSimAccounts(r *rand.Rand, accs []simtypes.Account) []simtypes.Account
- func TestAddress(addrNum int) sdk.AccAddress
- type StrIntMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DateRangeIncludes ¶
DateRangeIncludes returns true if the target date included on the start, end time range. End time is exclusive and start time is inclusive.
func DateRangesOverlap ¶
DateRangesOverlap returns true if two date ranges overlap each other. End time is exclusive and start time is inclusive.
func DecApproxEqual ¶
DecApproxEqual returns true if a and b are approximately equal, which means the diff ratio is equal or less than 0.1%.
func DecApproxSqrt ¶
DecApproxSqrt returns an approximate estimation of x's square root.
func GenAndDeliverTx ¶
func GenAndDeliverTx(txCtx simulation.OperationInput, fees sdk.Coins, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
GenAndDeliverTx generates a transactions and delivers it.
func GenAndDeliverTxWithFees ¶
func GenAndDeliverTxWithFees(txCtx simulation.OperationInput, gas uint64, fees sdk.Coins) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
GenAndDeliverTxWithFees generates a transaction with given fee and delivers it.
func GetShareValue ¶
GetShareValue multiplies with truncation by receiving int amount and decimal ratio and returns int result.
func IsOverflow ¶
func IsOverflow(r interface{}) bool
IsOverflow returns true if the panic value can be interpreted as an overflow.
func LengthPrefixString ¶
LengthPrefixString returns length-prefixed bytes representation of a string.
func ParseDecCoin ¶
ParseDecCoin parses and returns sdk.DecCoin.
func ParseDecCoins ¶
ParseDecCoins parses and returns sdk.DecCoins.
func SafeMath ¶
func SafeMath(f, onOverflow func())
SafeMath runs f in safe mode, which means that any panics occurred inside f gets caught by recover() and if the panic was an overflow, onOverflow is run. Otherwise, if the panic was not an overflow, then SafeMath will re-throw the panic.
func ShuffleSimAccounts ¶
ShuffleSimAccounts returns randomly shuffled simulation accounts.
func TestAddress ¶
func TestAddress(addrNum int) sdk.AccAddress
TestAddress returns an address for testing purpose. TestAddress returns same address when addrNum is same.