MCPcopy Create free account
hub / github.com/akash-network/node / SimulationOperations

Function SimulationOperations

app/sim/sim_utils.go:53–74  ·  view source on GitHub ↗

SimulationOperations retrieves the simulation params from the provided file path and returns all the modules weighted operations

(app *akash.AkashApp, cdc codec.JSONCodec, config simtypes.Config)

Source from the content-addressed store, hash-verified

51// SimulationOperations retrieves the simulation params from the provided file path
52// and returns all the modules weighted operations
53func SimulationOperations(app *akash.AkashApp, cdc codec.JSONCodec, config simtypes.Config) []simtypes.WeightedOperation {
54 simState := module.SimulationState{
55 AppParams: make(simtypes.AppParams),
56 Cdc: cdc,
57 }
58
59 if config.ParamsFile != "" {
60 bz, err := os.ReadFile(config.ParamsFile)
61 if err != nil {
62 panic(err)
63 }
64
65 err = json.Unmarshal(bz, &simState.AppParams)
66 if err != nil {
67 panic(err)
68 }
69 }
70
71 simState.LegacyProposalContents = app.SimulationManager().GetProposalContents(simState) //nolint:staticcheck
72 simState.ProposalMsgs = app.SimulationManager().GetProposalMsgs(simState)
73 return app.SimulationManager().WeightedOperations(simState)
74}
75
76// CheckExportSimulation exports the app state and simulation parameters to JSON
77// if the export paths are defined.

Callers

nothing calls this directly

Calls 2

SimulationManagerMethod · 0.80
WeightedOperationsMethod · 0.45

Tested by

no test coverage detected