aboutsummaryrefslogtreecommitdiffstats
path: root/core/state/statedb_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-10-01 21:58:49 +0800
committerGitHub <noreply@github.com>2016-10-01 21:58:49 +0800
commit0731b44809f72ed5880dc3654ee70ae85420bd77 (patch)
tree68eb52c91a136e820f3656e394847c4e695afa63 /core/state/statedb_test.go
parentd8715fba1a366944a069397775fc52a30358eff3 (diff)
parentcb84e3f02953f2df166ae69369d222dcbbd7d78d (diff)
downloadgo-tangerine-0731b44809f72ed5880dc3654ee70ae85420bd77.tar.gz
go-tangerine-0731b44809f72ed5880dc3654ee70ae85420bd77.tar.zst
go-tangerine-0731b44809f72ed5880dc3654ee70ae85420bd77.zip
Merge pull request #3067 from karalabe/vm-avoid-hashing
cmd, core, internal, light, tests: avoid hashing the code in the VM
Diffstat (limited to 'core/state/statedb_test.go')
-rw-r--r--core/state/statedb_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go
index 928333459..7930b620d 100644
--- a/core/state/statedb_test.go
+++ b/core/state/statedb_test.go
@@ -21,6 +21,7 @@ import (
"testing"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
)
@@ -40,7 +41,7 @@ func TestUpdateLeaks(t *testing.T) {
obj.SetState(common.BytesToHash([]byte{i, i, i}), common.BytesToHash([]byte{i, i, i, i}))
}
if i%3 == 0 {
- obj.SetCode([]byte{i, i, i, i, i})
+ obj.SetCode(crypto.Keccak256Hash([]byte{i, i, i, i, i}), []byte{i, i, i, i, i})
}
state.UpdateStateObject(obj)
}
@@ -70,7 +71,7 @@ func TestIntermediateLeaks(t *testing.T) {
obj.SetState(common.BytesToHash([]byte{i, i, i, 0}), common.BytesToHash([]byte{i, i, i, i, 0}))
}
if i%3 == 0 {
- obj.SetCode([]byte{i, i, i, i, i, 0})
+ obj.SetCode(crypto.Keccak256Hash([]byte{i, i, i, i, i, 0}), []byte{i, i, i, i, i, 0})
}
transState.UpdateStateObject(obj)
@@ -82,7 +83,7 @@ func TestIntermediateLeaks(t *testing.T) {
obj.SetState(common.BytesToHash([]byte{i, i, i, 1}), common.BytesToHash([]byte{i, i, i, i, 1}))
}
if i%3 == 0 {
- obj.SetCode([]byte{i, i, i, i, i, 1})
+ obj.SetCode(crypto.Keccak256Hash([]byte{i, i, i, i, i, 1}), []byte{i, i, i, i, i, 1})
}
transState.UpdateStateObject(obj)
@@ -94,7 +95,7 @@ func TestIntermediateLeaks(t *testing.T) {
obj.SetState(common.BytesToHash([]byte{i, i, i, 1}), common.BytesToHash([]byte{i, i, i, i, 1}))
}
if i%3 == 0 {
- obj.SetCode([]byte{i, i, i, i, i, 1})
+ obj.SetCode(crypto.Keccak256Hash([]byte{i, i, i, i, i, 1}), []byte{i, i, i, i, i, 1})
}
finalState.UpdateStateObject(obj)
}