aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Jentzsch <jentzsch.software@gmail.com>2014-11-04 00:53:29 +0800
committerChristoph Jentzsch <jentzsch.software@gmail.com>2014-11-04 00:53:29 +0800
commitc931e3ceec902c31734fe6e7143a209d7637611f (patch)
tree5cbdae45a37d3104e8c3d1567f1ab75a107010e9
parent72c7132a3af9836c34b350fa295e34959bacce87 (diff)
downloaddexon-solidity-c931e3ceec902c31734fe6e7143a209d7637611f.tar.gz
dexon-solidity-c931e3ceec902c31734fe6e7143a209d7637611f.tar.zst
dexon-solidity-c931e3ceec902c31734fe6e7143a209d7637611f.zip
style
-rw-r--r--TestHelper.cpp3
-rw-r--r--TestHelper.h10
-rw-r--r--state.cpp13
3 files changed, 1 insertions, 25 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index 6f4b21e5..68fdd748 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -67,7 +67,6 @@ namespace test
ImportTest::ImportTest(json_spirit::mObject& _o, bool isFiller):m_TestObject(_o)
{
-
importEnv(_o["env"].get_obj());
importState(_o["pre"].get_obj(), m_statePre);
importTransaction(_o["transaction"].get_obj());
@@ -111,7 +110,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));
@@ -120,7 +118,6 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state)
toInt(o["nonce"]);
if (toHex(code).size())
{
- cout << "address: " << address << "has code: " << toHex(code) << endl;
_state.m_cache[address] = Account(toInt(o["balance"]), Account::ContractConception);
i.second.get_obj()["code"] = "0x" + toHex(code); //preperation for export
_state.m_cache[address].setCode(bytesConstRef(&code));
diff --git a/TestHelper.h b/TestHelper.h
index 9187196d..d7ffe5cb 100644
--- a/TestHelper.h
+++ b/TestHelper.h
@@ -52,28 +52,18 @@ public:
void importState(json_spirit::mObject& _o, eth::State& _state);
void importTransaction(json_spirit::mObject& _o);
void exportTest(bytes _output, eth::State& _statePost);
- eth::Manifest* getManifest(){ return &m_manifest;}
eth::State m_statePre;
eth::State m_statePost;
eth::ExtVMFace m_environment;
- u256 gas;
- u256 gasExec;
eth::Transaction m_transaction;
- bytes output;
- eth::Manifest m_manifest;
-
bytes code;
private:
json_spirit::mObject& m_TestObject;
-
- // needed for const ref
- bytes data;
};
// helping functions
-
u256 toInt(json_spirit::mValue const& _v);
byte toByte(json_spirit::mValue const& _v);
bytes importCode(json_spirit::mObject &_o);
diff --git a/state.cpp b/state.cpp
index e3a91a3a..3a81821e 100644
--- a/state.cpp
+++ b/state.cpp
@@ -55,7 +55,7 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
BOOST_REQUIRE(o.count("pre") > 0);
BOOST_REQUIRE(o.count("transaction") > 0);
- ImportTest importer(o,_fillin);
+ ImportTest importer(o, _fillin);
if (_fillin)
{
@@ -64,20 +64,9 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
}
State theState = importer.m_statePre;
-
bytes tx = importer.m_transaction.rlp();
-
bytes output;
- // check
-
- for (auto const& a: theState.addresses())
- {
- cout << "address: " << a.first << endl;
- cout << "balance: " << theState.balance(a.first) << endl;
- cout << "has code: " << theState.addressHasCode(a.first) << endl;
- }
-
try
{
theState.execute(tx, &output);