@@ -36,15 +36,13 @@ type StateSuite struct {
36
36
37
37
var _ = checker .Suite (& StateSuite {})
38
38
39
- var toAddr = common .BytesToAddress
40
-
41
39
func (s * StateSuite ) TestDump (c * checker.C ) {
42
40
// generate a few entries
43
- obj1 := s .state .GetOrNewStateObject (toAddr ([]byte {0x01 }))
41
+ obj1 := s .state .GetOrNewStateObject (common . BytesToAddress ([]byte {0x01 }))
44
42
obj1 .AddBalance (big .NewInt (22 ))
45
- obj2 := s .state .GetOrNewStateObject (toAddr ([]byte {0x01 , 0x02 }))
43
+ obj2 := s .state .GetOrNewStateObject (common . BytesToAddress ([]byte {0x01 , 0x02 }))
46
44
obj2 .SetCode (crypto .Keccak256Hash ([]byte {3 , 3 , 3 , 3 , 3 , 3 , 3 }), []byte {3 , 3 , 3 , 3 , 3 , 3 , 3 })
47
- obj3 := s .state .GetOrNewStateObject (toAddr ([]byte {0x02 }))
45
+ obj3 := s .state .GetOrNewStateObject (common . BytesToAddress ([]byte {0x02 }))
48
46
obj3 .SetBalance (big .NewInt (44 ))
49
47
50
48
// write some of them to the trie
@@ -111,7 +109,7 @@ func (s *StateSuite) TestNull(c *checker.C) {
111
109
}
112
110
113
111
func (s * StateSuite ) TestSnapshot (c * checker.C ) {
114
- stateobjaddr := toAddr ([]byte ("aa" ))
112
+ stateobjaddr := common . BytesToAddress ([]byte ("aa" ))
115
113
var storageaddr common.Hash
116
114
data1 := common .BytesToHash ([]byte {42 })
117
115
data2 := common .BytesToHash ([]byte {43 })
@@ -146,8 +144,8 @@ func TestSnapshot2(t *testing.T) {
146
144
db := rawdb .NewMemoryDatabase ()
147
145
state , _ := New (types .EmptyRootHash , NewDatabase (db ))
148
146
149
- stateobjaddr0 := toAddr ([]byte ("so0" ))
150
- stateobjaddr1 := toAddr ([]byte ("so1" ))
147
+ stateobjaddr0 := common . BytesToAddress ([]byte ("so0" ))
148
+ stateobjaddr1 := common . BytesToAddress ([]byte ("so1" ))
151
149
var storageaddr common.Hash
152
150
153
151
data0 := common .BytesToHash ([]byte {17 })
0 commit comments