aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.cpp
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2014-12-13 04:21:18 +0800
committerCJentzsch <jentzsch.software@gmail.com>2014-12-13 04:21:18 +0800
commit7f9f847c276083203fbb3e0884f53870260b6e59 (patch)
tree61939b2464932f5371110284ad5cad35b9938f82 /TestHelper.cpp
parentfe21a5c67e77771ed43cb7ef58de1d3b9a9ce8cb (diff)
downloaddexon-solidity-7f9f847c276083203fbb3e0884f53870260b6e59.tar.gz
dexon-solidity-7f9f847c276083203fbb3e0884f53870260b6e59.tar.zst
dexon-solidity-7f9f847c276083203fbb3e0884f53870260b6e59.zip
Fix import state for state tests
Conflicts: test/TestHelper.cpp
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r--TestHelper.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index ff8a0d40..e8940cc7 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -109,9 +109,6 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state)
Address address = Address(i.first);
- for (auto const& j: o["storage"].get_obj())
- _state.setStorage(address, toInt(j.first), toInt(j.second));
-
bytes code = importCode(o);
if (code.size())
@@ -122,6 +119,9 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state)
else
_state.m_cache[address] = Account(toInt(o["balance"]), Account::NormalCreation);
+ for (auto const& j: o["storage"].get_obj())
+ _state.setStorage(address, toInt(j.first), toInt(j.second));
+
for(int i=0; i<toInt(o["nonce"]); ++i)
_state.noteSending(address);
@@ -329,7 +329,7 @@ void checkStorage(map<u256, u256> _expectedStore, map<u256, u256> _resultStore,
BOOST_CHECK_MESSAGE(expectedStoreValue == resultStoreValue, _expectedAddr << ": store[" << expectedStoreKey << "] = " << resultStoreValue << ", expected " << expectedStoreValue);
}
}
-
+ BOOST_CHECK_EQUAL(_resultStore.size(), _expectedStore.size());
for (auto&& resultStorePair : _resultStore)
if (!_expectedStore.count(resultStorePair.first))
BOOST_ERROR(_expectedAddr << ": unexpected store key " << resultStorePair.first);