diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-10-01 21:58:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-01 21:58:49 +0800 |
commit | 0731b44809f72ed5880dc3654ee70ae85420bd77 (patch) | |
tree | 68eb52c91a136e820f3656e394847c4e695afa63 /core/state/state_test.go | |
parent | d8715fba1a366944a069397775fc52a30358eff3 (diff) | |
parent | cb84e3f02953f2df166ae69369d222dcbbd7d78d (diff) | |
download | go-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/state_test.go')
-rw-r--r-- | core/state/state_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/state/state_test.go b/core/state/state_test.go index fcdc38588..5fe98939b 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -24,6 +24,7 @@ import ( checker "gopkg.in/check.v1" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" ) @@ -40,7 +41,7 @@ func (s *StateSuite) TestDump(c *checker.C) { obj1 := s.state.GetOrNewStateObject(toAddr([]byte{0x01})) obj1.AddBalance(big.NewInt(22)) obj2 := s.state.GetOrNewStateObject(toAddr([]byte{0x01, 0x02})) - obj2.SetCode([]byte{3, 3, 3, 3, 3, 3, 3}) + obj2.SetCode(crypto.Keccak256Hash([]byte{3, 3, 3, 3, 3, 3, 3}), []byte{3, 3, 3, 3, 3, 3, 3}) obj3 := s.state.GetOrNewStateObject(toAddr([]byte{0x02})) obj3.SetBalance(big.NewInt(44)) @@ -148,7 +149,7 @@ func TestSnapshot2(t *testing.T) { so0 := state.GetStateObject(stateobjaddr0) so0.SetBalance(big.NewInt(42)) so0.SetNonce(43) - so0.SetCode([]byte{'c', 'a', 'f', 'e'}) + so0.SetCode(crypto.Keccak256Hash([]byte{'c', 'a', 'f', 'e'}), []byte{'c', 'a', 'f', 'e'}) so0.remove = false so0.deleted = false state.SetStateObject(so0) @@ -160,7 +161,7 @@ func TestSnapshot2(t *testing.T) { so1 := state.GetStateObject(stateobjaddr1) so1.SetBalance(big.NewInt(52)) so1.SetNonce(53) - so1.SetCode([]byte{'c', 'a', 'f', 'e', '2'}) + so1.SetCode(crypto.Keccak256Hash([]byte{'c', 'a', 'f', 'e', '2'}), []byte{'c', 'a', 'f', 'e', '2'}) so1.remove = true so1.deleted = true state.SetStateObject(so1) |