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

Function BuildSimulationOperations

testutil/sims/simulation_helpers.go:60–83  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

58// BuildSimulationOperations retrieves the simulation params from the provided file path
59// and returns all the module-weighted operations
60func 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.

Callers 1

SimulationOperationsFunction · 0.85

Calls 2

SimulationManagerMethod · 0.80
WeightedOperationsMethod · 0.45

Tested by

no test coverage detected