@@ -87,32 +87,32 @@ func checkTrieConsistency(db *Database, root common.Hash) error {
8787}
8888
8989// Tests that an empty trie is not scheduled for syncing.
90- func TestEmptyTrieSync (t * testing.T ) {
90+ func TestEmptySync (t * testing.T ) {
9191 dbA := NewDatabase (ethdb .NewMemDatabase ())
9292 dbB := NewDatabase (ethdb .NewMemDatabase ())
9393 emptyA , _ := New (common.Hash {}, dbA )
9494 emptyB , _ := New (emptyRoot , dbB )
9595
9696 for i , trie := range []* Trie {emptyA , emptyB } {
97- if req := NewTrieSync (trie .Hash (), ethdb .NewMemDatabase (), nil ).Missing (1 ); len (req ) != 0 {
97+ if req := NewSync (trie .Hash (), ethdb .NewMemDatabase (), nil ).Missing (1 ); len (req ) != 0 {
9898 t .Errorf ("test %d: content requested for empty trie: %v" , i , req )
9999 }
100100 }
101101}
102102
103103// Tests that given a root hash, a trie can sync iteratively on a single thread,
104104// requesting retrieval tasks and returning all of them in one go.
105- func TestIterativeTrieSyncIndividual (t * testing.T ) { testIterativeTrieSync (t , 1 ) }
106- func TestIterativeTrieSyncBatched (t * testing.T ) { testIterativeTrieSync (t , 100 ) }
105+ func TestIterativeSyncIndividual (t * testing.T ) { testIterativeSync (t , 1 ) }
106+ func TestIterativeSyncBatched (t * testing.T ) { testIterativeSync (t , 100 ) }
107107
108- func testIterativeTrieSync (t * testing.T , batch int ) {
108+ func testIterativeSync (t * testing.T , batch int ) {
109109 // Create a random trie to copy
110110 srcDb , srcTrie , srcData := makeTestTrie ()
111111
112112 // Create a destination trie and sync with the scheduler
113113 diskdb := ethdb .NewMemDatabase ()
114114 triedb := NewDatabase (diskdb )
115- sched := NewTrieSync (srcTrie .Hash (), diskdb , nil )
115+ sched := NewSync (srcTrie .Hash (), diskdb , nil )
116116
117117 queue := append ([]common.Hash {}, sched .Missing (batch )... )
118118 for len (queue ) > 0 {
@@ -138,14 +138,14 @@ func testIterativeTrieSync(t *testing.T, batch int) {
138138
139139// Tests that the trie scheduler can correctly reconstruct the state even if only
140140// partial results are returned, and the others sent only later.
141- func TestIterativeDelayedTrieSync (t * testing.T ) {
141+ func TestIterativeDelayedSync (t * testing.T ) {
142142 // Create a random trie to copy
143143 srcDb , srcTrie , srcData := makeTestTrie ()
144144
145145 // Create a destination trie and sync with the scheduler
146146 diskdb := ethdb .NewMemDatabase ()
147147 triedb := NewDatabase (diskdb )
148- sched := NewTrieSync (srcTrie .Hash (), diskdb , nil )
148+ sched := NewSync (srcTrie .Hash (), diskdb , nil )
149149
150150 queue := append ([]common.Hash {}, sched .Missing (10000 )... )
151151 for len (queue ) > 0 {
@@ -173,17 +173,17 @@ func TestIterativeDelayedTrieSync(t *testing.T) {
173173// Tests that given a root hash, a trie can sync iteratively on a single thread,
174174// requesting retrieval tasks and returning all of them in one go, however in a
175175// random order.
176- func TestIterativeRandomTrieSyncIndividual (t * testing.T ) { testIterativeRandomTrieSync (t , 1 ) }
177- func TestIterativeRandomTrieSyncBatched (t * testing.T ) { testIterativeRandomTrieSync (t , 100 ) }
176+ func TestIterativeRandomSyncIndividual (t * testing.T ) { testIterativeRandomSync (t , 1 ) }
177+ func TestIterativeRandomSyncBatched (t * testing.T ) { testIterativeRandomSync (t , 100 ) }
178178
179- func testIterativeRandomTrieSync (t * testing.T , batch int ) {
179+ func testIterativeRandomSync (t * testing.T , batch int ) {
180180 // Create a random trie to copy
181181 srcDb , srcTrie , srcData := makeTestTrie ()
182182
183183 // Create a destination trie and sync with the scheduler
184184 diskdb := ethdb .NewMemDatabase ()
185185 triedb := NewDatabase (diskdb )
186- sched := NewTrieSync (srcTrie .Hash (), diskdb , nil )
186+ sched := NewSync (srcTrie .Hash (), diskdb , nil )
187187
188188 queue := make (map [common.Hash ]struct {})
189189 for _ , hash := range sched .Missing (batch ) {
@@ -217,14 +217,14 @@ func testIterativeRandomTrieSync(t *testing.T, batch int) {
217217
218218// Tests that the trie scheduler can correctly reconstruct the state even if only
219219// partial results are returned (Even those randomly), others sent only later.
220- func TestIterativeRandomDelayedTrieSync (t * testing.T ) {
220+ func TestIterativeRandomDelayedSync (t * testing.T ) {
221221 // Create a random trie to copy
222222 srcDb , srcTrie , srcData := makeTestTrie ()
223223
224224 // Create a destination trie and sync with the scheduler
225225 diskdb := ethdb .NewMemDatabase ()
226226 triedb := NewDatabase (diskdb )
227- sched := NewTrieSync (srcTrie .Hash (), diskdb , nil )
227+ sched := NewSync (srcTrie .Hash (), diskdb , nil )
228228
229229 queue := make (map [common.Hash ]struct {})
230230 for _ , hash := range sched .Missing (10000 ) {
@@ -264,14 +264,14 @@ func TestIterativeRandomDelayedTrieSync(t *testing.T) {
264264
265265// Tests that a trie sync will not request nodes multiple times, even if they
266266// have such references.
267- func TestDuplicateAvoidanceTrieSync (t * testing.T ) {
267+ func TestDuplicateAvoidanceSync (t * testing.T ) {
268268 // Create a random trie to copy
269269 srcDb , srcTrie , srcData := makeTestTrie ()
270270
271271 // Create a destination trie and sync with the scheduler
272272 diskdb := ethdb .NewMemDatabase ()
273273 triedb := NewDatabase (diskdb )
274- sched := NewTrieSync (srcTrie .Hash (), diskdb , nil )
274+ sched := NewSync (srcTrie .Hash (), diskdb , nil )
275275
276276 queue := append ([]common.Hash {}, sched .Missing (0 )... )
277277 requested := make (map [common.Hash ]struct {})
@@ -304,14 +304,14 @@ func TestDuplicateAvoidanceTrieSync(t *testing.T) {
304304
305305// Tests that at any point in time during a sync, only complete sub-tries are in
306306// the database.
307- func TestIncompleteTrieSync (t * testing.T ) {
307+ func TestIncompleteSync (t * testing.T ) {
308308 // Create a random trie to copy
309309 srcDb , srcTrie , _ := makeTestTrie ()
310310
311311 // Create a destination trie and sync with the scheduler
312312 diskdb := ethdb .NewMemDatabase ()
313313 triedb := NewDatabase (diskdb )
314- sched := NewTrieSync (srcTrie .Hash (), diskdb , nil )
314+ sched := NewSync (srcTrie .Hash (), diskdb , nil )
315315
316316 added := []common.Hash {}
317317 queue := append ([]common.Hash {}, sched .Missing (1 )... )
0 commit comments