BuildSimulationOperations retrieves the simulation params from the provided file path and returns all the module-weighted operations
(app runtime.AppI, cdc codec.JSONCodec, config simtypes.Config, txConfig client.TxConfig)
| 58 | // BuildSimulationOperations retrieves the simulation params from the provided file path |
| 59 | // and returns all the module-weighted operations |
| 60 | func BuildSimulationOperations(app runtime.AppI, cdc codec.JSONCodec, config simtypes.Config, txConfig client.TxConfig) []simtypes.WeightedOperation { |
| 61 | simState := module.SimulationState{ |
| 62 | AppParams: make(simtypes.AppParams), |
| 63 | Cdc: cdc, |
| 64 | TxConfig: txConfig, |
| 65 | BondDenom: sdk.DefaultBondDenom, |
| 66 | } |
| 67 | |
| 68 | if config.ParamsFile != "" { |
| 69 | bz, err := os.ReadFile(config.ParamsFile) |
| 70 | if err != nil { |
| 71 | panic(err) |
| 72 | } |
| 73 | |
| 74 | err = json.Unmarshal(bz, &simState.AppParams) |
| 75 | if err != nil { |
| 76 | panic(err) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | simState.LegacyProposalContents = app.SimulationManager().GetProposalContents(simState) //nolint:staticcheck // we're testing the old way here |
| 81 | simState.ProposalMsgs = app.SimulationManager().GetProposalMsgs(simState) |
| 82 | return app.SimulationManager().WeightedOperations(simState) |
| 83 | } |
| 84 | |
| 85 | // CheckExportSimulation exports the app state and simulation parameters to JSON |
| 86 | // if the export paths are defined. |
no test coverage detected