Skip to content

Commit 415d40c

Browse files
committed
fix dht.query command and thus dht test
1 parent 2556768 commit 415d40c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/io/ipfs/api/IPFS.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ public Map findprovs(Multihash hash) throws IOException {
397397
return retrieveMap("dht/findprovs?arg=" + hash);
398398
}
399399

400-
public Map query(MultiAddress addr) throws IOException {
401-
return retrieveMap("dht/query?arg=" + addr.toString());
400+
public Map query(Multihash peerId) throws IOException {
401+
return retrieveMap("dht/query?arg=" + peerId.toString());
402402
}
403403

404404
public Map findpeer(Multihash id) throws IOException {

src/test/java/io/ipfs/api/APITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ public void dhtTest() throws IOException {
613613
Map put = ipfs.dht.put("somekey", "somevalue");
614614
Map findprovs = ipfs.dht.findprovs(pointer);
615615
List<Peer> peers = ipfs.swarm.peers();
616-
Map query = ipfs.dht.query(peers.get(0).address);
616+
Map query = ipfs.dht.query(peers.get(0).id);
617617
Map find = ipfs.dht.findpeer(peers.get(0).id);
618618
}
619619

0 commit comments

Comments
 (0)