Skip to content

Commit

Permalink
fix(docs): fix simulator links (#18234)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5afaeca)
  • Loading branch information
tac0turtle authored and mergify[bot] committed Oct 24, 2023
1 parent cabde7b commit 28bc581
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/docs/build/building-modules/14-simulator.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -68,15 +67,15 @@ 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.

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.
Expand All @@ -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
Expand Down

0 comments on commit 28bc581

Please sign in to comment.