@@ -27,8 +27,6 @@ import (
27
27
"github.com/ethereum/go-ethereum/ethdb"
28
28
)
29
29
30
- var toAddr = common .BytesToAddress
31
-
32
30
type stateTest struct {
33
31
db ethdb.Database
34
32
state * StateDB
@@ -46,11 +44,11 @@ func TestDump(t *testing.T) {
46
44
s := & stateTest {db : db , state : sdb }
47
45
48
46
// generate a few entries
49
- obj1 := s .state .GetOrNewStateObject (toAddr ([]byte {0x01 }))
47
+ obj1 := s .state .GetOrNewStateObject (common . BytesToAddress ([]byte {0x01 }))
50
48
obj1 .AddBalance (big .NewInt (22 ))
51
- obj2 := s .state .GetOrNewStateObject (toAddr ([]byte {0x01 , 0x02 }))
49
+ obj2 := s .state .GetOrNewStateObject (common . BytesToAddress ([]byte {0x01 , 0x02 }))
52
50
obj2 .SetCode (crypto .Keccak256Hash ([]byte {3 , 3 , 3 , 3 , 3 , 3 , 3 }), []byte {3 , 3 , 3 , 3 , 3 , 3 , 3 })
53
- obj3 := s .state .GetOrNewStateObject (toAddr ([]byte {0x02 }))
51
+ obj3 := s .state .GetOrNewStateObject (common . BytesToAddress ([]byte {0x02 }))
54
52
obj3 .SetBalance (big .NewInt (44 ))
55
53
56
54
// write some of them to the trie
@@ -108,7 +106,7 @@ func TestNull(t *testing.T) {
108
106
}
109
107
110
108
func TestSnapshot (t * testing.T ) {
111
- stateobjaddr := toAddr ([]byte ("aa" ))
109
+ stateobjaddr := common . BytesToAddress ([]byte ("aa" ))
112
110
var storageaddr common.Hash
113
111
data1 := common .BytesToHash ([]byte {42 })
114
112
data2 := common .BytesToHash ([]byte {43 })
@@ -150,8 +148,8 @@ func TestSnapshotEmpty(t *testing.T) {
150
148
func TestSnapshot2 (t * testing.T ) {
151
149
state , _ := New (common.Hash {}, NewDatabase (rawdb .NewMemoryDatabase ()), nil )
152
150
153
- stateobjaddr0 := toAddr ([]byte ("so0" ))
154
- stateobjaddr1 := toAddr ([]byte ("so1" ))
151
+ stateobjaddr0 := common . BytesToAddress ([]byte ("so0" ))
152
+ stateobjaddr1 := common . BytesToAddress ([]byte ("so1" ))
155
153
var storageaddr common.Hash
156
154
157
155
data0 := common .BytesToHash ([]byte {17 })
0 commit comments