remove code that will not be executed (#2333)
This commit is contained in:
parent
75a03f420f
commit
e4688e4e7a
@ -358,7 +358,6 @@ func TestUpdatedKeyfileContents(t *testing.T) {
|
|||||||
// Now replace file contents
|
// Now replace file contents
|
||||||
if err := forceCopyFile(file, cachetestAccounts[1].URL.Path); err != nil {
|
if err := forceCopyFile(file, cachetestAccounts[1].URL.Path); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
wantAccounts = []accounts.Account{cachetestAccounts[1]}
|
wantAccounts = []accounts.Account{cachetestAccounts[1]}
|
||||||
wantAccounts[0].URL = accounts.URL{Scheme: KeyStoreScheme, Path: file}
|
wantAccounts[0].URL = accounts.URL{Scheme: KeyStoreScheme, Path: file}
|
||||||
@ -374,7 +373,6 @@ func TestUpdatedKeyfileContents(t *testing.T) {
|
|||||||
// Now replace file contents again
|
// Now replace file contents again
|
||||||
if err := forceCopyFile(file, cachetestAccounts[2].URL.Path); err != nil {
|
if err := forceCopyFile(file, cachetestAccounts[2].URL.Path); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
wantAccounts = []accounts.Account{cachetestAccounts[2]}
|
wantAccounts = []accounts.Account{cachetestAccounts[2]}
|
||||||
wantAccounts[0].URL = accounts.URL{Scheme: KeyStoreScheme, Path: file}
|
wantAccounts[0].URL = accounts.URL{Scheme: KeyStoreScheme, Path: file}
|
||||||
@ -390,7 +388,6 @@ func TestUpdatedKeyfileContents(t *testing.T) {
|
|||||||
// Now replace file contents with crap
|
// Now replace file contents with crap
|
||||||
if err := os.WriteFile(file, []byte("foo"), 0600); err != nil {
|
if err := os.WriteFile(file, []byte("foo"), 0600); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if err := waitForAccounts([]accounts.Account{}, ks); err != nil {
|
if err := waitForAccounts([]accounts.Account{}, ks); err != nil {
|
||||||
t.Errorf("Emptying account file failed")
|
t.Errorf("Emptying account file failed")
|
||||||
|
@ -467,7 +467,6 @@ func (tt *cliqueTest) run(t *testing.T) {
|
|||||||
for j := 0; j < len(batches)-1; j++ {
|
for j := 0; j < len(batches)-1; j++ {
|
||||||
if k, err := chain.InsertChain(batches[j]); err != nil {
|
if k, err := chain.InsertChain(batches[j]); err != nil {
|
||||||
t.Fatalf("failed to import batch %d, block %d: %v", j, k, err)
|
t.Fatalf("failed to import batch %d, block %d: %v", j, k, err)
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _, err = chain.InsertChain(batches[len(batches)-1]); err != tt.failure {
|
if _, err = chain.InsertChain(batches[len(batches)-1]); err != tt.failure {
|
||||||
|
@ -851,7 +851,6 @@ func testInvalidNumberAnnouncement(t *testing.T, light bool) {
|
|||||||
continue
|
continue
|
||||||
case <-time.After(1 * time.Second):
|
case <-time.After(1 * time.Second):
|
||||||
t.Fatal("announce timeout")
|
t.Fatal("announce timeout")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,6 @@ func benchmarkBloomBits(b *testing.B, sectionSize uint64) {
|
|||||||
hash := rawdb.ReadCanonicalHash(db, i)
|
hash := rawdb.ReadCanonicalHash(db, i)
|
||||||
if header = rawdb.ReadHeader(db, hash, i); header == nil {
|
if header = rawdb.ReadHeader(db, hash, i); header == nil {
|
||||||
b.Fatalf("Error creating bloomBits data")
|
b.Fatalf("Error creating bloomBits data")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
bc.AddBloom(uint(i-sectionIdx*sectionSize), header.Bloom)
|
bc.AddBloom(uint(i-sectionIdx*sectionSize), header.Bloom)
|
||||||
}
|
}
|
||||||
|
@ -822,12 +822,10 @@ func (test *udpV5Test) waitPacketOut(validate interface{}) (closed bool) {
|
|||||||
}
|
}
|
||||||
if err == errTimeout {
|
if err == errTimeout {
|
||||||
test.t.Fatalf("timed out waiting for %v", exptype)
|
test.t.Fatalf("timed out waiting for %v", exptype)
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
ln := test.nodesByIP[string(dgram.to.IP)]
|
ln := test.nodesByIP[string(dgram.to.IP)]
|
||||||
if ln == nil {
|
if ln == nil {
|
||||||
test.t.Fatalf("attempt to send to non-existing node %v", &dgram.to)
|
test.t.Fatalf("attempt to send to non-existing node %v", &dgram.to)
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
codec := &testCodec{test: test, id: ln.ID()}
|
codec := &testCodec{test: test, id: ln.ID()}
|
||||||
frame, p, err := codec.decodeFrame(dgram.data)
|
frame, p, err := codec.decodeFrame(dgram.data)
|
||||||
|
@ -219,11 +219,9 @@ func runBenchmarkFile(b *testing.B, path string) {
|
|||||||
m := make(map[string]StateTest)
|
m := make(map[string]StateTest)
|
||||||
if err := readJSONFile(path, &m); err != nil {
|
if err := readJSONFile(path, &m); err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if len(m) != 1 {
|
if len(m) != 1 {
|
||||||
b.Fatal("expected single benchmark in a file")
|
b.Fatal("expected single benchmark in a file")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for _, t := range m {
|
for _, t := range m {
|
||||||
t := t
|
t := t
|
||||||
|
Loading…
Reference in New Issue
Block a user