aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-18 20:29:53 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-18 20:29:53 +0800
commit2cea41065609dbebdd3856a00e9333566945ebee (patch)
treedb3dc8b4fe4b07b9f24493e70def40812dad1686 /tests
parent53a6145a2bd6f733799375700d117c9674e8207b (diff)
parent430bcdb21959e018fbc93bac0ccd8bbfa2fd5afb (diff)
downloadgo-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.gz
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.bz2
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.lz
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.xz
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.zst
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.zip
Merge pull request #1282 from obscuren/state-cleanup
core/state: cleanup & optimisations
Diffstat (limited to 'tests')
-rw-r--r--tests/block_test_util.go2
-rw-r--r--tests/vm/gh_test.go10
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/block_test_util.go b/tests/block_test_util.go
index ae2ae4033..200fcbd59 100644
--- a/tests/block_test_util.go
+++ b/tests/block_test_util.go
@@ -124,7 +124,7 @@ func (t *BlockTest) InsertPreState(ethereum *eth.Ethereum) (*state.StateDB, erro
obj.SetBalance(balance)
obj.SetNonce(nonce)
for k, v := range acct.Storage {
- statedb.SetState(common.HexToAddress(addrString), common.HexToHash(k), common.FromHex(v))
+ statedb.SetState(common.HexToAddress(addrString), common.HexToHash(k), common.HexToHash(v))
}
}
// sync objects to trie
diff --git a/tests/vm/gh_test.go b/tests/vm/gh_test.go
index a95d02576..be9e89d9c 100644
--- a/tests/vm/gh_test.go
+++ b/tests/vm/gh_test.go
@@ -97,7 +97,7 @@ func RunVmTest(p string, t *testing.T) {
obj := StateObjectFromAccount(db, addr, account)
statedb.SetStateObject(obj)
for a, v := range account.Storage {
- obj.SetState(common.HexToHash(a), common.NewValue(helper.FromHex(v)))
+ obj.SetState(common.HexToHash(a), common.HexToHash(v))
}
}
@@ -168,11 +168,11 @@ func RunVmTest(p string, t *testing.T) {
}
for addr, value := range account.Storage {
- v := obj.GetState(common.HexToHash(addr)).Bytes()
- vexp := helper.FromHex(value)
+ v := obj.GetState(common.HexToHash(addr))
+ vexp := common.HexToHash(value)
- if bytes.Compare(v, vexp) != 0 {
- t.Errorf("%s's : (%x: %s) storage failed. Expected %x, got %x (%v %v)\n", name, obj.Address().Bytes()[0:4], addr, vexp, v, common.BigD(vexp), common.BigD(v))
+ if v != vexp {
+ t.Errorf("%s's : (%x: %s) storage failed. Expected %x, got %x (%v %v)\n", name, obj.Address().Bytes()[0:4], addr, vexp, v, vexp.Big(), v.Big())
}
}
}