Skip to content

Commit

Permalink
Fix another corner case in JSON test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashatyrev committed Nov 17, 2015
1 parent ec1d098 commit e11c71c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
@@ -1,6 +1,7 @@
package org.ethereum.core;

import org.ethereum.db.BlockStore;
import org.ethereum.db.ContractDetails;
import org.ethereum.listener.EthereumListener;
import org.ethereum.listener.EthereumListenerAdapter;
import org.ethereum.vm.*;
Expand Down Expand Up @@ -222,6 +223,13 @@ private void create() {

this.vm = new VM();
this.program = new Program(tx.getData(), programInvoke, tx);

// reset storage if the contract with the same address already exists
// TCK test case only - normally this is near-impossible situation in the real network
ContractDetails contractDetails = program.getStorage().getContractDetails(newContractAddress);
for (DataWord key : contractDetails.getStorageKeys()) {
program.storageSave(key, DataWord.ZERO);
}
}

BigInteger endowment = toBI(tx.getValue());
Expand Down
Expand Up @@ -41,7 +41,6 @@ public void stExample() throws ParseException, IOException {
public void stCallCreateCallCodeTest() throws ParseException, IOException {

Set<String> excluded = new HashSet<>();
excluded.add("createJS_ExampleContract"); //FIXME Bug on CPP testrunner, storage/SSTORE
String json = JSONReader.loadJSONFromCommit("StateTests/stCallCreateCallCodeTest.json", shacommit);
GitHubJSONTestSuite.runStateTest(json, excluded);
}
Expand Down

0 comments on commit e11c71c

Please sign in to comment.