| 29 | using namespace std; |
| 30 | |
| 31 | ImportTest::ImportTest(json_spirit::mObject& _o, bool isFiller, testType testTemplate): |
| 32 | m_statePre(0, OverlayDB(), eth::BaseState::Empty), |
| 33 | m_statePost(0, OverlayDB(), eth::BaseState::Empty), |
| 34 | m_testObject(_o), |
| 35 | m_testType(testTemplate) |
| 36 | { |
| 37 | if (testTemplate == testType::StateTests || m_testType == testType::GeneralStateTest) |
| 38 | { |
| 39 | importEnv(_o["env"].get_obj()); |
| 40 | importTransaction(_o["transaction"].get_obj()); |
| 41 | importState(_o["pre"].get_obj(), m_statePre); |
| 42 | if (!isFiller && m_testType == testType::StateTests) |
| 43 | { |
| 44 | if (_o.count("post")) |
| 45 | importState(_o["post"].get_obj(), m_statePost); |
| 46 | else |
| 47 | importState(_o["postState"].get_obj(), m_statePost); |
| 48 | m_logsExpected = importLog(_o["logs"].get_array()); |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | bytes ImportTest::executeTest() |
| 54 | { |