aboutsummaryrefslogtreecommitdiffstats
path: root/core/state/state_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-09-19 09:20:14 +0800
committerGitHub <noreply@github.com>2016-09-19 09:20:14 +0800
commit88b012ad3b470391ba5bfb99da3775bde775e915 (patch)
tree61794fd37f5c484efdf8af0eab16c9b3351f6cb9 /core/state/state_test.go
parent7c12e8ea44129a5f9caa4d5ca9168c059436bb39 (diff)
parent581b320b9dfb42c0c4842e0bc5aeb507267a8eba (diff)
downloaddexon-88b012ad3b470391ba5bfb99da3775bde775e915.tar.gz
dexon-88b012ad3b470391ba5bfb99da3775bde775e915.tar.zst
dexon-88b012ad3b470391ba5bfb99da3775bde775e915.zip
Merge pull request #3006 from Arachnid/patch
core/state: Fix memory expansion bug by not copying clean objects
Diffstat (limited to 'core/state/state_test.go')
-rw-r--r--core/state/state_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/state/state_test.go b/core/state/state_test.go
index ce86a5b76..5a6cb0b50 100644
--- a/core/state/state_test.go
+++ b/core/state/state_test.go
@@ -149,10 +149,11 @@ func TestSnapshot2(t *testing.T) {
so0.balance = big.NewInt(42)
so0.nonce = 43
so0.SetCode([]byte{'c', 'a', 'f', 'e'})
- so0.remove = true
+ so0.remove = false
so0.deleted = false
- so0.dirty = false
+ so0.dirty = true
state.SetStateObject(so0)
+ state.Commit()
// and one with deleted == true
so1 := state.GetStateObject(stateobjaddr1)
@@ -173,6 +174,7 @@ func TestSnapshot2(t *testing.T) {
state.Set(snapshot)
so0Restored := state.GetStateObject(stateobjaddr0)
+ so0Restored.GetState(storageaddr)
so1Restored := state.GetStateObject(stateobjaddr1)
// non-deleted is equal (restored)
compareStateObjects(so0Restored, so0, t)