trie, rpc, cmd/geth: fix tests on 32-bit and windows + minor rpc fixes (#21871)

* trie: fix tests to work on 32-bit systems

* les: make test work on 32-bit platform

* cmd/geth: fix windows-issues on tests

* trie: improve balance

* cmd/geth: make account tests less verbose + less mem intense

* rpc: make debug-level log output less verbose

* cmd/geth: lint
This commit is contained in:
Martin Holst Swende
2020-11-19 22:50:47 +01:00
committed by GitHub
parent f1e1d9f874
commit 6f88d6530a
7 changed files with 98 additions and 61 deletions

View File

@ -70,12 +70,12 @@ func runGeth(t *testing.T, args ...string) *testgeth {
tt := &testgeth{}
tt.TestCmd = cmdtest.NewTestCmd(t, tt)
for i, arg := range args {
switch {
case arg == "-datadir" || arg == "--datadir":
switch arg {
case "--datadir":
if i < len(args)-1 {
tt.Datadir = args[i+1]
}
case arg == "-etherbase" || arg == "--etherbase":
case "--etherbase":
if i < len(args)-1 {
tt.Etherbase = args[i+1]
}
@ -84,7 +84,7 @@ func runGeth(t *testing.T, args ...string) *testgeth {
if tt.Datadir == "" {
tt.Datadir = tmpdir(t)
tt.Cleanup = func() { os.RemoveAll(tt.Datadir) }
args = append([]string{"-datadir", tt.Datadir}, args...)
args = append([]string{"--datadir", tt.Datadir}, args...)
// Remove the temporary datadir if something fails below.
defer func() {
if t.Failed() {