aboutsummaryrefslogtreecommitdiffstats
path: root/net.cpp
diff options
context:
space:
mode:
authorsubtly <subtly@users.noreply.github.com>2015-01-31 09:53:27 +0800
committersubtly <subtly@users.noreply.github.com>2015-01-31 09:53:27 +0800
commitf4233598c1f731a6c904450c4a003d8cf7561ee4 (patch)
tree38d360ac3ace42716a1d6cd7db3ac96cf24b2200 /net.cpp
parent29de01b458401615d56a8c9ebbda5e0c7805e9eb (diff)
downloaddexon-solidity-f4233598c1f731a6c904450c4a003d8cf7561ee4.tar
dexon-solidity-f4233598c1f731a6c904450c4a003d8cf7561ee4.tar.gz
dexon-solidity-f4233598c1f731a6c904450c4a003d8cf7561ee4.tar.bz2
dexon-solidity-f4233598c1f731a6c904450c4a003d8cf7561ee4.tar.lz
dexon-solidity-f4233598c1f731a6c904450c4a003d8cf7561ee4.tar.xz
dexon-solidity-f4233598c1f731a6c904450c4a003d8cf7561ee4.tar.zst
dexon-solidity-f4233598c1f731a6c904450c4a003d8cf7561ee4.zip
import/export peers and nodes
Diffstat (limited to 'net.cpp')
-rw-r--r--net.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/net.cpp b/net.cpp
index 67c50dae..7f30ed03 100644
--- a/net.cpp
+++ b/net.cpp
@@ -30,7 +30,7 @@ using namespace dev::p2p;
namespace ba = boost::asio;
namespace bi = ba::ip;
-BOOST_AUTO_TEST_SUITE(p2p)
+BOOST_AUTO_TEST_SUITE(net)
/**
* Only used for testing. Not useful beyond tests.
@@ -190,6 +190,9 @@ 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;
@@ -199,6 +202,12 @@ BOOST_AUTO_TEST_CASE(kademlia)
node.nodeTable->join();
this_thread::sleep_for(chrono::milliseconds(2000));
clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
+
+ BOOST_REQUIRE_EQUAL(node.nodeTable->size(), 8);
+
+ auto netNodes = node.nodeTable->nodes();
+ netNodes.sort();
+
}
BOOST_AUTO_TEST_CASE(test_udp_once)