@@ -351,34 +351,47 @@ func TestAccountIteratorSeek(t *testing.T) {
351351 snaps .Update (common .HexToHash ("0x04" ), common .HexToHash ("0x03" ), nil ,
352352 randomAccountSet ("0xcc" , "0xf0" , "0xff" ), nil )
353353
354- // Construct various iterators and ensure their tranversal is correct
354+ // Account set is now
355+ // 02: aa, ee, f0, ff
356+ // 03: aa, bb, dd, ee, f0 (, f0), ff
357+ // 04: aa, bb, cc, dd, ee, f0 (, f0), ff (, ff)
358+ // Construct various iterators and ensure their traversal is correct
355359 it , _ := snaps .AccountIterator (common .HexToHash ("0x02" ), common .HexToHash ("0xdd" ))
356360 defer it .Release ()
357361 verifyIterator (t , 3 , it ) // expected: ee, f0, ff
358362
359363 it , _ = snaps .AccountIterator (common .HexToHash ("0x02" ), common .HexToHash ("0xaa" ))
360364 defer it .Release ()
361- verifyIterator (t , 3 , it ) // expected: ee, f0, ff
365+ verifyIterator (t , 4 , it ) // expected: aa, ee, f0, ff
362366
363367 it , _ = snaps .AccountIterator (common .HexToHash ("0x02" ), common .HexToHash ("0xff" ))
364368 defer it .Release ()
369+ verifyIterator (t , 1 , it ) // expected: ff
370+
371+ it , _ = snaps .AccountIterator (common .HexToHash ("0x02" ), common .HexToHash ("0xff1" ))
372+ defer it .Release ()
365373 verifyIterator (t , 0 , it ) // expected: nothing
366374
367375 it , _ = snaps .AccountIterator (common .HexToHash ("0x04" ), common .HexToHash ("0xbb" ))
368376 defer it .Release ()
369- verifyIterator (t , 5 , it ) // expected: cc, dd, ee, f0, ff
377+ verifyIterator (t , 6 , it ) // expected: bb, cc, dd, ee, f0, ff
370378
371379 it , _ = snaps .AccountIterator (common .HexToHash ("0x04" ), common .HexToHash ("0xef" ))
372380 defer it .Release ()
373381 verifyIterator (t , 2 , it ) // expected: f0, ff
374382
375383 it , _ = snaps .AccountIterator (common .HexToHash ("0x04" ), common .HexToHash ("0xf0" ))
376384 defer it .Release ()
377- verifyIterator (t , 1 , it ) // expected: ff
385+ verifyIterator (t , 2 , it ) // expected: f0, ff
378386
379387 it , _ = snaps .AccountIterator (common .HexToHash ("0x04" ), common .HexToHash ("0xff" ))
380388 defer it .Release ()
389+ verifyIterator (t , 1 , it ) // expected: ff
390+
391+ it , _ = snaps .AccountIterator (common .HexToHash ("0x04" ), common .HexToHash ("0xff1" ))
392+ defer it .Release ()
381393 verifyIterator (t , 0 , it ) // expected: nothing
394+
382395}
383396
384397// TestIteratorDeletions tests that the iterator behaves correct when there are
0 commit comments