mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Connectivity and nodetable callbacks. Disable stale code.
This commit is contained in:
parent
feb4288b27
commit
01ecadd74e
23
peer.cpp
23
peer.cpp
@ -20,6 +20,7 @@
|
||||
* Peer Network test functions.
|
||||
*/
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <libp2p/Host.h>
|
||||
@ -27,6 +28,28 @@ using namespace std;
|
||||
using namespace dev;
|
||||
using namespace dev::p2p;
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(p2p)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(host)
|
||||
{
|
||||
NetworkPreferences host1prefs(30301, "127.0.0.1", true, true);
|
||||
NetworkPreferences host2prefs(30302, "127.0.0.1", true, true);
|
||||
|
||||
Host host1("Test", host1prefs);
|
||||
NodeId node1 = host1.id();
|
||||
host1.start();
|
||||
|
||||
Host host2("Test", host2prefs);
|
||||
auto node2 = host2.id();
|
||||
host2.start();
|
||||
|
||||
host1.addNode(node2, "127.0.0.1", host2prefs.listenPort, host2prefs.listenPort);
|
||||
|
||||
this_thread::sleep_for(chrono::seconds(2));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
int peerTest(int argc, char** argv)
|
||||
{
|
||||
short listenPort = 30303;
|
||||
|
Loading…
Reference in New Issue
Block a user