From a3ac79d0e6a94946156124d7616fa1c1389b4b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eckel?= Date: Wed, 6 Mar 2024 14:50:08 +0100 Subject: [PATCH] relocated the lib/config and config/context adjustments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Eckel --- testutil/network/network.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/testutil/network/network.go b/testutil/network/network.go index df0dfe7..f9174ad 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -572,22 +572,6 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { Address: addr, ValAddress: sdk.ValAddress(addr), } - if i == 0 { - conf := config.GetConfig() - conf.ValidatorAddress = network.Validators[0].Address.String() - // set missing validator client context values for sending txs - var output bytes.Buffer - network.Validators[0].ClientCtx.BroadcastMode = "sync" - network.Validators[0].ClientCtx.FromAddress = network.Validators[0].Address - network.Validators[0].ClientCtx.FromName = network.Validators[0].Moniker - network.Validators[0].ClientCtx.NodeURI = network.Validators[0].RPCAddress - network.Validators[0].ClientCtx.Output = &output - network.Validators[0].ClientCtx.SkipConfirm = true - - libConfig := lib.GetConfig() - libConfig.SetClientCtx(network.Validators[0].ClientCtx) - libConfig.SetRoot(network.Validators[0].ClientCtx.HomeDir) - } } err := initGenFiles(cfg, genAccounts, genBalances, genFiles) @@ -606,6 +590,22 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } l.Log("started validator", idx) + if idx == 0 { + conf := config.GetConfig() + conf.ValidatorAddress = network.Validators[0].Address.String() + // set missing validator client context values for sending txs + var output bytes.Buffer + network.Validators[0].ClientCtx.BroadcastMode = "sync" + network.Validators[0].ClientCtx.FromAddress = network.Validators[0].Address + network.Validators[0].ClientCtx.FromName = network.Validators[0].Moniker + network.Validators[0].ClientCtx.NodeURI = network.Validators[0].RPCAddress + network.Validators[0].ClientCtx.Output = &output + network.Validators[0].ClientCtx.SkipConfirm = true + + libConfig := lib.GetConfig() + libConfig.SetClientCtx(network.Validators[0].ClientCtx) + libConfig.SetRoot(network.Validators[0].ClientCtx.HomeDir) + } } height := int64(0)