Skip to content

Commit

Permalink
Add Identify to more tests that need it
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Jul 13, 2023
1 parent 45d1683 commit 3b46a22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/java/org/peergos/FindPeerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.libp2p.core.multiformats.*;
import org.junit.*;
import org.peergos.blockstore.*;
import org.peergos.protocol.*;
import org.peergos.protocol.dht.*;

import java.util.*;
Expand All @@ -19,6 +20,7 @@ public void findLongRunningNode() {
new RamProviderStore(), new RamRecordStore(), blockstore1, (c, b, p, a) -> CompletableFuture.completedFuture(true));
Host node1 = builder1.build();
node1.start().join();
IdentifyBuilder.addIdentifyProtocol(node1);

try {
// bootstrap node 1
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/org/peergos/PingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.libp2p.protocol.*;
import org.junit.*;
import org.peergos.blockstore.*;
import org.peergos.protocol.*;
import org.peergos.protocol.bitswap.*;

import java.util.*;
Expand Down Expand Up @@ -39,7 +40,9 @@ public void replyIdentifyOnNewDial() {
Host node1 = HostBuilder.build(TestPorts.getPort(), List.of(new Ping(), new Bitswap(new BitswapEngine(new RamBlockstore(), (c, b, p, a) -> CompletableFuture.completedFuture(true)))));
Host node2 = HostBuilder.build(TestPorts.getPort(), List.of(new Ping(), new Bitswap(new BitswapEngine(new RamBlockstore(), (c, b, p, a) -> CompletableFuture.completedFuture(true)))));
node1.start().join();
IdentifyBuilder.addIdentifyProtocol(node1);
node2.start().join();
IdentifyBuilder.addIdentifyProtocol(node2);
try {
// ping from 1 to 2
Multiaddr address2 = node2.listenAddresses().get(0);
Expand Down

0 comments on commit 3b46a22

Please sign in to comment.