diff options
author | winsvega <winsvega@mail.ru> | 2015-04-06 22:40:01 +0800 |
---|---|---|
committer | winsvega <winsvega@mail.ru> | 2015-04-08 02:32:32 +0800 |
commit | 44405625f2b011dc1dddf4c05342e89d5539ba5b (patch) | |
tree | 7aa9de60ce30ed7863d062cb170d00d1e76503a0 | |
parent | c38c8bb5676d39f52a1aef4f41b01c252a94e5ca (diff) | |
download | dexon-solidity-44405625f2b011dc1dddf4c05342e89d5539ba5b.tar.gz dexon-solidity-44405625f2b011dc1dddf4c05342e89d5539ba5b.tar.zst dexon-solidity-44405625f2b011dc1dddf4c05342e89d5539ba5b.zip |
Check State
Style + Rebase
-rw-r--r-- | TestHelper.cpp | 14 | ||||
-rw-r--r-- | vm.cpp | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp index 80722465..94751c1e 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -115,14 +115,14 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state, stateOptio json_spirit::mObject o = i.second.get_obj(); ImportStateOptions stateOptions; - u256 iBalance = 0, iNonce = 0; + u256 balance = 0, nonce = 0; if (o.count("balance") > 0) { stateOptions.m_bHasBalance = true; if (bigint(o["balance"].get_str()) >= c_max256plus1) BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("State 'balance' is equal or greater than 2**256") ); - iBalance = toInt(o["balance"]); + balance = toInt(o["balance"]); } if (o.count("nonce") > 0) @@ -130,7 +130,7 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state, stateOptio stateOptions.m_bHasNonce = true; if (bigint(o["nonce"].get_str()) >= c_max256plus1) BOOST_THROW_EXCEPTION(ValueTooLarge() << errinfo_comment("State 'nonce' is equal or greater than 2**256") ); - iNonce = toInt(o["nonce"]); + nonce = toInt(o["nonce"]); } Address address = Address(i.first); @@ -144,11 +144,11 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state, stateOptio if (code.size()) { - _state.m_cache[address] = Account(iBalance, Account::ContractConception); + _state.m_cache[address] = Account(balance, Account::ContractConception); _state.m_cache[address].setCode(code); } else - _state.m_cache[address] = Account(iBalance, Account::NormalCreation); + _state.m_cache[address] = Account(balance, Account::NormalCreation); if (o.count("storage") > 0) { @@ -157,7 +157,7 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state, stateOptio _state.setStorage(address, toInt(j.first), toInt(j.second)); } - for (int i=0; i < iNonce; ++i) + for (int i = 0; i < nonce; ++i) _state.noteSending(address); _state.ensureCached(address, false, false); @@ -275,7 +275,7 @@ void ImportTest::exportTest(bytes const& _output, State const& _statePost) if (m_TestObject.count("expect") > 0) { stateOptionsMap stateMap; - State expectState(Address(), OverlayDB(), eth::BaseState::Empty); + State expectState(OverlayDB(), eth::BaseState::Empty); importState(m_TestObject["expect"].get_obj(), expectState, stateMap); checkExpectedState(expectState, _statePost, stateMap, Options::get().checkState ? WhenError::Throw : WhenError::DontThrow); m_TestObject.erase(m_TestObject.find("expect")); @@ -390,8 +390,8 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) if (o.count("expect") > 0) { - State postState(Address(), OverlayDB(), eth::BaseState::Empty); - State expectState(Address(), OverlayDB(), eth::BaseState::Empty); + State postState(OverlayDB(), eth::BaseState::Empty); + State expectState(OverlayDB(), eth::BaseState::Empty); stateOptionsMap expectStateMap; ImportTest::importState(o["post"].get_obj(), postState); ImportTest::importState(o["expect"].get_obj(), expectState, expectStateMap); |