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 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 PP(data interface{})
- func ParseCoin(s string) sdk.Coin
- func ParseCoins(s string) sdk.Coins
- func ParseDec(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 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 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.