You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would allow removing many function arguments from operations.
SimulationContext should then have a method called GetSender() which then chooses a sender for the tx, and caches it internally to make repeated calls within an operation return the same address.
This allows for deduplicating the simAccount, _ := simtypes.RandomAcc(r, accs) in ~every simulated operation.
Summary
Many of the parameters to functions within simulation could be neatly packaged into a single simulation context struct.
I propose making a simulation Context struct as follows:
This would allow removing many function arguments from operations.
SimulationContext should then have a method called
GetSender()
which then chooses a sender for the tx, and caches it internally to make repeated calls within an operation return the same address.This allows for deduplicating the
simAccount, _ := simtypes.RandomAcc(r, accs)
in ~every simulated operation.The Operation type would then simplify from
to
Similarly
simplifies to
Problem Definition
Help mitigate Simulation code bloat, and improve readability
For Admin Use
The text was updated successfully, but these errors were encountered: