@@ -175,10 +175,10 @@ func TestCopy(t *testing.T) {
175
175
orig .Finalise (false )
176
176
177
177
// Copy the state
178
- copy := orig .Copy ()
178
+ copy := orig .Copy ().( * StateDB )
179
179
180
180
// Copy the copy state
181
- ccopy := copy .Copy ()
181
+ ccopy := copy .Copy ().( * StateDB )
182
182
183
183
// modify all in memory
184
184
for i := byte (0 ); i < 255 ; i ++ {
@@ -278,7 +278,7 @@ func TestCopyObjectState(t *testing.T) {
278
278
obj .data .Root = common .HexToHash ("0xdeadbeef" )
279
279
}
280
280
orig .Finalise (true )
281
- cpy := orig .Copy ()
281
+ cpy := orig .Copy ().( * StateDB )
282
282
for _ , op := range cpy .mutations {
283
283
if have , want := op .applied , false ; have != want {
284
284
t .Fatalf ("Error in test itself, the 'done' flag should not be set before Commit, have %v want %v" , have , want )
@@ -528,7 +528,7 @@ func (test *snapshotTest) run() bool {
528
528
for i , action := range test .actions {
529
529
if len (test .snapshots ) > sindex && i == test .snapshots [sindex ] {
530
530
snapshotRevs [sindex ] = state .Snapshot ()
531
- checkstates [sindex ] = state .Copy ()
531
+ checkstates [sindex ] = state .Copy ().( * StateDB )
532
532
sindex ++
533
533
}
534
534
action .fn (action , state )
@@ -747,7 +747,7 @@ func TestCopyCommitCopy(t *testing.T) {
747
747
t .Fatalf ("initial committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
748
748
}
749
749
// Copy the non-committed state database and check pre/post commit balance
750
- copyOne := state .Copy ()
750
+ copyOne := state .Copy ().( * StateDB )
751
751
if balance := copyOne .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
752
752
t .Fatalf ("first copy pre-commit balance mismatch: have %v, want %v" , balance , 42 )
753
753
}
@@ -761,7 +761,7 @@ func TestCopyCommitCopy(t *testing.T) {
761
761
t .Fatalf ("first copy pre-commit committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
762
762
}
763
763
// Copy the copy and check the balance once more
764
- copyTwo := copyOne .Copy ()
764
+ copyTwo := copyOne .Copy ().( * StateDB )
765
765
if balance := copyTwo .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
766
766
t .Fatalf ("second copy balance mismatch: have %v, want %v" , balance , 42 )
767
767
}
@@ -820,7 +820,7 @@ func TestCopyCopyCommitCopy(t *testing.T) {
820
820
t .Fatalf ("initial committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
821
821
}
822
822
// Copy the non-committed state database and check pre/post commit balance
823
- copyOne := state .Copy ()
823
+ copyOne := state .Copy ().( * StateDB )
824
824
if balance := copyOne .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
825
825
t .Fatalf ("first copy balance mismatch: have %v, want %v" , balance , 42 )
826
826
}
@@ -834,7 +834,7 @@ func TestCopyCopyCommitCopy(t *testing.T) {
834
834
t .Fatalf ("first copy committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
835
835
}
836
836
// Copy the copy and check the balance once more
837
- copyTwo := copyOne .Copy ()
837
+ copyTwo := copyOne .Copy ().( * StateDB )
838
838
if balance := copyTwo .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
839
839
t .Fatalf ("second copy pre-commit balance mismatch: have %v, want %v" , balance , 42 )
840
840
}
@@ -848,7 +848,7 @@ func TestCopyCopyCommitCopy(t *testing.T) {
848
848
t .Fatalf ("second copy pre-commit committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
849
849
}
850
850
// Copy the copy-copy and check the balance once more
851
- copyThree := copyTwo .Copy ()
851
+ copyThree := copyTwo .Copy ().( * StateDB )
852
852
if balance := copyThree .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
853
853
t .Fatalf ("third copy balance mismatch: have %v, want %v" , balance , 42 )
854
854
}
@@ -896,7 +896,7 @@ func TestCommitCopy(t *testing.T) {
896
896
state .Commit (1 , true , false )
897
897
898
898
// Copy the committed state database, the copied one is not fully functional.
899
- copied := state .Copy ()
899
+ copied := state .Copy ().( * StateDB )
900
900
if balance := copied .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
901
901
t .Fatalf ("unexpected balance: have %v" , balance )
902
902
}
@@ -1098,7 +1098,7 @@ func TestStateDBAccessList(t *testing.T) {
1098
1098
verifySlots ("bb" , "01" , "02" )
1099
1099
1100
1100
// Make a copy
1101
- stateCopy1 := state .Copy ()
1101
+ stateCopy1 := state .Copy ().( * StateDB )
1102
1102
if exp , got := 4 , state .journal .length (); exp != got {
1103
1103
t .Fatalf ("journal length mismatch: have %d, want %d" , got , exp )
1104
1104
}
0 commit comments