aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhuntley <jhuntley@houghtonassociates.com>2015-02-27 05:05:53 +0800
committerjhuntley <jhuntley@houghtonassociates.com>2015-03-05 00:18:32 +0800
commite229b5d291eefbf05e77988149d3ba2dc0059575 (patch)
treea8bf8cf138f206f8d37dcc1429b0e4e65ab0e126
parent5ae585f7cf21ae281f564d0edbad1251129f256d (diff)
downloaddexon-solidity-e229b5d291eefbf05e77988149d3ba2dc0059575.tar
dexon-solidity-e229b5d291eefbf05e77988149d3ba2dc0059575.tar.gz
dexon-solidity-e229b5d291eefbf05e77988149d3ba2dc0059575.tar.bz2
dexon-solidity-e229b5d291eefbf05e77988149d3ba2dc0059575.tar.lz
dexon-solidity-e229b5d291eefbf05e77988149d3ba2dc0059575.tar.xz
dexon-solidity-e229b5d291eefbf05e77988149d3ba2dc0059575.tar.zst
dexon-solidity-e229b5d291eefbf05e77988149d3ba2dc0059575.zip
Revert all asio.h includes except for in 2 files, DebuggingStateWrapper.h and Transact.cpp. After enabling WIN32_LEAN_AND_MEAN, all the asio.h include issues, commit 20b6e24ffcab088e71092e07030a377d3135da3c, went away.
-rw-r--r--TestHelper.cpp2
-rw-r--r--TestHelper.h2
-rw-r--r--checkRandomTest.cpp3
-rw-r--r--createRandomTest.cpp2
-rw-r--r--fork.cpp2
-rw-r--r--genesis.cpp4
-rw-r--r--hexPrefix.cpp2
-rw-r--r--net.cpp10
-rw-r--r--rlp.cpp2
-rw-r--r--state.cpp2
-rw-r--r--trie.cpp2
-rw-r--r--txTest.cpp2
-rw-r--r--vm.cpp2
-rw-r--r--vm.h2
-rw-r--r--whisperTopic.cpp32
15 files changed, 20 insertions, 51 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index 16f0d6d1..82add295 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -24,8 +24,6 @@
#include <thread>
#include <chrono>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/filesystem/path.hpp>
#include <libethereum/Client.h>
diff --git a/TestHelper.h b/TestHelper.h
index 40294b03..6f9143c5 100644
--- a/TestHelper.h
+++ b/TestHelper.h
@@ -23,8 +23,6 @@
#include <functional>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include "JsonSpiritHeaders.h"
diff --git a/checkRandomTest.cpp b/checkRandomTest.cpp
index f1daaecb..e3442d43 100644
--- a/checkRandomTest.cpp
+++ b/checkRandomTest.cpp
@@ -20,9 +20,6 @@
* Check a random test and return 0/1 for success or failure. To be used for efficiency in the random test simulation.
*/
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
-
#include <libdevcore/Common.h>
#include <libdevcore/Exceptions.h>
#include <libdevcore/Log.h>
diff --git a/createRandomTest.cpp b/createRandomTest.cpp
index 140a7fb3..55e02375 100644
--- a/createRandomTest.cpp
+++ b/createRandomTest.cpp
@@ -24,8 +24,6 @@
#include <iostream>
#include <chrono>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/random.hpp>
#include <boost/filesystem/path.hpp>
diff --git a/fork.cpp b/fork.cpp
index 65c5dd3b..a2eb6f4e 100644
--- a/fork.cpp
+++ b/fork.cpp
@@ -20,8 +20,6 @@
* Tests for different forking behavior
*/
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/filesystem/operations.hpp>
diff --git a/genesis.cpp b/genesis.cpp
index a450b79f..5ac3ea2a 100644
--- a/genesis.cpp
+++ b/genesis.cpp
@@ -23,8 +23,6 @@
#include <fstream>
#include <random>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include "JsonSpiritHeaders.h"
@@ -44,7 +42,7 @@ BOOST_AUTO_TEST_CASE(emptySHA3Types)
{
h256 emptyListSHA3(fromHex("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"));
BOOST_REQUIRE_EQUAL(emptyListSHA3, EmptyListSHA3);
-
+
h256 emptySHA3(fromHex("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"));
BOOST_REQUIRE_EQUAL(emptySHA3, EmptySHA3);
}
diff --git a/hexPrefix.cpp b/hexPrefix.cpp
index 5875d62f..da294ba5 100644
--- a/hexPrefix.cpp
+++ b/hexPrefix.cpp
@@ -22,8 +22,6 @@
#include <fstream>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include "JsonSpiritHeaders.h"
diff --git a/net.cpp b/net.cpp
index fafcc1ff..831c283e 100644
--- a/net.cpp
+++ b/net.cpp
@@ -19,8 +19,6 @@
* @date 2014
*/
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include <libdevcore/Worker.h>
@@ -192,22 +190,22 @@ BOOST_AUTO_TEST_CASE(kademlia)
node.populateAll();
clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
-
+
auto nodes = node.nodeTable->nodes();
nodes.sort();
-
+
node.nodeTable->reset();
clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
node.populate(1);
clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
-
+
node.nodeTable->discover();
this_thread::sleep_for(chrono::milliseconds(2000));
clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
BOOST_REQUIRE_EQUAL(node.nodeTable->count(), 8);
-
+
auto netNodes = node.nodeTable->nodes();
netNodes.sort();
diff --git a/rlp.cpp b/rlp.cpp
index fc4f858e..9062b54f 100644
--- a/rlp.cpp
+++ b/rlp.cpp
@@ -23,8 +23,6 @@
#include <fstream>
#include <sstream>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include <libdevcore/Log.h>
diff --git a/state.cpp b/state.cpp
index e2201f24..17ebe2b7 100644
--- a/state.cpp
+++ b/state.cpp
@@ -20,8 +20,6 @@
* State test functions.
*/
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/test/unit_test.hpp>
diff --git a/trie.cpp b/trie.cpp
index 31274975..dd335b4a 100644
--- a/trie.cpp
+++ b/trie.cpp
@@ -23,8 +23,6 @@
#include <fstream>
#include <random>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include "JsonSpiritHeaders.h"
diff --git a/txTest.cpp b/txTest.cpp
index 3f67c0a2..e2a16e16 100644
--- a/txTest.cpp
+++ b/txTest.cpp
@@ -20,8 +20,6 @@
* Simple peer transaction send test.
*/
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/filesystem/operations.hpp>
diff --git a/vm.cpp b/vm.cpp
index 00ba82aa..e78753e6 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -22,8 +22,6 @@
#include <chrono>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/filesystem.hpp>
#include <libethereum/Executive.h>
diff --git a/vm.h b/vm.h
index 03b3b4e5..f27bce50 100644
--- a/vm.h
+++ b/vm.h
@@ -26,8 +26,6 @@ along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
#include <fstream>
#include <cstdint>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include <json_spirit/json_spirit.h>
diff --git a/whisperTopic.cpp b/whisperTopic.cpp
index 0937ab92..0ea681b6 100644
--- a/whisperTopic.cpp
+++ b/whisperTopic.cpp
@@ -20,8 +20,6 @@
*/
#include <functional>
-// Make sure boost/asio.hpp is included before windows.h.
-#include <boost/asio.hpp>
#include <boost/test/unit_test.hpp>
#include <libp2p/Host.h>
@@ -44,10 +42,10 @@ BOOST_AUTO_TEST_CASE(topic)
Host host1("Test", NetworkPreferences(30303, "127.0.0.1", false, true));
auto whost1 = host1.registerCapability(new WhisperHost());
host1.start();
-
+
while (!host1.isStarted())
this_thread::sleep_for(chrono::milliseconds(2));
-
+
bool started = false;
unsigned result = 0;
std::thread listener([&]()
@@ -75,19 +73,19 @@ BOOST_AUTO_TEST_CASE(topic)
}
this_thread::sleep_for(chrono::milliseconds(50));
}
-
+
});
-
+
Host host2("Test", NetworkPreferences(30300, "127.0.0.1", false, true));
auto whost2 = host2.registerCapability(new WhisperHost());
host2.start();
-
+
while (!host2.isStarted())
this_thread::sleep_for(chrono::milliseconds(2));
-
+
this_thread::sleep_for(chrono::milliseconds(100));
host2.addNode(host1.id(), "127.0.0.1", 30303, 30303);
-
+
this_thread::sleep_for(chrono::milliseconds(500));
while (!started)
@@ -111,7 +109,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
cnote << "Testing Whisper forwarding...";
auto oldLogVerbosity = g_logVerbosity;
g_logVerbosity = 0;
-
+
// Host must be configured not to share peers.
Host host1("Listner", NetworkPreferences(30303, "", false, true));
host1.setIdealPeerCount(0);
@@ -119,7 +117,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
host1.start();
while (!host1.isStarted())
this_thread::sleep_for(chrono::milliseconds(2));
-
+
unsigned result = 0;
bool done = false;
@@ -146,7 +144,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
}
});
-
+
// Host must be configured not to share peers.
Host host2("Forwarder", NetworkPreferences(30305, "", false, true));
host2.setIdealPeerCount(1);
@@ -154,7 +152,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
host2.start();
while (!host2.isStarted())
this_thread::sleep_for(chrono::milliseconds(2));
-
+
Public fwderid;
bool startedForwarder = false;
std::thread forwarder([&]()
@@ -214,7 +212,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
unsigned result = 0;
bool done = false;
-
+
// Host must be configured not to share peers.
Host host1("Forwarder", NetworkPreferences(30305, "", false, true));
host1.setIdealPeerCount(1);
@@ -227,7 +225,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
std::thread forwarder([&]()
{
setThreadName("forwarder");
-
+
this_thread::sleep_for(chrono::milliseconds(500));
// ph.addNode("127.0.0.1", 30303, 30303);
@@ -249,7 +247,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
while (!startedForwarder)
this_thread::sleep_for(chrono::milliseconds(2));
-
+
{
Host host2("Sender", NetworkPreferences(30300, "", false, true));
host2.setIdealPeerCount(1);
@@ -261,7 +259,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
while (!host2.peerCount())
this_thread::sleep_for(chrono::milliseconds(5));
-
+
KeyPair us = KeyPair::create();
whost2->post(us.sec(), RLPStream().append(1).out(), BuildTopic("test"));
this_thread::sleep_for(chrono::milliseconds(250));