Documentation ¶
Overview ¶
Package sample provides methods to initialize sample object of various types for test purposes
Index ¶
- Constants
- func AccAddress(r *rand.Rand) sdk.AccAddress
- func AccountRemoval(address string) *launch.AccountRemoval
- func Address(r *rand.Rand) string
- func AllRequestContents(r *rand.Rand, launchID uint64, genesis, vesting, validator string) []launch.RequestContent
- func AlphaString(r *rand.Rand, n int) string
- func Bool(r *rand.Rand) bool
- func Bytes(r *rand.Rand, n int) []byte
- func Chain(r *rand.Rand, id, coordinatorID uint64) launch.Chain
- 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 ConsensusState(nb int) types.ConsensusState
- func Coordinator(r *rand.Rand, address string) profile.Coordinator
- func CoordinatorDescription(r *rand.Rand) profile.CoordinatorDescription
- func CustomShareVestingOptions(r *rand.Rand, shares project.Shares) project.ShareVestingOptions
- 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 GenesisAccount(r *rand.Rand, launchID uint64, address string) launch.GenesisAccount
- func GenesisAccountContent(r *rand.Rand, launchID uint64, address string) launch.RequestContent
- func GenesisChainID(r *rand.Rand) string
- func GenesisHash(r *rand.Rand) string
- func GenesisValidator(r *rand.Rand, launchID uint64, address string) launch.GenesisValidator
- func GenesisValidatorPeer(r *rand.Rand) launch.Peer
- func Int(r *rand.Rand) sdkmath.Int
- func InterfaceRegistry() codectypes.InterfaceRegistry
- func LaunchGenesisState(r *rand.Rand, addresses ...string) launch.GenesisState
- func LaunchParams(r *rand.Rand) launch.Params
- func MainnetAccount(r *rand.Rand, projectID uint64, address string) project.MainnetAccount
- func Metadata(r *rand.Rand, len uint64) []byte
- func Mission(r *rand.Rand) claim.Mission
- func MonitoringcParams() monitoringc.Params
- func MonitoringpParams(r *rand.Rand) monitoringp.Params
- func MsgCreateChain(r *rand.Rand, coordAddress, genesisURL string, hasProject bool, ...) launch.MsgCreateChain
- func MsgCreateCoordinator(coordAddress string) profile.MsgCreateCoordinator
- func MsgCreateFixedAuction(r *rand.Rand, auctioneer string, sellingCoin sdk.Coin, ...) *fundraisingtypes.MsgCreateFixedPriceAuction
- func MsgCreateProject(r *rand.Rand, coordAddr string) project.MsgCreateProject
- func MsgDisableCoordinator(coordAddress string) profile.MsgDisableCoordinator
- func MsgEditChain(r *rand.Rand, coordAddress string, launchID uint64, setProjectID bool, ...) launch.MsgEditChain
- func MsgRevertLaunch(coordinator string, launchID uint64) launch.MsgRevertLaunch
- func MsgSendRequestWithAddAccount(r *rand.Rand, creator, address string, launchID uint64) launch.MsgSendRequest
- func MsgSendRequestWithAddValidator(r *rand.Rand, creator, address string, launchID uint64) launch.MsgSendRequest
- func MsgSendRequestWithAddVestingAccount(r *rand.Rand, creator, address string, launchID uint64) launch.MsgSendRequest
- func MsgSendRequestWithParamChange(r *rand.Rand, creator string, launchID uint64) launch.MsgSendRequest
- func MsgSendRequestWithRemoveAccount(creator, address string, launchID uint64) launch.MsgSendRequest
- func MsgSendRequestWithRemoveValidator(creator, validatorAddr string, launchID uint64) launch.MsgSendRequest
- func MsgSettleRequest(coordinator string, launchID, requestID uint64, approve bool) launch.MsgSettleRequest
- func MsgTriggerLaunch(r *rand.Rand, coordinator string, launchID uint64) launch.MsgTriggerLaunch
- func MsgUpdateCoordinatorDescription(coordAddress string) profile.MsgUpdateCoordinatorDescription
- func MsgUpdateLaunchInformation(r *rand.Rand, coordAddress string, launchID uint64, ...) launch.MsgUpdateLaunchInformation
- func NonAlphaString(r *rand.Rand, n int) string
- func OperatorAddress(r *rand.Rand) string
- func ParamChange(r *rand.Rand, launchID uint64) launch.ParamChange
- func ParticipationGenesisState(r *rand.Rand) participation.GenesisState
- func ParticipationGenesisStateWithAllocations(r *rand.Rand) participation.GenesisState
- func ParticipationParams(r *rand.Rand) participation.Params
- func ProfileGenesisState(r *rand.Rand, addresses ...string) profile.GenesisState
- func Project(r *rand.Rand, id uint64) project.Project
- func ProjectGenesisState(r *rand.Rand) project.GenesisState
- func ProjectGenesisStateWithAccounts(r *rand.Rand) project.GenesisState
- func ProjectName(r *rand.Rand) string
- func ProjectParams(r *rand.Rand) project.Params
- func PubKey(r *rand.Rand) crypto.PubKey
- func Rand() *rand.Rand
- func Request(r *rand.Rand, launchID uint64, address string) launch.Request
- func RequestContent(r *rand.Rand, launchID uint64) launch.RequestContent
- func RequestWithContent(r *rand.Rand, launchID uint64, content launch.RequestContent) launch.Request
- func RequestWithContentAndCreator(r *rand.Rand, launchID uint64, content launch.RequestContent, creator string) launch.Request
- func RewardPool(r *rand.Rand, launchID uint64) reward.RewardPool
- func RewardPoolWithCoinsRangeAmount(r *rand.Rand, launchID uint64, denom1, denom2, denom3 string, min, max int64) reward.RewardPool
- func ShareVestingOptions(r *rand.Rand) project.ShareVestingOptions
- func Shares(r *rand.Rand) project.Shares
- func SimAccounts() (accounts []simtypes.Account)
- func SpecialAllocations(r *rand.Rand) project.SpecialAllocations
- func String(r *rand.Rand, n int) string
- func Time(r *rand.Rand) time.Time
- func TotalSupply(r *rand.Rand) sdk.Coins
- func Uint64(r *rand.Rand) uint64
- func ValAddress(r *rand.Rand) sdk.ValAddress
- func Validator(t testing.TB, r *rand.Rand) stakingtypes.Validator
- func ValidatorDescription(desc string) profile.ValidatorDescription
- func ValidatorSet(nb int) types.ValidatorSet
- func VestingAccount(r *rand.Rand, launchID uint64, address string) launch.VestingAccount
- func VestingOptions(r *rand.Rand) launch.VestingOptions
- func Voucher(r *rand.Rand, projectID uint64) sdk.Coin
- func Vouchers(r *rand.Rand, projectID uint64) sdk.Coins
- func ZeroTime() time.Time
Constants ¶
const ConsensusStateNb = 2
Variables ¶
This section is empty.
Functions ¶
func AccAddress ¶
func AccAddress(r *rand.Rand) sdk.AccAddress
AccAddress returns a sample account address
func AccountRemoval ¶
func AccountRemoval(address string) *launch.AccountRemoval
AccountRemoval returns a sample AccountRemoval
func AllRequestContents ¶
func AllRequestContents(r *rand.Rand, launchID uint64, genesis, vesting, validator string) []launch.RequestContent
AllRequestContents creates all contents types for request
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 ConsensusState ¶
func ConsensusState(nb int) types.ConsensusState
ConsensusState returns a sample ConsensusState nb allows to select a consensus state with a matching validator set consensus state 0 match with validator set 0 nb is 0 if above max value
func Coordinator ¶
func Coordinator(r *rand.Rand, address string) profile.Coordinator
Coordinator returns a sample Coordinator
func CoordinatorDescription ¶
func CoordinatorDescription(r *rand.Rand) profile.CoordinatorDescription
CoordinatorDescription returns a sample CoordinatorDescription
func CustomShareVestingOptions ¶
CustomShareVestingOptions returns a sample ShareVestingOptions with shares
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 GenesisAccount ¶
GenesisAccount returns a sample GenesisAccount
func GenesisAccountContent ¶
GenesisAccountContent returns a sample GenesisAccount request content
func GenesisChainID ¶
GenesisChainID returns a sample chain id
func GenesisHash ¶
GenesisHash returns a sample sha256 hash of custom genesis for GenesisURL
func GenesisValidator ¶
GenesisValidator returns a sample GenesisValidator
func InterfaceRegistry ¶
func InterfaceRegistry() codectypes.InterfaceRegistry
func LaunchGenesisState ¶
func LaunchGenesisState(r *rand.Rand, addresses ...string) launch.GenesisState
LaunchGenesisState returns a sample genesis state for the launch module
func LaunchParams ¶
LaunchParams returns a sample of params for the launch module
func MainnetAccount ¶
MainnetAccount returns a sample MainnetAccount
func MonitoringcParams ¶
func MonitoringcParams() monitoringc.Params
MonitoringcParams returns a sample of params for the monitoring consumer module
func MonitoringpParams ¶
func MonitoringpParams(r *rand.Rand) monitoringp.Params
MonitoringpParams returns a sample of params for the monitoring provider module
func MsgCreateChain ¶
func MsgCreateChain(r *rand.Rand, coordAddress, genesisURL string, hasProject bool, projectID uint64) launch.MsgCreateChain
MsgCreateChain returns a sample MsgCreateChain
func MsgCreateCoordinator ¶
func MsgCreateCoordinator(coordAddress string) profile.MsgCreateCoordinator
MsgCreateCoordinator returns a sample MsgCreateCoordinator
func MsgCreateFixedAuction ¶
func MsgCreateFixedAuction( r *rand.Rand, auctioneer string, sellingCoin sdk.Coin, startTime, endTime time.Time, ) *fundraisingtypes.MsgCreateFixedPriceAuction
MsgCreateFixedAuction create a sample MsgCreateFixedAuction message
func MsgCreateProject ¶
func MsgCreateProject(r *rand.Rand, coordAddr string) project.MsgCreateProject
MsgCreateProject returns a sample MsgCreateProject
func MsgDisableCoordinator ¶
func MsgDisableCoordinator(coordAddress string) profile.MsgDisableCoordinator
MsgDisableCoordinator returns a sample MsgDisableCoordinator
func MsgEditChain ¶
func MsgEditChain( r *rand.Rand, coordAddress string, launchID uint64, setProjectID bool, projectID uint64, modifyMetadata bool, ) launch.MsgEditChain
MsgEditChain returns a sample MsgEditChain
func MsgRevertLaunch ¶
func MsgRevertLaunch(coordinator string, launchID uint64) launch.MsgRevertLaunch
MsgRevertLaunch returns a sample MsgRevertLaunch
func MsgSendRequestWithAddAccount ¶
func MsgSendRequestWithAddAccount(r *rand.Rand, creator, address string, launchID uint64) launch.MsgSendRequest
MsgSendRequestWithAddAccount returns a sample MsgSendRequest with AddAccount request content
func MsgSendRequestWithAddValidator ¶
func MsgSendRequestWithAddValidator(r *rand.Rand, creator, address string, launchID uint64) launch.MsgSendRequest
MsgSendRequestWithAddValidator returns a sample MsgSendRequest with AddValidator request content
func MsgSendRequestWithAddVestingAccount ¶
func MsgSendRequestWithAddVestingAccount(r *rand.Rand, creator, address string, launchID uint64) launch.MsgSendRequest
MsgSendRequestWithAddVestingAccount returns a sample MsgSendRequest with AddVestingAccount request content
func MsgSendRequestWithParamChange ¶
func MsgSendRequestWithParamChange(r *rand.Rand, creator string, launchID uint64) launch.MsgSendRequest
MsgSendRequestWithParamChange returns a sample MsgSendRequest with ParamChange request content
func MsgSendRequestWithRemoveAccount ¶
func MsgSendRequestWithRemoveAccount(creator, address string, launchID uint64) launch.MsgSendRequest
MsgSendRequestWithRemoveAccount returns a sample MsgSendRequest with RemoveAccount request content
func MsgSendRequestWithRemoveValidator ¶
func MsgSendRequestWithRemoveValidator(creator, validatorAddr string, launchID uint64) launch.MsgSendRequest
MsgSendRequestWithRemoveValidator returns a sample MsgSendRequest with RemoveValidator request content
func MsgSettleRequest ¶
func MsgSettleRequest(coordinator string, launchID, requestID uint64, approve bool) launch.MsgSettleRequest
MsgSettleRequest returns a sample MsgSettleRequest
func MsgTriggerLaunch ¶
MsgTriggerLaunch returns a sample MsgTriggerLaunch
func MsgUpdateCoordinatorDescription ¶
func MsgUpdateCoordinatorDescription(coordAddress string) profile.MsgUpdateCoordinatorDescription
MsgUpdateCoordinatorDescription returns a sample MsgUpdateCoordinatorDescription
func MsgUpdateLaunchInformation ¶
func MsgUpdateLaunchInformation( r *rand.Rand, coordAddress string, launchID uint64, modifyGenesisChainID, modifySource, modifyInitialGenesis, genesisURL bool, ) launch.MsgUpdateLaunchInformation
MsgUpdateLaunchInformation returns a sample MsgUpdateLaunchInformation
func NonAlphaString ¶
NonAlphaString returns a random string with non alpha char of length n
func OperatorAddress ¶
OperatorAddress returns a sample string validator operator address
func ParamChange ¶
func ParamChange(r *rand.Rand, launchID uint64) launch.ParamChange
ParamChange returns a sample ParamChange
func ParticipationGenesisState ¶
func ParticipationGenesisState(r *rand.Rand) participation.GenesisState
ParticipationGenesisState returns a sample genesis state for the participation module
func ParticipationGenesisStateWithAllocations ¶
func ParticipationGenesisStateWithAllocations(r *rand.Rand) participation.GenesisState
ParticipationGenesisStateWithAllocations returns a sample genesis state for the participation module with some sample allocations
func ParticipationParams ¶
func ParticipationParams(r *rand.Rand) participation.Params
ParticipationParams returns a sample of params for the participation module
func ProfileGenesisState ¶
func ProfileGenesisState(r *rand.Rand, addresses ...string) profile.GenesisState
ProfileGenesisState returns a sample genesis state for the profile module
func ProjectGenesisState ¶
func ProjectGenesisState(r *rand.Rand) project.GenesisState
ProjectGenesisState returns a sample genesis state for the project module
func ProjectGenesisStateWithAccounts ¶
func ProjectGenesisStateWithAccounts(r *rand.Rand) project.GenesisState
ProjectGenesisStateWithAccounts returns a sample genesis state for the project module that includes accounts
func ProjectParams ¶
ProjectParams returns a sample of params for the project module
func RequestContent ¶
func RequestContent(r *rand.Rand, launchID uint64) launch.RequestContent
RequestContent returns a request content with Genesis Account
func RequestWithContent ¶
func RequestWithContent(r *rand.Rand, launchID uint64, content launch.RequestContent) launch.Request
RequestWithContent creates a launch request object with launch id and content
func RequestWithContentAndCreator ¶
func RequestWithContentAndCreator(r *rand.Rand, launchID uint64, content launch.RequestContent, creator string) launch.Request
RequestWithContentAndCreator creates a launch request object with launch id and content and creator
func RewardPool ¶
func RewardPool(r *rand.Rand, launchID uint64) reward.RewardPool
RewardPool returns a sample RewardPool
func RewardPoolWithCoinsRangeAmount ¶
func RewardPoolWithCoinsRangeAmount(r *rand.Rand, launchID uint64, denom1, denom2, denom3 string, min, max int64) reward.RewardPool
RewardPoolWithCoinsRangeAmount returns a sample RewardPool where the amount of remaining coins is a random number between provided min and max values with a set of given denoms. Initial coins will be in an amount between max and 2*max
func ShareVestingOptions ¶
func ShareVestingOptions(r *rand.Rand) project.ShareVestingOptions
ShareVestingOptions returns a sample ShareVestingOptions
func SimAccounts ¶
SimAccounts returns a sample array of account for simulation
func SpecialAllocations ¶
func SpecialAllocations(r *rand.Rand) project.SpecialAllocations
SpecialAllocations returns a sample special allocations
func TotalSupply ¶
TotalSupply returns a sample coins structure where each denom's total supply is within the default allowed supply range
func ValAddress ¶
func ValAddress(r *rand.Rand) sdk.ValAddress
ValAddress returns a sample validator operator address
func ValidatorDescription ¶
func ValidatorDescription(desc string) profile.ValidatorDescription
ValidatorDescription returns a sample ValidatorDescription
func ValidatorSet ¶
func ValidatorSet(nb int) types.ValidatorSet
ValidatorSet returns a sample ValidatorSet nb allows to select a consensus state with a matching validator set consensus state 0 match with validator set 0 nb is 0 if above max value
func VestingAccount ¶
VestingAccount returns a sample VestingAccount
func VestingOptions ¶
func VestingOptions(r *rand.Rand) launch.VestingOptions
VestingOptions returns a sample VestingOptions
Types ¶
This section is empty.