refactor!: instantiate client.TxConfig once for simulations (#15875)

This commit is contained in:
Mark Rushakoff
2023-04-19 12:47:27 +00:00
committed by GitHub
parent aa683247d5
commit 7b10ada768
35 changed files with 481 additions and 218 deletions
+2
View File
@@ -7,6 +7,7 @@ import (
"time"
sdkmath "cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/simulation"
)
@@ -142,6 +143,7 @@ func (sm *SimulationManager) WeightedOperations(simState SimulationState) []simu
type SimulationState struct {
AppParams simulation.AppParams
Cdc codec.JSONCodec // application codec
TxConfig client.TxConfig // Shared TxConfig; this is expensive to create and stateless, so create it once up front.
Rand *rand.Rand // random number
GenState map[string]json.RawMessage // genesis state
Accounts []simulation.Account // simulation accounts