diff options
author | winsvega <winsvega@mail.ru> | 2015-03-27 06:05:45 +0800 |
---|---|---|
committer | winsvega <winsvega@mail.ru> | 2015-04-08 02:32:32 +0800 |
commit | adba4fb9a136ec27d6fc3e295c43a6f0f04ae865 (patch) | |
tree | d756119f64a5a69dd4edab5424b91126b8185bad /TestHelper.h | |
parent | b0c8babf0e76ffa1fc5cb21642f3ac2fc3d1cb55 (diff) | |
download | dexon-solidity-adba4fb9a136ec27d6fc3e295c43a6f0f04ae865.tar dexon-solidity-adba4fb9a136ec27d6fc3e295c43a6f0f04ae865.tar.gz dexon-solidity-adba4fb9a136ec27d6fc3e295c43a6f0f04ae865.tar.bz2 dexon-solidity-adba4fb9a136ec27d6fc3e295c43a6f0f04ae865.tar.lz dexon-solidity-adba4fb9a136ec27d6fc3e295c43a6f0f04ae865.tar.xz dexon-solidity-adba4fb9a136ec27d6fc3e295c43a6f0f04ae865.tar.zst dexon-solidity-adba4fb9a136ec27d6fc3e295c43a6f0f04ae865.zip |
Check State
Incomplete State Support
Diffstat (limited to 'TestHelper.h')
-rw-r--r-- | TestHelper.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/TestHelper.h b/TestHelper.h index b4002aeb..81251649 100644 --- a/TestHelper.h +++ b/TestHelper.h @@ -97,6 +97,17 @@ namespace test } \ while (0) +struct ImportStateOptions +{ + ImportStateOptions():m_bHasBalance(false), m_bHasNonce(false), m_bHasCode(false), m_bHasStorage(false) {} + ImportStateOptions(bool _bSetAll):m_bHasBalance(_bSetAll), m_bHasNonce(_bSetAll), m_bHasCode(_bSetAll), m_bHasStorage(_bSetAll) {} + bool isAllSet() {return m_bHasBalance && m_bHasNonce && m_bHasCode && m_bHasStorage;} + bool m_bHasBalance; + bool m_bHasNonce; + bool m_bHasCode; + bool m_bHasStorage; +}; +typedef std::map<Address, ImportStateOptions> stateOptionsMap; class ImportTest { @@ -106,9 +117,12 @@ public: // imports void importEnv(json_spirit::mObject& _o); static void importState(json_spirit::mObject& _o, eth::State& _state); + static void importState(json_spirit::mObject& _o, eth::State& _state, stateOptionsMap& _stateOptionsMap); void importTransaction(json_spirit::mObject& _o); + void exportTest(bytes const& _output, eth::State const& _statePost); static void checkExpectedState(eth::State const& _stateExpect, eth::State const& _statePost, WhenError _throw = WhenError::Throw); + static void checkExpectedState(eth::State const& _stateExpect, eth::State const& _statePost, stateOptionsMap const& _expectedStateOptions, WhenError _throw = WhenError::Throw); eth::State m_statePre; eth::State m_statePost; |