mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix import state for state tests
Conflicts: test/TestHelper.cpp
This commit is contained in:
parent
fe21a5c67e
commit
7f9f847c27
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user