From 481fd21db7dfeb2d4312692ead148ccedd2951e7 Mon Sep 17 00:00:00 2001 From: Evan Forbes <42654277+evan-forbes@users.noreply.github.com> Date: Sat, 6 Aug 2022 09:04:20 -0500 Subject: [PATCH] fix: add an option to specify a config when starting a test rpc node (#818) * fix: add an option to specify a config * export SpecificConfig * fix specific config export * set the specific config as the global config --- rpc/test/helpers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index ebf2e14d50..3f137f67e2 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -27,6 +27,8 @@ import ( type Options struct { suppressStdout bool recreateConfig bool + // SpecificConfig will replace the global config if not nil + SpecificConfig *cfg.Config } var globalConfig *cfg.Config @@ -151,7 +153,11 @@ func StopTendermint(node *nm.Node) { // NewTendermint creates a new tendermint server and sleeps forever func NewTendermint(app abci.Application, opts *Options) *nm.Node { // Create & start node + if opts.SpecificConfig != nil { + globalConfig = opts.SpecificConfig + } config := GetConfig(opts.recreateConfig) + var logger log.Logger if opts.suppressStdout { logger = log.NewNopLogger()