libp2p-kad-dht
Advanced tools
Comparing version 0.18.0 to 0.18.1
@@ -0,1 +1,11 @@ | ||
<a name="0.18.1"></a> | ||
## [0.18.1](https://github.com/libp2p/js-libp2p-kad-dht/compare/v0.18.0...v0.18.1) (2019-12-05) | ||
### Bug Fixes | ||
* find providers should yield when found locally ([#160](https://github.com/libp2p/js-libp2p-kad-dht/issues/160)) ([e40834a](https://github.com/libp2p/js-libp2p-kad-dht/commit/e40834a)) | ||
<a name="0.18.0"></a> | ||
@@ -2,0 +12,0 @@ # [0.18.0](https://github.com/libp2p/js-libp2p-kad-dht/compare/v0.17.1...v0.18.0) (2019-11-30) |
{ | ||
"name": "libp2p-kad-dht", | ||
"version": "0.18.0", | ||
"version": "0.18.1", | ||
"description": "JavaScript implementation of the Kad-DHT for libp2p", | ||
@@ -5,0 +5,0 @@ "leadMaintainer": "Vasco Santos <vasco.santos@moxy.studio>", |
@@ -94,3 +94,7 @@ 'use strict' | ||
if (out.length >= n) { | ||
return out.toArray() | ||
// yield values | ||
for (const pInfo of out.toArray()) { | ||
yield pInfo | ||
} | ||
return | ||
} | ||
@@ -97,0 +101,0 @@ |
@@ -487,2 +487,19 @@ /* eslint-env mocha */ | ||
}) | ||
it('find one provider locally', async function () { | ||
this.timeout(20 * 1000) | ||
const val = values[0] | ||
const tdht = new TestDHT() | ||
const [dht] = await tdht.spawn(1) | ||
sinon.stub(dht.providers, 'getProviders').returns([dht.peerInfo.id]) | ||
// Find provider | ||
const res = await all(dht.findProviders(val.cid, { maxNumProviders: 1 })) | ||
expect(res).to.exist() | ||
expect(res).to.have.length(1) | ||
return tdht.teardown() | ||
}) | ||
}) | ||
@@ -489,0 +506,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2026080
8422