Skip to content

Commit

Permalink
tests: improve debugging config for test failure logs
Browse files Browse the repository at this point in the history
Chain config implementations are not required to satisfy
Stringer iface, which can result in illegible logs.

Signed-off-by: meows <[email protected]>
  • Loading branch information
meowsbits committed Feb 5, 2020
1 parent f9c254e commit ba5afc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/difficulty_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ func (test *DifficultyTest) Run(config ctypes.ChainConfigurator) error {
actual := ethash.CalcDifficulty(config, test.CurrentTimestamp, parent)
exp := test.CurrentDifficulty

b, _ := json.Marshal(config)
if actual.Cmp(exp) != 0 {
return fmt.Errorf(`%s got: %v, want: %v
test: %v
config: %s`, test.Name, actual, exp, test, config)
config: %s`, test.Name, actual, exp, test, string(b))
}
return nil

Expand Down

0 comments on commit ba5afc9

Please sign in to comment.