Documentation ¶
Overview ¶
Package sample provides methods to initialize sample object of various types for test purposes
Index ¶
- func AccAddress(r *rand.Rand) sdk.AccAddress
- func Address(r *rand.Rand) string
- func AlphaString(r *rand.Rand, n int) string
- func Bool(r *rand.Rand) bool
- func Bytes(r *rand.Rand, n int) []byte
- func ClaimRecord(r *rand.Rand) claim.ClaimRecord
- func Codec() codec.Codec
- func Coin(r *rand.Rand) sdk.Coin
- func CoinWithRange(r *rand.Rand, min, max int64) sdk.Coin
- func CoinWithRangeAmount(r *rand.Rand, denom string, min, max int64) sdk.Coin
- func Coins(r *rand.Rand) sdk.Coins
- func CoinsWithRange(r *rand.Rand, min, max int64) sdk.Coins
- func CoinsWithRangeAmount(r *rand.Rand, denom1, denom2, denom3 string, min, max int64) sdk.Coins
- func ConsAddress(r *rand.Rand) sdk.ConsAddress
- func Delegation(t testing.TB, r *rand.Rand, addr string) stakingtypes.Delegation
- func Duration(r *rand.Rand) time.Duration
- func DurationFromRange(r *rand.Rand, min, max time.Duration) time.Duration
- func Fees(r *rand.Rand, spendableCoins sdk.Coins) (sdk.Coins, error)
- func Int(r *rand.Rand) sdkmath.Int
- func IntN(r *rand.Rand, n int64) sdkmath.Int
- func Mission(r *rand.Rand) claim.Mission
- func OperatorAddress(r *rand.Rand) string
- func PubKey(r *rand.Rand) crypto.PubKey
- func Rand() *rand.Rand
- func SimAccounts() (accounts []simtypes.Account)
- func String(r *rand.Rand, n int) string
- func Uint64(r *rand.Rand) uint64
- func ValAddress(r *rand.Rand) sdk.ValAddress
- func Validator(t testing.TB, r *rand.Rand) stakingtypes.Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccAddress ¶
func AccAddress(r *rand.Rand) sdk.AccAddress
AccAddress returns a sample account address
func AlphaString ¶
AlphaString returns a random string with lowercase alpha char of length n
func ClaimRecord ¶
func ClaimRecord(r *rand.Rand) claim.ClaimRecord
func CoinWithRange ¶
CoinWithRange returns a sample coin structure where the amount is a random number between provided min and max values with a random denom
func CoinWithRangeAmount ¶
CoinWithRangeAmount returns a sample coin structure where the amount is a random number between provided min and max values with a given denom
func CoinsWithRange ¶
CoinsWithRange returns a sample coins structure where the amount is a random number between provided min and max values
func CoinsWithRangeAmount ¶
CoinsWithRangeAmount returns a sample coins structure where the amount is a random number between provided min and max values with a set of given denoms
func ConsAddress ¶
func ConsAddress(r *rand.Rand) sdk.ConsAddress
ConsAddress returns a sample consensus address
func Delegation ¶
func Delegation(t testing.TB, r *rand.Rand, addr string) stakingtypes.Delegation
Delegation returns staking delegation with the given address
func DurationFromRange ¶
DurationFromRange returns a sample time.Duration between the min and max values provided
func Fees ¶
Fees returns a random fee by selecting a random amount of bond denomination from the account's available balance. If the user doesn't have enough funds for paying fees, it returns empty coins.
func OperatorAddress ¶
OperatorAddress returns a sample string validator operator address
func SimAccounts ¶
SimAccounts returns a sample array of account for simulation
func ValAddress ¶
func ValAddress(r *rand.Rand) sdk.ValAddress
ValAddress returns a sample validator operator address
Types ¶
This section is empty.