@@ -491,12 +491,12 @@ func TestGenerateWithExtraAccounts(t *testing.T) {
491
491
492
492
// Identical in the snap
493
493
key := hashData ([]byte ("acc-1" ))
494
- rawdb .WriteAccountSnapshot (helper .triedb . DiskDB () , key , val )
495
- rawdb .WriteStorageSnapshot (helper .triedb . DiskDB () , key , hashData ([]byte ("key-1" )), []byte ("val-1" ))
496
- rawdb .WriteStorageSnapshot (helper .triedb . DiskDB () , key , hashData ([]byte ("key-2" )), []byte ("val-2" ))
497
- rawdb .WriteStorageSnapshot (helper .triedb . DiskDB () , key , hashData ([]byte ("key-3" )), []byte ("val-3" ))
498
- rawdb .WriteStorageSnapshot (helper .triedb . DiskDB () , key , hashData ([]byte ("key-4" )), []byte ("val-4" ))
499
- rawdb .WriteStorageSnapshot (helper .triedb . DiskDB () , key , hashData ([]byte ("key-5" )), []byte ("val-5" ))
494
+ rawdb .WriteAccountSnapshot (helper .diskdb , key , val )
495
+ rawdb .WriteStorageSnapshot (helper .diskdb , key , hashData ([]byte ("key-1" )), []byte ("val-1" ))
496
+ rawdb .WriteStorageSnapshot (helper .diskdb , key , hashData ([]byte ("key-2" )), []byte ("val-2" ))
497
+ rawdb .WriteStorageSnapshot (helper .diskdb , key , hashData ([]byte ("key-3" )), []byte ("val-3" ))
498
+ rawdb .WriteStorageSnapshot (helper .diskdb , key , hashData ([]byte ("key-4" )), []byte ("val-4" ))
499
+ rawdb .WriteStorageSnapshot (helper .diskdb , key , hashData ([]byte ("key-5" )), []byte ("val-5" ))
500
500
}
501
501
{
502
502
// Account two exists only in the snapshot
@@ -508,15 +508,15 @@ func TestGenerateWithExtraAccounts(t *testing.T) {
508
508
acc := & Account {Balance : big .NewInt (1 ), Root : stRoot , CodeHash : emptyCode .Bytes ()}
509
509
val , _ := rlp .EncodeToBytes (acc )
510
510
key := hashData ([]byte ("acc-2" ))
511
- rawdb .WriteAccountSnapshot (helper .triedb . DiskDB () , key , val )
512
- rawdb .WriteStorageSnapshot (helper .triedb . DiskDB () , key , hashData ([]byte ("b-key-1" )), []byte ("b-val-1" ))
513
- rawdb .WriteStorageSnapshot (helper .triedb . DiskDB () , key , hashData ([]byte ("b-key-2" )), []byte ("b-val-2" ))
514
- rawdb .WriteStorageSnapshot (helper .triedb . DiskDB () , key , hashData ([]byte ("b-key-3" )), []byte ("b-val-3" ))
511
+ rawdb .WriteAccountSnapshot (helper .diskdb , key , val )
512
+ rawdb .WriteStorageSnapshot (helper .diskdb , key , hashData ([]byte ("b-key-1" )), []byte ("b-val-1" ))
513
+ rawdb .WriteStorageSnapshot (helper .diskdb , key , hashData ([]byte ("b-key-2" )), []byte ("b-val-2" ))
514
+ rawdb .WriteStorageSnapshot (helper .diskdb , key , hashData ([]byte ("b-key-3" )), []byte ("b-val-3" ))
515
515
}
516
516
root := helper .Commit ()
517
517
518
518
// To verify the test: If we now inspect the snap db, there should exist extraneous storage items
519
- if data := rawdb .ReadStorageSnapshot (helper .triedb . DiskDB () , hashData ([]byte ("acc-2" )), hashData ([]byte ("b-key-1" ))); data == nil {
519
+ if data := rawdb .ReadStorageSnapshot (helper .diskdb , hashData ([]byte ("acc-2" )), hashData ([]byte ("b-key-1" ))); data == nil {
520
520
t .Fatalf ("expected snap storage to exist" )
521
521
}
522
522
snap := generateSnapshot (helper .diskdb , helper .triedb , 16 , root )
@@ -534,7 +534,7 @@ func TestGenerateWithExtraAccounts(t *testing.T) {
534
534
snap .genAbort <- stop
535
535
<- stop
536
536
// If we now inspect the snap db, there should exist no extraneous storage items
537
- if data := rawdb .ReadStorageSnapshot (helper .triedb . DiskDB () , hashData ([]byte ("acc-2" )), hashData ([]byte ("b-key-1" ))); data != nil {
537
+ if data := rawdb .ReadStorageSnapshot (helper .diskdb , hashData ([]byte ("acc-2" )), hashData ([]byte ("b-key-1" ))); data != nil {
538
538
t .Fatalf ("expected slot to be removed, got %v" , string (data ))
539
539
}
540
540
}
0 commit comments