aboutsummaryrefslogtreecommitdiffstats
path: root/blockchain.cpp
diff options
context:
space:
mode:
authorwinsvega <winsvega@mail.ru>2015-04-11 01:49:29 +0800
committerwinsvega <winsvega@mail.ru>2015-04-13 17:20:12 +0800
commit47849db473e8ed71281209823c6c2823931f0462 (patch)
tree8936ef388bb19ac5f74234ba528e2eacc6a1625e /blockchain.cpp
parente54952c8cf718fb1b7af853bead145292c7f25db (diff)
downloaddexon-solidity-47849db473e8ed71281209823c6c2823931f0462.tar
dexon-solidity-47849db473e8ed71281209823c6c2823931f0462.tar.gz
dexon-solidity-47849db473e8ed71281209823c6c2823931f0462.tar.bz2
dexon-solidity-47849db473e8ed71281209823c6c2823931f0462.tar.lz
dexon-solidity-47849db473e8ed71281209823c6c2823931f0462.tar.xz
dexon-solidity-47849db473e8ed71281209823c6c2823931f0462.tar.zst
dexon-solidity-47849db473e8ed71281209823c6c2823931f0462.zip
Check State: Block Test + Transaction
Diffstat (limited to 'blockchain.cpp')
-rw-r--r--blockchain.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/blockchain.cpp b/blockchain.cpp
index b225d313..23bfd665 100644
--- a/blockchain.cpp
+++ b/blockchain.cpp
@@ -53,6 +53,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
BOOST_REQUIRE(o.count("pre"));
ImportTest importer(o["pre"].get_obj());
State state(OverlayDB(), BaseState::Empty, biGenesisBlock.coinbaseAddress);
+ State stateTemp(OverlayDB(), BaseState::Empty, biGenesisBlock.coinbaseAddress);
importer.importState(o["pre"].get_obj(), state);
o["pre"] = fillJsonWithState(state);
state.commit();
@@ -89,7 +90,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
for (auto const& bl: o["blocks"].get_array())
{
mObject blObj = bl.get_obj();
-
+ stateTemp = state;
// get txs
TransactionQueue txs;
ZeroGasPricer gp;
@@ -180,7 +181,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
}
uncleHeaderObj_pre = uncleHeaderObj;
- }
+ } //for blObj["uncleHeaders"].get_array()
blObj["uncleHeaders"] = aUncleList;
bc.sync(uncleBlockQueue, state.db(), 4);
@@ -288,11 +289,10 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
blObj.erase(blObj.find("blockHeader"));
blObj.erase(blObj.find("uncleHeaders"));
blObj.erase(blObj.find("transactions"));
- state = State(OverlayDB(), BaseState::Empty, biGenesisBlock.coinbaseAddress);
- importer.importState(o["pre"].get_obj(), state);
+ state = stateTemp; //revert state as if it was before executing this block
}
blArray.push_back(blObj);
- }
+ } //for blocks
if (o.count("expect") > 0)
{