22 Commits

Author SHA1 Message Date
ljedrz
4599fff709 feat: introduce a custom error for the Multiaddr wrappers
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-18 15:59:51 +02:00
ljedrz
6e8dff0bb7 feat: utilize the new Multiaddr wrappers 2020-08-17 15:51:26 +02:00
ljedrz
2c4fbe8c1b fix: remove Ipfs::peer_id, add a connection test, dont add Protocol::P2p in IpfsEvents
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-17 09:01:49 +02:00
ljedrz
993b80d2d1 fix: disallow Multiaddrs without the P2p protocol
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-14 16:19:56 +02:00
ljedrz
c930f651fd test: make async tests use only 1 thread
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:16:20 +02:00
ljedrz
398aa58877 chore: import reordering with cargo fmt
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:15:45 +02:00
ljedrz
8be75f7a4a feat: change the async executor to tokio
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:15:14 +02:00
ljedrz
50dd210719 test: tweak two node connection tests
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-12 12:04:15 +02:00
ljedrz
a0b777d542 fix: ignore connect_two_nodes_by_peer_id, add relevant comments
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-12 11:13:00 +02:00
ljedrz
58a966a24a feat: test duplicate connection attempts
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-12 10:04:04 +02:00
Joonas Koivunen
3e2554aa47 fix: add timeouts to connect_two tests
gha windows was stuck on this. it's not nice since we cannot see any
testing output before the run is cancelled.
2020-08-06 17:20:47 +03:00
ljedrz
38b39747bb feat: introduce the means to connect by PeerId
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-03 14:24:01 +02:00
ljedrz
0abe1b4aa4 refactor: improve node init in some tests
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 15:59:14 +02:00
ljedrz
0140c673b8 feat: attach tracing to nodes
Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 14:53:38 +02:00
Caio
e42b88c6a6 Use async macro for tests 2020-07-27 13:00:40 -03:00
ljedrz
ff1765ba10 fix: remove unused params in Node::new and IpfsOptions::inmemory_with_generated_keys
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-22 15:35:25 +02:00
ljedrz
3bb0a65e04 feat: add and test peer discovery
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-22 12:00:56 +02:00
Joonas Koivunen
7799d888f6
Upgrade libp2p 0.19.0 (#169)
* chore: upgrade the libp2p to 0.18.(0|1)
* refactor: fix most of the swarm with todos

mainly leaving the multiple connections case to panic.

* feat: add ability to configure listening addr

the original random listening address is still in place.

* add test case for the panic with two connections

* fix: allow multiple connections in p2p/swarm
* doc: Connection and the any connecting address
* chore: cleanup libp2p patching examples

* refactor: rename SwarmApi::stats

perhaps roundtrip_times is more readable.

* chore: upgrade to libp2p 0.19

* fix: awaiting for binding new listening addresses

the initial implementation didn't actually wait for anything other than
asking the swarm to start listening, but now the await will complete
only after a listening address has actually been bound. this required
some nasty matching on the multiaddr protocol parts which will hopefully
ever be used by test code but ... it works now, at least a bit better.

* fix test on macos, fix unspecified addr handling
2020-05-19 17:26:57 +03:00
Joonas Koivunen
512c34a8d5 chore: cargo fmt 2020-03-22 16:43:55 +02:00
Joonas Koivunen
4829f0133e refactor: minor cleanup in tests and swarm 2020-03-22 16:42:47 +02:00
Joonas Koivunen
90bf986b24 wip: use println instead of log in test 2020-03-22 15:44:35 +02:00
Joonas Koivunen
cd7a416528 add: test case for connecting two nodes
this currently fails because the identify query is executed before
network of swarm is ready, or is even polled the first time.
2020-03-22 15:00:12 +02:00