Skip to content

Commit

Permalink
disable trace requirement in local mode
Browse files Browse the repository at this point in the history
  • Loading branch information
canercidam committed Jun 7, 2023
1 parent de4627b commit cb729a6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (cfg *Config) BotsToWait() (waitBots int) {
// apply defaults that apply in certain contexts
func applyContextDefaults(cfg *Config) {
chainSettings := settings.GetChainSettings(cfg.ChainID)
if chainSettings.EnableTrace {
if chainSettings.EnableTrace && !cfg.LocalModeConfig.Enable {
cfg.Trace.Enabled = true
}
if cfg.ENSConfig.DefaultContract {
Expand Down
29 changes: 29 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package config

import (
"path"
"testing"

"github.com/stretchr/testify/require"
)

func TestApplyContextDefaults(t *testing.T) {
r := require.New(t)

cfg := &Config{
ChainID: 1, // trace enabled
LocalModeConfig: LocalModeConfig{
Enable: true, // trace not enforced
},
Trace: TraceConfig{
Enabled: false,
},
}

applyContextDefaults(cfg)

r.Equal(cfg.Trace.Enabled, false)
r.Equal(DefaultContainerFortaDirPath, cfg.FortaDir)
r.Equal(path.Join(cfg.FortaDir, DefaultKeysDirName), cfg.KeyDirPath)
r.Equal(path.Join(cfg.FortaDir, DefaultCombinerCacheFileName), cfg.CombinerConfig.CombinerCachePath)
}

0 comments on commit cb729a6

Please sign in to comment.