Skip to content

Commit 481fd21

Browse files
authored
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
1 parent 3c6122a commit 481fd21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rpc/test/helpers.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
type Options struct {
2828
suppressStdout bool
2929
recreateConfig bool
30+
// SpecificConfig will replace the global config if not nil
31+
SpecificConfig *cfg.Config
3032
}
3133

3234
var globalConfig *cfg.Config
@@ -151,7 +153,11 @@ func StopTendermint(node *nm.Node) {
151153
// NewTendermint creates a new tendermint server and sleeps forever
152154
func NewTendermint(app abci.Application, opts *Options) *nm.Node {
153155
// Create & start node
156+
if opts.SpecificConfig != nil {
157+
globalConfig = opts.SpecificConfig
158+
}
154159
config := GetConfig(opts.recreateConfig)
160+
155161
var logger log.Logger
156162
if opts.suppressStdout {
157163
logger = log.NewNopLogger()

0 commit comments

Comments
 (0)