Skip to content

Commit

Permalink
fix: add an option to specify a config when starting a test rpc node (#…
Browse files Browse the repository at this point in the history
…818)

* fix: add an option to specify a config

* export SpecificConfig

* fix specific config export

* set the specific config as the global config
  • Loading branch information
evan-forbes authored Aug 6, 2022
1 parent 3c6122a commit 481fd21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rpc/test/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 481fd21

Please sign in to comment.