Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
parent
cabde7b191
commit
5d6b2c2a4a
@ -17,7 +17,6 @@ integrated with the application `SimulationManager`.
|
||||
* [Simulation package](#simulation-package)
|
||||
* [Store decoders](#store-decoders)
|
||||
* [Randomized genesis](#randomized-genesis)
|
||||
* [Randomized parameter changes](#randomized-parameter-changes)
|
||||
* [Random weighted operations](#random-weighted-operations)
|
||||
* [Random proposal contents](#random-proposal-contents)
|
||||
* [Registering simulation functions](#registering-simulation-functions)
|
||||
@ -68,7 +67,7 @@ Operations on the simulation are simulated using the full [transaction cycle](..
|
||||
Shown below is how weights are set:
|
||||
|
||||
```go reference
|
||||
https://github.com/cosmos/cosmos-sdk/blob/v/x/staking/simulation/operations.go#L19-L86
|
||||
https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/x/staking/simulation/operations.go#L19-L86
|
||||
```
|
||||
|
||||
As you can see, the weights are predefined in this case. Options exist to override this behavior with different weights. One option is to use `*rand.Rand` to define a random weight for the operation, or you can inject your own predefined weights.
|
||||
@ -76,7 +75,7 @@ As you can see, the weights are predefined in this case. Options exist to overri
|
||||
Here is how one can override the above package `simappparams`.
|
||||
|
||||
```go reference
|
||||
https://github.com/cosmos/cosmos-sdk/blob/v/Makefile#L293-L299
|
||||
https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/Makefile#L293-L299
|
||||
```
|
||||
|
||||
For the last test a tool called [runsim](https://github.com/cosmos/tools/tree/master/cmd/runsim) is used, this is used to parallelize go test instances, provide info to Github and slack integrations to provide information to your team on how the simulations are running.
|
||||
@ -92,7 +91,7 @@ them to be used on the parameters.
|
||||
Now that all the required functions are defined, we need to integrate them into the module pattern within the `module.go`:
|
||||
|
||||
```go reference
|
||||
https://github.com/cosmos/cosmos-sdk/blob/v/x/distribution/module.go#L180-L203
|
||||
https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/x/distribution/module.go#L180-L203
|
||||
```
|
||||
|
||||
## App Simulator manager
|
||||
|
||||
Loading…
Reference in New Issue
Block a user