Documentation ¶
Index ¶
- Variables
- func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simtypes.AppStateFn
- func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account)
- func AppStateRandomizedFn(simManager *module.SimulationManager, r *rand.Rand, cdc codec.JSONCodec, ...) (json.RawMessage, []simtypes.Account)
- func CheckExportSimulation(quicksilver *app.Quicksilver, config simtypes.Config, params simtypes.Params) error
- func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (simLog string)
- func NewConfigFromFlags() simulation.Config
- func Operations(quicksilver *app.Quicksilver, cdc codec.JSONCodec, config simtypes.Config) []simtypes.WeightedOperation
- func PrintStats(db dbm.DB)
- func SetupSimulation(dirPrefix, dbName string) (simtypes.Config, dbm.DB, string, log.Logger, bool, error)
- func SimulatorFlags()
Constants ¶
This section is empty.
Variables ¶
var ( FlagGenesisFileValue string FlagParamsFileValue string FlagExportParamsPathValue string FlagExportParamsHeightValue int FlagExportStatePathValue string FlagExportStatsPathValue string FlagSeedValue int64 FlagInitialBlockHeightValue int FlagNumBlocksValue int FlagBlockSizeValue int FlagLeanValue bool FlagCommitValue bool FlagOnOperationValue bool // TODO: Remove in favor of binary search for invariant violation FlagAllInvariantsValue bool FlagEnabledValue bool FlagVerboseValue bool FlagPeriodValue uint FlagGenesisTimeValue int64 )
List of available flags for the simulator.
Functions ¶
func AppStateFn ¶
func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simtypes.AppStateFn
AppStateFn returns the initial application state using a genesis or the simulation parameters. It panics if the user provides files for both of them. If a file is not given for the genesis or the sim params, it creates a randomized one.
func AppStateFromGenesisFileFn ¶
func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account)
AppStateFromGenesisFileFn util function to generate the genesis AppState from a genesis.json file.
func AppStateRandomizedFn ¶
func AppStateRandomizedFn( simManager *module.SimulationManager, r *rand.Rand, cdc codec.JSONCodec, accs []simtypes.Account, genesisTimestamp time.Time, appParams simtypes.AppParams, ) (json.RawMessage, []simtypes.Account)
AppStateRandomizedFn creates calls each module's GenesisState generator function and creates the simulation params.
func CheckExportSimulation ¶
func CheckExportSimulation( quicksilver *app.Quicksilver, config simtypes.Config, params simtypes.Params, ) error
CheckExportSimulation exports the app state and simulation parameters to JSON if the export paths are defined.
func GetSimulationLog ¶
func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (simLog string)
GetSimulationLog unmarshals the KVPair's Value to the corresponding type based on each module store key and the prefix bytes of the KVPair's key.
func NewConfigFromFlags ¶
func NewConfigFromFlags() simulation.Config
NewConfigFromFlags creates a simulation from the retrieved values of the flags.
func Operations ¶
func Operations(quicksilver *app.Quicksilver, cdc codec.JSONCodec, config simtypes.Config) []simtypes.WeightedOperation
Operations retrieves the simulation params from the provided file path and returns all the modules weighted operations.
func PrintStats ¶
PrintStats prints the corresponding statistics from the app DB.
func SetupSimulation ¶
func SetupSimulation(dirPrefix, dbName string) (simtypes.Config, dbm.DB, string, log.Logger, bool, error)
SetupSimulation creates the config, db (levelDB), temporary directory and logger for the simulation tests. If `FlagEnabledValue` is false it skips the current test. Returns error on an invalid db instantiation or temp dir creation.
func SimulatorFlags ¶
func SimulatorFlags()
GetSimulatorFlags gets the values of all the available simulation flags.
Types ¶
This section is empty.