Skip to content

Commit 6349d7d

Browse files
aaronbuchwaldgzliudan
authored andcommitted
core/state: remove toAddr helper in tests ethereum#22772
1 parent d1ce77a commit 6349d7d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

core/state/state_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import (
2828
"github.com/XinFinOrg/XDPoSChain/ethdb"
2929
)
3030

31-
var toAddr = common.BytesToAddress
32-
3331
type stateTest struct {
3432
db ethdb.Database
3533
state *StateDB
@@ -107,7 +105,7 @@ func TestNull(t *testing.T) {
107105
}
108106

109107
func TestSnapshot(t *testing.T) {
110-
stateobjaddr := toAddr([]byte("aa"))
108+
stateobjaddr := common.BytesToAddress([]byte("aa"))
111109
var storageaddr common.Hash
112110
data1 := common.BytesToHash([]byte{42})
113111
data2 := common.BytesToHash([]byte{43})

core/state/statedb_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,11 +922,11 @@ func TestMissingTrieNodes(t *testing.T) {
922922
db := NewDatabase(memDb)
923923
var root common.Hash
924924
state, _ := New(common.Hash{}, db)
925-
addr := toAddr([]byte("so"))
925+
addr := common.BytesToAddress([]byte("so"))
926926
{
927927
state.SetBalance(addr, big.NewInt(1))
928928
state.SetCode(addr, []byte{1, 2, 3})
929-
a2 := toAddr([]byte("another"))
929+
a2 := common.BytesToAddress([]byte("another"))
930930
state.SetBalance(a2, big.NewInt(100))
931931
state.SetCode(a2, []byte{1, 2, 4})
932932
root, _ = state.Commit(false)

0 commit comments

Comments
 (0)