@@ -175,10 +175,10 @@ func TestCopy(t *testing.T) {
175175 orig .Finalise (false )
176176
177177 // Copy the state
178- copy := orig .Copy ()
178+ copy := orig .Copy ().( * StateDB )
179179
180180 // Copy the copy state
181- ccopy := copy .Copy ()
181+ ccopy := copy .Copy ().( * StateDB )
182182
183183 // modify all in memory
184184 for i := byte (0 ); i < 255 ; i ++ {
@@ -278,7 +278,7 @@ func TestCopyObjectState(t *testing.T) {
278278 obj .data .Root = common .HexToHash ("0xdeadbeef" )
279279 }
280280 orig .Finalise (true )
281- cpy := orig .Copy ()
281+ cpy := orig .Copy ().( * StateDB )
282282 for _ , op := range cpy .mutations {
283283 if have , want := op .applied , false ; have != want {
284284 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 {
528528 for i , action := range test .actions {
529529 if len (test .snapshots ) > sindex && i == test .snapshots [sindex ] {
530530 snapshotRevs [sindex ] = state .Snapshot ()
531- checkstates [sindex ] = state .Copy ()
531+ checkstates [sindex ] = state .Copy ().( * StateDB )
532532 sindex ++
533533 }
534534 action .fn (action , state )
@@ -747,7 +747,7 @@ func TestCopyCommitCopy(t *testing.T) {
747747 t .Fatalf ("initial committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
748748 }
749749 // Copy the non-committed state database and check pre/post commit balance
750- copyOne := state .Copy ()
750+ copyOne := state .Copy ().( * StateDB )
751751 if balance := copyOne .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
752752 t .Fatalf ("first copy pre-commit balance mismatch: have %v, want %v" , balance , 42 )
753753 }
@@ -761,7 +761,7 @@ func TestCopyCommitCopy(t *testing.T) {
761761 t .Fatalf ("first copy pre-commit committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
762762 }
763763 // Copy the copy and check the balance once more
764- copyTwo := copyOne .Copy ()
764+ copyTwo := copyOne .Copy ().( * StateDB )
765765 if balance := copyTwo .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
766766 t .Fatalf ("second copy balance mismatch: have %v, want %v" , balance , 42 )
767767 }
@@ -820,7 +820,7 @@ func TestCopyCopyCommitCopy(t *testing.T) {
820820 t .Fatalf ("initial committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
821821 }
822822 // Copy the non-committed state database and check pre/post commit balance
823- copyOne := state .Copy ()
823+ copyOne := state .Copy ().( * StateDB )
824824 if balance := copyOne .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
825825 t .Fatalf ("first copy balance mismatch: have %v, want %v" , balance , 42 )
826826 }
@@ -834,7 +834,7 @@ func TestCopyCopyCommitCopy(t *testing.T) {
834834 t .Fatalf ("first copy committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
835835 }
836836 // Copy the copy and check the balance once more
837- copyTwo := copyOne .Copy ()
837+ copyTwo := copyOne .Copy ().( * StateDB )
838838 if balance := copyTwo .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
839839 t .Fatalf ("second copy pre-commit balance mismatch: have %v, want %v" , balance , 42 )
840840 }
@@ -848,7 +848,7 @@ func TestCopyCopyCommitCopy(t *testing.T) {
848848 t .Fatalf ("second copy pre-commit committed storage slot mismatch: have %x, want %x" , val , common.Hash {})
849849 }
850850 // Copy the copy-copy and check the balance once more
851- copyThree := copyTwo .Copy ()
851+ copyThree := copyTwo .Copy ().( * StateDB )
852852 if balance := copyThree .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
853853 t .Fatalf ("third copy balance mismatch: have %v, want %v" , balance , 42 )
854854 }
@@ -896,7 +896,7 @@ func TestCommitCopy(t *testing.T) {
896896 state .Commit (1 , true , false )
897897
898898 // Copy the committed state database, the copied one is not fully functional.
899- copied := state .Copy ()
899+ copied := state .Copy ().( * StateDB )
900900 if balance := copied .GetBalance (addr ); balance .Cmp (uint256 .NewInt (42 )) != 0 {
901901 t .Fatalf ("unexpected balance: have %v" , balance )
902902 }
@@ -1098,7 +1098,7 @@ func TestStateDBAccessList(t *testing.T) {
10981098 verifySlots ("bb" , "01" , "02" )
10991099
11001100 // Make a copy
1101- stateCopy1 := state .Copy ()
1101+ stateCopy1 := state .Copy ().( * StateDB )
11021102 if exp , got := 4 , state .journal .length (); exp != got {
11031103 t .Fatalf ("journal length mismatch: have %d, want %d" , got , exp )
11041104 }
0 commit comments