From 44405625f2b011dc1dddf4c05342e89d5539ba5b Mon Sep 17 00:00:00 2001 From: winsvega Date: Mon, 6 Apr 2015 17:40:01 +0300 Subject: [PATCH] Check State Style + Rebase --- TestHelper.cpp | 14 +++++++------- vm.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/TestHelper.cpp b/TestHelper.cpp index 80722465c..94751c1ec 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")); diff --git a/vm.cpp b/vm.cpp index a36a57070..d92989133 100644 --- a/vm.cpp +++ b/vm.cpp @@ -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);