Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IterateAndCheckSum ¶
Iterate over a struct and check that the sum of its fields is 100
Types ¶
type FuzzConfig ¶
type FuzzConfig struct { Seed int RpcMode testcommon.RpcConnectionType RpcEndpoints []string MaxIterations int NumActors int EpochLength int Mode SimulationMode AlternateWeight int TestConfig *testcommon.TestConfig TransitionWeights TransitionWeights }
struct that holds the config for fuzz tests which includes slightly different config from integration/stress tests
func GetFuzzConfig ¶
func GetFuzzConfig(t *testing.T) FuzzConfig
Return a FuzzConfig struct for this fuzz session The order of priority is as follows: 1. env vars 2. test/fuzz/config.json 3. default values hard coded in this function
type FuzzConfigJson ¶
type FuzzConfigJson struct { TransitionWeights TransitionWeights `json:"transitionWeights"` Seed int `json:"seed"` RpcMode string `json:"rpcMode"` RpcUrls []string `json:"rpcUrls"` MaxIterations int `json:"maxIterations"` Mode SimulationMode `json:"mode"` AlternateWeight int `json:"alternateWeight"` NumActors int `json:"numActors"` EpochLength int `json:"epochLength"` }
struct that holds config from test/fuzz/.config.json
type SimulationMode ¶
type SimulationMode string
const ( Behave SimulationMode = "behave" Fuzz SimulationMode = "fuzz" Alternate SimulationMode = "alternate" Manual SimulationMode = "manual" )
type TransitionWeights ¶
type TransitionWeights struct { CreateTopic uint8 `json:"createTopic"` FundTopic uint8 `json:"fundTopic"` RegisterWorker uint8 `json:"registerWorker"` RegisterReputer uint8 `json:"registerReputer"` StakeAsReputer uint8 `json:"stakeAsReputer"` DelegateStake uint8 `json:"delegateStake"` CollectDelegatorRewards uint8 `json:"collectDelegatorRewards"` DoInferenceAndReputation uint8 `json:"doInferenceAndReputation"` UnregisterWorker uint8 `json:"unregisterWorker"` UnregisterReputer uint8 `json:"unregisterReputer"` UnstakeAsReputer uint8 `json:"unstakeAsReputer"` UndelegateStake uint8 `json:"undelegateStake"` CancelStakeRemoval uint8 `json:"cancelStakeRemoval"` CancelDelegateStakeRemoval uint8 `json:"cancelDelegateStakeRemoval"` }
full list of all possible transitions
func GetHardCodedTransitionWeights ¶
func GetHardCodedTransitionWeights() TransitionWeights
Return the "weight" aka, the percentage probability of each transition assuming a perfectly random distribution when picking transitions i.e. below, the probability of picking createTopic is 2%
Click to show internal directories.
Click to hide internal directories.