|
|
@ -122,7 +122,7 @@ func testIterativeTrieSync(t *testing.T, batch int) { |
|
|
|
} |
|
|
|
} |
|
|
|
results[i] = SyncResult{hash, data} |
|
|
|
results[i] = SyncResult{hash, data} |
|
|
|
} |
|
|
|
} |
|
|
|
if _, index, err := sched.Process(results); err != nil { |
|
|
|
if _, index, err := sched.Process(results, dstDb); err != nil { |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
} |
|
|
|
} |
|
|
|
queue = append(queue[:0], sched.Missing(batch)...) |
|
|
|
queue = append(queue[:0], sched.Missing(batch)...) |
|
|
@ -152,7 +152,7 @@ func TestIterativeDelayedTrieSync(t *testing.T) { |
|
|
|
} |
|
|
|
} |
|
|
|
results[i] = SyncResult{hash, data} |
|
|
|
results[i] = SyncResult{hash, data} |
|
|
|
} |
|
|
|
} |
|
|
|
if _, index, err := sched.Process(results); err != nil { |
|
|
|
if _, index, err := sched.Process(results, dstDb); err != nil { |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
} |
|
|
|
} |
|
|
|
queue = append(queue[len(results):], sched.Missing(10000)...) |
|
|
|
queue = append(queue[len(results):], sched.Missing(10000)...) |
|
|
@ -190,7 +190,7 @@ func testIterativeRandomTrieSync(t *testing.T, batch int) { |
|
|
|
results = append(results, SyncResult{hash, data}) |
|
|
|
results = append(results, SyncResult{hash, data}) |
|
|
|
} |
|
|
|
} |
|
|
|
// Feed the retrieved results back and queue new tasks
|
|
|
|
// Feed the retrieved results back and queue new tasks
|
|
|
|
if _, index, err := sched.Process(results); err != nil { |
|
|
|
if _, index, err := sched.Process(results, dstDb); err != nil { |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
} |
|
|
|
} |
|
|
|
queue = make(map[common.Hash]struct{}) |
|
|
|
queue = make(map[common.Hash]struct{}) |
|
|
@ -231,7 +231,7 @@ func TestIterativeRandomDelayedTrieSync(t *testing.T) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// Feed the retrieved results back and queue new tasks
|
|
|
|
// Feed the retrieved results back and queue new tasks
|
|
|
|
if _, index, err := sched.Process(results); err != nil { |
|
|
|
if _, index, err := sched.Process(results, dstDb); err != nil { |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
} |
|
|
|
} |
|
|
|
for _, result := range results { |
|
|
|
for _, result := range results { |
|
|
@ -272,7 +272,7 @@ func TestDuplicateAvoidanceTrieSync(t *testing.T) { |
|
|
|
|
|
|
|
|
|
|
|
results[i] = SyncResult{hash, data} |
|
|
|
results[i] = SyncResult{hash, data} |
|
|
|
} |
|
|
|
} |
|
|
|
if _, index, err := sched.Process(results); err != nil { |
|
|
|
if _, index, err := sched.Process(results, dstDb); err != nil { |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
} |
|
|
|
} |
|
|
|
queue = append(queue[:0], sched.Missing(0)...) |
|
|
|
queue = append(queue[:0], sched.Missing(0)...) |
|
|
@ -304,7 +304,7 @@ func TestIncompleteTrieSync(t *testing.T) { |
|
|
|
results[i] = SyncResult{hash, data} |
|
|
|
results[i] = SyncResult{hash, data} |
|
|
|
} |
|
|
|
} |
|
|
|
// Process each of the trie nodes
|
|
|
|
// Process each of the trie nodes
|
|
|
|
if _, index, err := sched.Process(results); err != nil { |
|
|
|
if _, index, err := sched.Process(results, dstDb); err != nil { |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
t.Fatalf("failed to process result #%d: %v", index, err) |
|
|
|
} |
|
|
|
} |
|
|
|
for _, result := range results { |
|
|
|
for _, result := range results { |
|
|
|