From f6ffc699f3d9352ac5fbb0bccb6d2ac95394921c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jan 2023 10:38:33 +0000 Subject: [PATCH 1/3] deps: bump aegir from 37.12.1 to 38.1.0 Bumps [aegir](https://github.com/ipfs/aegir) from 37.12.1 to 38.1.0. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](https://github.com/ipfs/aegir/compare/v37.12.1...v38.1.0) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- packages/interface-address-manager/package.json | 2 +- packages/interface-compliance-tests/package.json | 2 +- packages/interface-connection-compliance-tests/package.json | 2 +- .../package.json | 2 +- packages/interface-connection-encrypter/package.json | 2 +- packages/interface-connection-manager/package.json | 2 +- packages/interface-connection/package.json | 2 +- packages/interface-content-routing/package.json | 2 +- packages/interface-dht/package.json | 2 +- packages/interface-keychain/package.json | 2 +- packages/interface-keys/package.json | 2 +- packages/interface-libp2p/package.json | 2 +- packages/interface-metrics/package.json | 2 +- packages/interface-mocks/package.json | 2 +- packages/interface-peer-discovery-compliance-tests/package.json | 2 +- packages/interface-peer-discovery/package.json | 2 +- packages/interface-peer-id/package.json | 2 +- packages/interface-peer-info/package.json | 2 +- packages/interface-peer-routing/package.json | 2 +- packages/interface-peer-store/package.json | 2 +- packages/interface-pubsub-compliance-tests/package.json | 2 +- packages/interface-pubsub/package.json | 2 +- packages/interface-record-compliance-tests/package.json | 2 +- packages/interface-record/package.json | 2 +- packages/interface-registrar/package.json | 2 +- packages/interface-stream-muxer-compliance-tests/package.json | 2 +- packages/interface-stream-muxer/package.json | 2 +- packages/interface-transport-compliance-tests/package.json | 2 +- packages/interface-transport/package.json | 2 +- packages/interfaces/package.json | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index d7d75b2b2..d728b8bd0 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "release": "npm run docs:no-publish && aegir run release && npm run docs" }, "dependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "workspaces": [ "packages/*" diff --git a/packages/interface-address-manager/package.json b/packages/interface-address-manager/package.json index 41e4e3620..4c5504140 100644 --- a/packages/interface-address-manager/package.json +++ b/packages/interface-address-manager/package.json @@ -136,7 +136,7 @@ "@multiformats/multiaddr": "^11.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-compliance-tests/package.json b/packages/interface-compliance-tests/package.json index e52fec8d0..df9aebd5a 100644 --- a/packages/interface-compliance-tests/package.json +++ b/packages/interface-compliance-tests/package.json @@ -156,7 +156,7 @@ "release": "aegir release" }, "dependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-connection-compliance-tests/package.json b/packages/interface-connection-compliance-tests/package.json index 8c21dc2b8..6ff9928a2 100644 --- a/packages/interface-connection-compliance-tests/package.json +++ b/packages/interface-connection-compliance-tests/package.json @@ -134,7 +134,7 @@ "dependencies": { "@libp2p/interface-compliance-tests": "^3.0.0", "@libp2p/interface-connection": "^3.0.0", - "aegir": "^37.9.0", + "aegir": "^38.1.0", "sinon": "^15.0.0", "ts-sinon": "^2.0.2" }, diff --git a/packages/interface-connection-encrypter-compliance-tests/package.json b/packages/interface-connection-encrypter-compliance-tests/package.json index b9eb9d1a4..73c482661 100644 --- a/packages/interface-connection-encrypter-compliance-tests/package.json +++ b/packages/interface-connection-encrypter-compliance-tests/package.json @@ -138,7 +138,7 @@ "@libp2p/interface-peer-id": "^2.0.0", "@libp2p/peer-id-factory": "^2.0.0", "@multiformats/multiaddr": "^11.0.0", - "aegir": "^37.9.0", + "aegir": "^38.1.0", "it-all": "^2.0.0", "it-pair": "^2.0.2", "it-pipe": "^2.0.3", diff --git a/packages/interface-connection-encrypter/package.json b/packages/interface-connection-encrypter/package.json index 257e42a04..93b7ac12b 100644 --- a/packages/interface-connection-encrypter/package.json +++ b/packages/interface-connection-encrypter/package.json @@ -157,7 +157,7 @@ "uint8arraylist": "^2.1.2" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-connection-manager/package.json b/packages/interface-connection-manager/package.json index 2e28fab3b..899aab19b 100644 --- a/packages/interface-connection-manager/package.json +++ b/packages/interface-connection-manager/package.json @@ -138,7 +138,7 @@ "@multiformats/multiaddr": "^11.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-connection/package.json b/packages/interface-connection/package.json index da597730c..e93899fe0 100644 --- a/packages/interface-connection/package.json +++ b/packages/interface-connection/package.json @@ -159,7 +159,7 @@ "uint8arraylist": "^2.1.2" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-content-routing/package.json b/packages/interface-content-routing/package.json index 2ceb7ca28..ebf94111e 100644 --- a/packages/interface-content-routing/package.json +++ b/packages/interface-content-routing/package.json @@ -137,7 +137,7 @@ "multiformats": "^11.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-dht/package.json b/packages/interface-dht/package.json index f49632c1f..70216f078 100644 --- a/packages/interface-dht/package.json +++ b/packages/interface-dht/package.json @@ -139,7 +139,7 @@ "multiformats": "^11.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-keychain/package.json b/packages/interface-keychain/package.json index b65cf5b6e..a1906e785 100644 --- a/packages/interface-keychain/package.json +++ b/packages/interface-keychain/package.json @@ -136,7 +136,7 @@ "multiformats": "^11.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-keys/package.json b/packages/interface-keys/package.json index cee8aac8d..190292ab7 100644 --- a/packages/interface-keys/package.json +++ b/packages/interface-keys/package.json @@ -132,7 +132,7 @@ "release": "aegir release" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-libp2p/package.json b/packages/interface-libp2p/package.json index c697d89e9..85d8286f8 100644 --- a/packages/interface-libp2p/package.json +++ b/packages/interface-libp2p/package.json @@ -147,7 +147,7 @@ "@multiformats/multiaddr": "^11.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-metrics/package.json b/packages/interface-metrics/package.json index 0b9cc501d..180582572 100644 --- a/packages/interface-metrics/package.json +++ b/packages/interface-metrics/package.json @@ -135,7 +135,7 @@ "@libp2p/interface-connection": "^3.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-mocks/package.json b/packages/interface-mocks/package.json index 0768fb21f..54956807b 100644 --- a/packages/interface-mocks/package.json +++ b/packages/interface-mocks/package.json @@ -175,7 +175,7 @@ "@libp2p/interface-connection-encrypter-compliance-tests": "^4.0.0", "@libp2p/interface-peer-discovery-compliance-tests": "^2.0.0", "@libp2p/interface-stream-muxer-compliance-tests": "^6.0.0", - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-peer-discovery-compliance-tests/package.json b/packages/interface-peer-discovery-compliance-tests/package.json index 1a42b5c61..2874d6e17 100644 --- a/packages/interface-peer-discovery-compliance-tests/package.json +++ b/packages/interface-peer-discovery-compliance-tests/package.json @@ -136,7 +136,7 @@ "@libp2p/interface-peer-discovery": "^1.0.0", "@libp2p/interfaces": "^3.0.0", "@multiformats/multiaddr": "^11.0.0", - "aegir": "^37.9.0", + "aegir": "^38.1.0", "delay": "^5.0.0", "p-defer": "^4.0.0" }, diff --git a/packages/interface-peer-discovery/package.json b/packages/interface-peer-discovery/package.json index 786352f04..762f4b3c9 100644 --- a/packages/interface-peer-discovery/package.json +++ b/packages/interface-peer-discovery/package.json @@ -136,7 +136,7 @@ "@libp2p/interfaces": "^3.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-peer-id/package.json b/packages/interface-peer-id/package.json index 0f7b03119..c7ba905ae 100644 --- a/packages/interface-peer-id/package.json +++ b/packages/interface-peer-id/package.json @@ -135,7 +135,7 @@ "multiformats": "^11.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-peer-info/package.json b/packages/interface-peer-info/package.json index 2217d6a3b..dd645366e 100644 --- a/packages/interface-peer-info/package.json +++ b/packages/interface-peer-info/package.json @@ -136,7 +136,7 @@ "@multiformats/multiaddr": "^11.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-peer-routing/package.json b/packages/interface-peer-routing/package.json index a158cbae8..c416df3ba 100644 --- a/packages/interface-peer-routing/package.json +++ b/packages/interface-peer-routing/package.json @@ -137,7 +137,7 @@ "@libp2p/interfaces": "^3.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-peer-store/package.json b/packages/interface-peer-store/package.json index 17b9f8c4b..f571abc00 100644 --- a/packages/interface-peer-store/package.json +++ b/packages/interface-peer-store/package.json @@ -159,7 +159,7 @@ "@multiformats/multiaddr": "^11.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-pubsub-compliance-tests/package.json b/packages/interface-pubsub-compliance-tests/package.json index 28d6d76fe..c48f0b67c 100644 --- a/packages/interface-pubsub-compliance-tests/package.json +++ b/packages/interface-pubsub-compliance-tests/package.json @@ -138,7 +138,7 @@ "@libp2p/interface-pubsub": "^3.0.0", "@libp2p/interfaces": "^3.0.0", "@libp2p/peer-id-factory": "^2.0.0", - "aegir": "^37.9.0", + "aegir": "^38.1.0", "delay": "^5.0.0", "p-defer": "^4.0.0", "p-event": "^5.0.1", diff --git a/packages/interface-pubsub/package.json b/packages/interface-pubsub/package.json index 482dc0c80..ffb2b75ac 100644 --- a/packages/interface-pubsub/package.json +++ b/packages/interface-pubsub/package.json @@ -139,7 +139,7 @@ "uint8arraylist": "^2.1.2" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-record-compliance-tests/package.json b/packages/interface-record-compliance-tests/package.json index 460580bc9..6f0cdc146 100644 --- a/packages/interface-record-compliance-tests/package.json +++ b/packages/interface-record-compliance-tests/package.json @@ -134,7 +134,7 @@ "dependencies": { "@libp2p/interface-compliance-tests": "^3.0.0", "@libp2p/interface-record": "^2.0.0", - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-record/package.json b/packages/interface-record/package.json index 2ddeaa992..4efc27481 100644 --- a/packages/interface-record/package.json +++ b/packages/interface-record/package.json @@ -136,7 +136,7 @@ "uint8arraylist": "^2.1.2" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-registrar/package.json b/packages/interface-registrar/package.json index 52ca7e1b9..2d7a4a45f 100644 --- a/packages/interface-registrar/package.json +++ b/packages/interface-registrar/package.json @@ -136,7 +136,7 @@ "@libp2p/interface-peer-id": "^2.0.0" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-stream-muxer-compliance-tests/package.json b/packages/interface-stream-muxer-compliance-tests/package.json index 355a6bbe3..e977fa2bc 100644 --- a/packages/interface-stream-muxer-compliance-tests/package.json +++ b/packages/interface-stream-muxer-compliance-tests/package.json @@ -136,7 +136,7 @@ "@libp2p/interface-connection": "^3.0.0", "@libp2p/interface-stream-muxer": "^3.0.0", "abortable-iterator": "^4.0.2", - "aegir": "^37.9.0", + "aegir": "^38.1.0", "delay": "^5.0.0", "it-all": "^2.0.0", "it-drain": "^2.0.0", diff --git a/packages/interface-stream-muxer/package.json b/packages/interface-stream-muxer/package.json index fd04898f3..8319f18a5 100644 --- a/packages/interface-stream-muxer/package.json +++ b/packages/interface-stream-muxer/package.json @@ -137,7 +137,7 @@ "it-stream-types": "^1.0.4" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interface-transport-compliance-tests/package.json b/packages/interface-transport-compliance-tests/package.json index 3c9441901..44781ee7b 100644 --- a/packages/interface-transport-compliance-tests/package.json +++ b/packages/interface-transport-compliance-tests/package.json @@ -139,7 +139,7 @@ "@libp2p/interface-transport": "^2.0.0", "@libp2p/interfaces": "^3.0.0", "@multiformats/multiaddr": "^11.0.0", - "aegir": "^37.9.0", + "aegir": "^38.1.0", "it-all": "^2.0.0", "it-drain": "^2.0.0", "it-pipe": "^2.0.3", diff --git a/packages/interface-transport/package.json b/packages/interface-transport/package.json index 2f3656ba1..e108e650b 100644 --- a/packages/interface-transport/package.json +++ b/packages/interface-transport/package.json @@ -139,7 +139,7 @@ "it-stream-types": "^1.0.4" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" diff --git a/packages/interfaces/package.json b/packages/interfaces/package.json index 0c755c1f1..9f1d666e1 100644 --- a/packages/interfaces/package.json +++ b/packages/interfaces/package.json @@ -160,7 +160,7 @@ "release": "aegir release" }, "devDependencies": { - "aegir": "^37.9.0" + "aegir": "^38.1.0" }, "typedoc": { "entryPoint": "./src/index.ts" From 5afbdbc5d5c033ff350823a8e45a2adb0114e62c Mon Sep 17 00:00:00 2001 From: achingbrain Date: Wed, 18 Jan 2023 12:32:46 +0000 Subject: [PATCH 2/3] chore: fix linting errors --- .../src/is-valid-tick.ts | 2 +- .../src/index.ts | 4 +-- .../src/index.ts | 2 +- .../src/errors.ts | 6 ++-- .../src/connection-encrypter.ts | 2 +- .../interface-mocks/src/connection-gater.ts | 3 +- .../interface-mocks/src/connection-manager.ts | 20 ++++++------- packages/interface-mocks/src/connection.ts | 14 ++++++---- packages/interface-mocks/src/muxer.ts | 22 +++++++++------ .../interface-mocks/src/peer-discovery.ts | 10 +++---- packages/interface-mocks/src/registrar.ts | 14 +++++----- packages/interface-mocks/src/upgrader.ts | 8 +++--- .../interface-mocks/test/connection.spec.ts | 4 ++- .../src/index.ts | 2 +- .../package.json | 2 ++ .../src/api.ts | 4 +-- .../src/connection-handlers.ts | 6 ++-- .../src/emit-self.ts | 6 ++-- .../src/index.ts | 2 +- .../src/messages.ts | 2 +- .../src/multiple-nodes.ts | 14 +++++----- .../src/two-nodes.ts | 12 ++++---- .../src/utils.ts | 2 +- packages/interface-pubsub/src/index.ts | 2 +- .../src/index.ts | 2 +- .../src/base-test.ts | 12 ++++---- .../src/close-test.ts | 28 +++++++++---------- .../src/index.ts | 2 +- .../src/mega-stress-test.ts | 4 +-- .../src/spawner.ts | 6 ++-- .../src/stress-test.ts | 26 ++++++++--------- .../src/dial-test.ts | 8 +++--- .../src/filter-test.ts | 2 +- .../src/index.ts | 2 +- .../src/listen-test.ts | 6 ++-- packages/interfaces/src/errors.ts | 4 +-- packages/interfaces/src/events.ts | 4 +-- packages/interfaces/src/startable.ts | 4 +-- 38 files changed, 144 insertions(+), 131 deletions(-) diff --git a/packages/interface-compliance-tests/src/is-valid-tick.ts b/packages/interface-compliance-tests/src/is-valid-tick.ts index 155bbac03..8e6a1c8bc 100644 --- a/packages/interface-compliance-tests/src/is-valid-tick.ts +++ b/packages/interface-compliance-tests/src/is-valid-tick.ts @@ -3,7 +3,7 @@ * A tick is considered valid if it happened between now * and `ms` milliseconds ago */ -export function isValidTick (date?: number, ms: number = 5000) { +export function isValidTick (date?: number, ms: number = 5000): boolean { if (date == null) { throw new Error('date must be a number') } diff --git a/packages/interface-connection-compliance-tests/src/index.ts b/packages/interface-connection-compliance-tests/src/index.ts index 97855b67d..032c0ea8b 100644 --- a/packages/interface-connection-compliance-tests/src/index.ts +++ b/packages/interface-connection-compliance-tests/src/index.ts @@ -4,7 +4,7 @@ import { stubInterface } from 'ts-sinon' import type { TestSetup } from '@libp2p/interface-compliance-tests' import type { Connection, Stream } from '@libp2p/interface-connection' -export default (test: TestSetup) => { +export default (test: TestSetup): void => { describe('connection', () => { describe('open connection', () => { let connection: Connection @@ -129,7 +129,7 @@ export default (test: TestSetup) => { it.skip('should track inbound streams', async () => { // Add an remotely opened stream const stream = stubInterface() - await connection.addStream(stream) + connection.addStream(stream) expect(stream).to.have.property('direction', 'inbound') }) diff --git a/packages/interface-connection-encrypter-compliance-tests/src/index.ts b/packages/interface-connection-encrypter-compliance-tests/src/index.ts index 1772fc3b1..4e8871c42 100644 --- a/packages/interface-connection-encrypter-compliance-tests/src/index.ts +++ b/packages/interface-connection-encrypter-compliance-tests/src/index.ts @@ -10,7 +10,7 @@ import type { TestSetup } from '@libp2p/interface-compliance-tests' import type { ConnectionEncrypter } from '@libp2p/interface-connection-encrypter' import type { PeerId } from '@libp2p/interface-peer-id' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('interface-connection-encrypter compliance tests', () => { let crypto: ConnectionEncrypter let localPeer: PeerId diff --git a/packages/interface-connection-encrypter/src/errors.ts b/packages/interface-connection-encrypter/src/errors.ts index 587809ea0..cfde5f35c 100644 --- a/packages/interface-connection-encrypter/src/errors.ts +++ b/packages/interface-connection-encrypter/src/errors.ts @@ -7,7 +7,7 @@ export class UnexpectedPeerError extends Error { this.code = UnexpectedPeerError.code } - static get code () { + static get code (): string { return 'ERR_UNEXPECTED_PEER' } } @@ -20,7 +20,7 @@ export class InvalidCryptoExchangeError extends Error { this.code = InvalidCryptoExchangeError.code } - static get code () { + static get code (): string { return 'ERR_INVALID_CRYPTO_EXCHANGE' } } @@ -33,7 +33,7 @@ export class InvalidCryptoTransmissionError extends Error { this.code = InvalidCryptoTransmissionError.code } - static get code () { + static get code (): string { return 'ERR_INVALID_CRYPTO_TRANSMISSION' } } diff --git a/packages/interface-mocks/src/connection-encrypter.ts b/packages/interface-mocks/src/connection-encrypter.ts index 017c02e06..d1e08e37f 100644 --- a/packages/interface-mocks/src/connection-encrypter.ts +++ b/packages/interface-mocks/src/connection-encrypter.ts @@ -17,7 +17,7 @@ const transform = (): Transform => { })() } -export function mockConnectionEncrypter () { +export function mockConnectionEncrypter (): ConnectionEncrypter { const encrypter: ConnectionEncrypter = { protocol: 'insecure', secureInbound: async (localPeer, duplex, expectedPeer) => { diff --git a/packages/interface-mocks/src/connection-gater.ts b/packages/interface-mocks/src/connection-gater.ts index 1c7923e3a..7681bbca5 100644 --- a/packages/interface-mocks/src/connection-gater.ts +++ b/packages/interface-mocks/src/connection-gater.ts @@ -1,5 +1,6 @@ +import type { ConnectionGater } from '@libp2p/interface-connection' -export function mockConnectionGater () { +export function mockConnectionGater (): ConnectionGater { return { denyDialPeer: async () => await Promise.resolve(false), denyDialMultiaddr: async () => await Promise.resolve(false), diff --git a/packages/interface-mocks/src/connection-manager.ts b/packages/interface-mocks/src/connection-manager.ts index 5b2beadae..53d955ce6 100644 --- a/packages/interface-mocks/src/connection-manager.ts +++ b/packages/interface-mocks/src/connection-manager.ts @@ -33,7 +33,7 @@ class MockNetwork { throw errCode(new Error('Peer not found'), 'ERR_PEER_NOT_FOUND') } - reset () { + reset (): void { this.components = [] } } @@ -51,15 +51,15 @@ class MockConnectionManager extends EventEmitter implem this.components = components } - isStarted () { + isStarted (): boolean { return this.started } - async start () { + async start (): Promise { this.started = true } - async stop () { + async stop (): Promise { for (const connection of this.connections) { await this.closeConnections(connection.remotePeer) } @@ -76,7 +76,7 @@ class MockConnectionManager extends EventEmitter implem return this.connections } - async openConnection (peerId: PeerId | Multiaddr) { + async openConnection (peerId: PeerId | Multiaddr): Promise { if (this.components == null) { throw errCode(new Error('Not initialized'), 'ERR_NOT_INITIALIZED') } @@ -99,7 +99,7 @@ class MockConnectionManager extends EventEmitter implem this.connections.push(aToB) ;(componentsB.connectionManager as MockConnectionManager).connections.push(bToA) - this.components.connectionManager?.safeDispatchEvent('peer:connect', { + this.components.connectionManager.safeDispatchEvent('peer:connect', { detail: aToB }) @@ -109,7 +109,7 @@ class MockConnectionManager extends EventEmitter implem } } - componentsB.connectionManager?.safeDispatchEvent('peer:connect', { + componentsB.connectionManager.safeDispatchEvent('peer:connect', { detail: bToA }) @@ -122,7 +122,7 @@ class MockConnectionManager extends EventEmitter implem return aToB } - async closeConnections (peerId: PeerId) { + async closeConnections (peerId: PeerId): Promise { if (this.components == null) { throw errCode(new Error('Not initialized'), 'ERR_NOT_INITIALIZED') } @@ -145,7 +145,7 @@ class MockConnectionManager extends EventEmitter implem await conn.close() } - this.connections = this.connections.filter(c => !c.remotePeer.equals(peerId)) + this.connections = this.connections.filter(c => c.remotePeer.equals(peerId)) await componentsB.connectionManager?.closeConnections(this.components.peerId) } @@ -159,6 +159,6 @@ class MockConnectionManager extends EventEmitter implem } } -export function mockConnectionManager (components: MockNetworkComponents) { +export function mockConnectionManager (components: MockNetworkComponents): ConnectionManager { return new MockConnectionManager(components) } diff --git a/packages/interface-mocks/src/connection.ts b/packages/interface-mocks/src/connection.ts index 9d473f20e..65ff89339 100644 --- a/packages/interface-mocks/src/connection.ts +++ b/packages/interface-mocks/src/connection.ts @@ -65,7 +65,7 @@ class MockConnection implements Connection { this.maConn = maConn } - async newStream (protocols: string | string[], options?: AbortOptions) { + async newStream (protocols: string | string[], options?: AbortOptions): Promise { if (!Array.isArray(protocols)) { protocols = [protocols] } @@ -97,18 +97,20 @@ class MockConnection implements Connection { return streamWithProtocol } - addStream (stream: Stream) { + addStream (stream: Stream): void { this.streams.push(stream) } - removeStream (id: string) { + removeStream (id: string): void { this.streams = this.streams.filter(stream => stream.id !== id) } - async close () { + async close (): Promise { this.stat.status = STATUS.CLOSING await this.maConn.close() - this.streams.forEach(s => s.close()) + this.streams.forEach(s => { + s.close() + }) this.stat.status = STATUS.CLOSED this.stat.timeline.close = Date.now() } @@ -128,7 +130,7 @@ export function mockConnection (maConn: MultiaddrConnection, opts: MockConnectio const muxerFactory = opts.muxerFactory ?? mockMuxer() const muxer = muxerFactory.createStreamMuxer({ - direction: direction, + direction, onIncomingStream: (muxedStream) => { try { mss.handle(muxedStream, registrar.getProtocols()) diff --git a/packages/interface-mocks/src/muxer.ts b/packages/interface-mocks/src/muxer.ts index c88a83596..7d50dc88f 100644 --- a/packages/interface-mocks/src/muxer.ts +++ b/packages/interface-mocks/src/muxer.ts @@ -73,7 +73,7 @@ class MuxedStream { let endErr: Error | undefined - const onSourceEnd = (err?: Error) => { + const onSourceEnd = (err?: Error): void => { if (this.sourceEnded) { return } @@ -95,7 +95,7 @@ class MuxedStream { } } - const onSinkEnd = (err?: Error) => { + const onSinkEnd = (err?: Error): void => { if (this.sinkEnded) { return } @@ -295,7 +295,7 @@ class MockMuxer implements StreamMuxer { } // receive incoming messages - async sink (source: Source) { + async sink (source: Source): Promise { try { await pipe( abortableSource(source, this.closeController.signal), @@ -317,7 +317,7 @@ class MockMuxer implements StreamMuxer { } } - handleMessage (message: StreamMessage) { + handleMessage (message: StreamMessage): void { let muxedStream: MuxedStream | undefined const registry = message.direction === 'initiator' ? this.registryRecipientStreams : this.registryInitiatorStreams @@ -350,17 +350,17 @@ class MockMuxer implements StreamMuxer { muxedStream.stream.reset() } else if (message.type === 'close') { this.log('-> closing stream %s %s', muxedStream.type, muxedStream.stream.id) - void muxedStream.stream.closeRead() + muxedStream.stream.closeRead() } } - get streams () { + get streams (): Stream[] { return Array.from(this.registryRecipientStreams.values()) .concat(Array.from(this.registryInitiatorStreams.values())) .map(({ stream }) => stream) } - newStream (name?: string) { + newStream (name?: string): Stream { if (this.closeController.signal.aborted) { throw new Error('Muxer already closed') } @@ -403,9 +403,13 @@ class MockMuxer implements StreamMuxer { this.log('closing muxed streams') if (err == null) { - this.streams.forEach(s => s.close()) + this.streams.forEach(s => { + s.close() + }) } else { - this.streams.forEach(s => s.abort(err)) + this.streams.forEach(s => { + s.abort(err) + }) } this.closeController.abort() this.input.end(err) diff --git a/packages/interface-mocks/src/peer-discovery.ts b/packages/interface-mocks/src/peer-discovery.ts index ff812786e..61068333f 100644 --- a/packages/interface-mocks/src/peer-discovery.ts +++ b/packages/interface-mocks/src/peer-discovery.ts @@ -28,25 +28,25 @@ export class MockDiscovery extends EventEmitter implements return true } - get [Symbol.toStringTag] () { + get [Symbol.toStringTag] (): string { return 'MockDiscovery' } - start () { + start (): void { this._isRunning = true this._discoverPeer() } - stop () { + stop (): void { clearTimeout(this._timer) this._isRunning = false } - isStarted () { + isStarted (): boolean { return this._isRunning } - _discoverPeer () { + _discoverPeer (): void { if (!this._isRunning) return PeerIdFactory.createEd25519PeerId() diff --git a/packages/interface-mocks/src/registrar.ts b/packages/interface-mocks/src/registrar.ts index ff08ffe0f..ed61599cb 100644 --- a/packages/interface-mocks/src/registrar.ts +++ b/packages/interface-mocks/src/registrar.ts @@ -7,7 +7,7 @@ export class MockRegistrar implements Registrar { private readonly topologies: Map> = new Map() private readonly handlers: Map = new Map() - getProtocols () { + getProtocols (): string[] { return Array.from(this.handlers.keys()).sort() } @@ -27,11 +27,11 @@ export class MockRegistrar implements Registrar { }) } - async unhandle (protocol: string) { + async unhandle (protocol: string): Promise { this.handlers.delete(protocol) } - getHandler (protocol: string) { + getHandler (protocol: string): StreamHandlerRecord { const handler = this.handlers.get(protocol) if (handler == null) { @@ -41,7 +41,7 @@ export class MockRegistrar implements Registrar { return handler } - async register (protocol: string, topology: Topology) { + async register (protocol: string, topology: Topology): Promise { const id = `topology-id-${Math.random()}` let topologies = this.topologies.get(protocol) @@ -59,7 +59,7 @@ export class MockRegistrar implements Registrar { return id } - unregister (id: string | string[]) { + unregister (id: string | string[]): void { if (!Array.isArray(id)) { id = [id] } @@ -67,12 +67,12 @@ export class MockRegistrar implements Registrar { id.forEach(id => this.topologies.delete(id)) } - getTopologies (protocol: string) { + getTopologies (protocol: string): Topology[] { return (this.topologies.get(protocol) ?? []).map(t => t.topology) } } -export function mockRegistrar () { +export function mockRegistrar (): Registrar { return new MockRegistrar() } diff --git a/packages/interface-mocks/src/upgrader.ts b/packages/interface-mocks/src/upgrader.ts index 9c172f819..af3a340fc 100644 --- a/packages/interface-mocks/src/upgrader.ts +++ b/packages/interface-mocks/src/upgrader.ts @@ -1,6 +1,6 @@ import { mockConnection } from './connection.js' import type { Upgrader, UpgraderEvents, UpgraderOptions } from '@libp2p/interface-transport' -import type { MultiaddrConnection } from '@libp2p/interface-connection' +import type { Connection, MultiaddrConnection } from '@libp2p/interface-connection' import type { Registrar } from '@libp2p/interface-registrar' import { EventEmitter } from '@libp2p/interfaces/events' @@ -17,7 +17,7 @@ class MockUpgrader extends EventEmitter implements Upgrader { this.registrar = init.registrar } - async upgradeOutbound (multiaddrConnection: MultiaddrConnection, opts: UpgraderOptions = {}) { + async upgradeOutbound (multiaddrConnection: MultiaddrConnection, opts: UpgraderOptions = {}): Promise { return mockConnection(multiaddrConnection, { direction: 'outbound', registrar: this.registrar, @@ -25,7 +25,7 @@ class MockUpgrader extends EventEmitter implements Upgrader { }) } - async upgradeInbound (multiaddrConnection: MultiaddrConnection, opts: UpgraderOptions = {}) { + async upgradeInbound (multiaddrConnection: MultiaddrConnection, opts: UpgraderOptions = {}): Promise { return mockConnection(multiaddrConnection, { direction: 'inbound', registrar: this.registrar, @@ -34,6 +34,6 @@ class MockUpgrader extends EventEmitter implements Upgrader { } } -export function mockUpgrader (init: MockUpgraderInit = {}) { +export function mockUpgrader (init: MockUpgraderInit = {}): Upgrader { return new MockUpgrader(init) } diff --git a/packages/interface-mocks/test/connection.spec.ts b/packages/interface-mocks/test/connection.spec.ts index 8422c85e6..4490e838f 100644 --- a/packages/interface-mocks/test/connection.spec.ts +++ b/packages/interface-mocks/test/connection.spec.ts @@ -30,7 +30,9 @@ describe('mock connection compliance tests', () => { return connections[0] }, async teardown () { - await Promise.all(connections.map(async conn => await conn.close())) + await Promise.all(connections.map(async conn => { + await conn.close() + })) } }) }) diff --git a/packages/interface-peer-discovery-compliance-tests/src/index.ts b/packages/interface-peer-discovery-compliance-tests/src/index.ts index a9fe938ac..c955923e7 100644 --- a/packages/interface-peer-discovery-compliance-tests/src/index.ts +++ b/packages/interface-peer-discovery-compliance-tests/src/index.ts @@ -6,7 +6,7 @@ import { start, stop } from '@libp2p/interfaces/startable' import type { TestSetup } from '@libp2p/interface-compliance-tests' import type { PeerDiscovery } from '@libp2p/interface-peer-discovery' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('interface-peer-discovery compliance tests', () => { let discovery: PeerDiscovery diff --git a/packages/interface-pubsub-compliance-tests/package.json b/packages/interface-pubsub-compliance-tests/package.json index c48f0b67c..97dbda823 100644 --- a/packages/interface-pubsub-compliance-tests/package.json +++ b/packages/interface-pubsub-compliance-tests/package.json @@ -133,9 +133,11 @@ }, "dependencies": { "@libp2p/interface-compliance-tests": "^3.0.0", + "@libp2p/interface-connection-manager": "^1.0.0", "@libp2p/interface-mocks": "^9.0.0", "@libp2p/interface-peer-id": "^2.0.0", "@libp2p/interface-pubsub": "^3.0.0", + "@libp2p/interface-registrar": "^2.0.0", "@libp2p/interfaces": "^3.0.0", "@libp2p/peer-id-factory": "^2.0.0", "aegir": "^38.1.0", diff --git a/packages/interface-pubsub-compliance-tests/src/api.ts b/packages/interface-pubsub-compliance-tests/src/api.ts index b84c6c64c..e49c9890e 100644 --- a/packages/interface-pubsub-compliance-tests/src/api.ts +++ b/packages/interface-pubsub-compliance-tests/src/api.ts @@ -14,7 +14,7 @@ import { mockNetwork } from '@libp2p/interface-mocks' const topic = 'foo' const data = uint8ArrayFromString('bar') -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('pubsub api', () => { let pubsub: PubSub let components: PubSubComponents @@ -67,7 +67,7 @@ export default (common: TestSetup) => { }) it('can subscribe and unsubscribe correctly', async () => { - const handler = () => { + const handler = (): void => { throw new Error('a message should not be received') } diff --git a/packages/interface-pubsub-compliance-tests/src/connection-handlers.ts b/packages/interface-pubsub-compliance-tests/src/connection-handlers.ts index dd202a01a..fd60d9102 100644 --- a/packages/interface-pubsub-compliance-tests/src/connection-handlers.ts +++ b/packages/interface-pubsub-compliance-tests/src/connection-handlers.ts @@ -13,7 +13,7 @@ import { pEvent } from 'p-event' import { mockNetwork } from '@libp2p/interface-mocks' import type { MockNetworkComponents } from '@libp2p/interface-mocks' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('pubsub connection handlers', () => { let psA: PubSub let psB: PubSub @@ -336,7 +336,7 @@ export default (common: TestSetup) => { let bReceivedSecondMessageFromA = false const topic = 'reconnect-channel' - const handlerSpyA = (evt: CustomEvent) => { + const handlerSpyA = (evt: CustomEvent): void => { if (evt.detail.topic !== topic) { return } @@ -352,7 +352,7 @@ export default (common: TestSetup) => { aReceivedSecondMessageFromB = true } } - const handlerSpyB = (evt: CustomEvent) => { + const handlerSpyB = (evt: CustomEvent): void => { if (evt.detail.topic !== topic) { return } diff --git a/packages/interface-pubsub-compliance-tests/src/emit-self.ts b/packages/interface-pubsub-compliance-tests/src/emit-self.ts index 85e40bd13..fa2383139 100644 --- a/packages/interface-pubsub-compliance-tests/src/emit-self.ts +++ b/packages/interface-pubsub-compliance-tests/src/emit-self.ts @@ -10,9 +10,9 @@ import { createComponents } from './utils.js' const topic = 'foo' const data = uint8ArrayFromString('bar') -const shouldNotHappen = () => expect.fail() +const shouldNotHappen = (): void => expect.fail() -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('emit self', () => { describe('enabled', () => { let pubsub: PubSub @@ -92,7 +92,7 @@ export default (common: TestSetup) => { await pubsub.publish(topic, data) // Wait 1 second to guarantee that self is not noticed - return await new Promise((resolve) => setTimeout(resolve, 1000)) + await new Promise((resolve) => setTimeout(resolve, 1000)) }) }) }) diff --git a/packages/interface-pubsub-compliance-tests/src/index.ts b/packages/interface-pubsub-compliance-tests/src/index.ts index 1b8187589..e89392b28 100644 --- a/packages/interface-pubsub-compliance-tests/src/index.ts +++ b/packages/interface-pubsub-compliance-tests/src/index.ts @@ -22,7 +22,7 @@ export interface PubSubArgs { init: PubSubInit } -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('interface-pubsub compliance tests', () => { apiTest(common) emitSelfTest(common) diff --git a/packages/interface-pubsub-compliance-tests/src/messages.ts b/packages/interface-pubsub-compliance-tests/src/messages.ts index d5ec408ee..da4664f75 100644 --- a/packages/interface-pubsub-compliance-tests/src/messages.ts +++ b/packages/interface-pubsub-compliance-tests/src/messages.ts @@ -12,7 +12,7 @@ import { mockNetwork } from '@libp2p/interface-mocks' const topic = 'foo' const data = uint8ArrayFromString('bar') -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('messages', () => { let pubsub: PubSub let components: PubSubComponents diff --git a/packages/interface-pubsub-compliance-tests/src/multiple-nodes.ts b/packages/interface-pubsub-compliance-tests/src/multiple-nodes.ts index 74d6b547d..daed0e1d7 100644 --- a/packages/interface-pubsub-compliance-tests/src/multiple-nodes.ts +++ b/packages/interface-pubsub-compliance-tests/src/multiple-nodes.ts @@ -13,7 +13,7 @@ import { start, stop } from '@libp2p/interfaces/startable' import delay from 'delay' import { mockNetwork } from '@libp2p/interface-mocks' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('pubsub with multiple nodes', function () { describe('every peer subscribes to the topic', () => { describe('line', () => { @@ -155,7 +155,7 @@ export default (common: TestSetup) => { expect(result).to.have.property('recipients').with.property('length').greaterThanOrEqual(1) - function incMsg (evt: CustomEvent) { + function incMsg (evt: CustomEvent): void { const msg = evt.detail if (msg.topic !== topic) { @@ -166,7 +166,7 @@ export default (common: TestSetup) => { check() } - function check () { + function check (): void { if (++counter === 3) { psA.removeEventListener('message', incMsg) psB.removeEventListener('message', incMsg) @@ -211,7 +211,7 @@ export default (common: TestSetup) => { await psB.publish(topic, uint8ArrayFromString('hey')) - function incMsg (evt: CustomEvent) { + function incMsg (evt: CustomEvent): void { const msg = evt.detail if (msg.topic !== topic) { @@ -222,7 +222,7 @@ export default (common: TestSetup) => { check() } - function check () { + function check (): void { if (++counter === 3) { psA.removeEventListener('message', incMsg) psB.removeEventListener('message', incMsg) @@ -375,7 +375,7 @@ export default (common: TestSetup) => { await psC.publish('Z', uint8ArrayFromString('hey from c')) - function incMsg (evt: CustomEvent) { + function incMsg (evt: CustomEvent): void { const msg = evt.detail if (msg.topic !== topic) { @@ -386,7 +386,7 @@ export default (common: TestSetup) => { check() } - function check () { + function check (): void { if (++counter === 5) { psA.unsubscribe('Z') psB.unsubscribe('Z') diff --git a/packages/interface-pubsub-compliance-tests/src/two-nodes.ts b/packages/interface-pubsub-compliance-tests/src/two-nodes.ts index dec5647b1..2f58aa5d9 100644 --- a/packages/interface-pubsub-compliance-tests/src/two-nodes.ts +++ b/packages/interface-pubsub-compliance-tests/src/two-nodes.ts @@ -15,11 +15,11 @@ import { TopicValidatorResult } from '@libp2p/interface-pubsub' const topic = 'foo' -function shouldNotHappen () { +function shouldNotHappen (): void { expect.fail() } -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('pubsub with two nodes', () => { let psA: PubSub let psB: PubSub @@ -162,7 +162,7 @@ export default (common: TestSetup) => { psA.subscribe(topic) psB.topicValidators.set(topic, (peer, message) => { - if (!peer.equals(componentsA.peerId)) { + if (peer.equals(componentsA.peerId)) { defer.reject('Invalid peer id in topic validator fn') return TopicValidatorResult.Reject } @@ -194,7 +194,7 @@ export default (common: TestSetup) => { psB.addEventListener('message', shouldNotHappen) psA.addEventListener('message', receivedMsg) - function receivedMsg (evt: CustomEvent) { + function receivedMsg (evt: CustomEvent): void { const msg = evt.detail if (msg.type === 'unsigned') { expect(uint8ArrayToString(msg.data)).to.equal('banana') @@ -223,7 +223,9 @@ export default (common: TestSetup) => { ]) await Promise.all( - Array.from({ length: 10 }, async (_, i) => await psB.publish(topic, uint8ArrayFromString('banana'))) + Array.from({ length: 10 }, async (_, i) => { + await psB.publish(topic, uint8ArrayFromString('banana')) + }) ) return await defer.promise diff --git a/packages/interface-pubsub-compliance-tests/src/utils.ts b/packages/interface-pubsub-compliance-tests/src/utils.ts index 239a568d4..1b5ab8f6e 100644 --- a/packages/interface-pubsub-compliance-tests/src/utils.ts +++ b/packages/interface-pubsub-compliance-tests/src/utils.ts @@ -6,7 +6,7 @@ import { createEd25519PeerId } from '@libp2p/peer-id-factory' import { mockConnectionManager, mockRegistrar, mockNetwork } from '@libp2p/interface-mocks' import type { MockNetworkComponents } from '@libp2p/interface-mocks' -export async function waitForSubscriptionUpdate (a: PubSub, b: PeerId) { +export async function waitForSubscriptionUpdate (a: PubSub, b: PeerId): Promise { await pWaitFor(async () => { const event = await pEvent<'subscription-change', CustomEvent>(a, 'subscription-change') diff --git a/packages/interface-pubsub/src/index.ts b/packages/interface-pubsub/src/index.ts index c2e1db015..fe3022ee0 100644 --- a/packages/interface-pubsub/src/index.ts +++ b/packages/interface-pubsub/src/index.ts @@ -152,7 +152,7 @@ export interface TopicValidatorFn { (peer: PeerId, message: Message): TopicValidatorResult | Promise } -export interface PubSub extends EventEmitter { +export interface PubSub = PubSubEvents> extends EventEmitter { /** * The global signature policy controls whether or not we sill send and receive * signed or unsigned messages. diff --git a/packages/interface-record-compliance-tests/src/index.ts b/packages/interface-record-compliance-tests/src/index.ts index 84242d0de..a4d9e436c 100644 --- a/packages/interface-record-compliance-tests/src/index.ts +++ b/packages/interface-record-compliance-tests/src/index.ts @@ -2,7 +2,7 @@ import { expect } from 'aegir/chai' import type { TestSetup } from '@libp2p/interface-compliance-tests' import type { Record } from '@libp2p/interface-record' -export default (test: TestSetup) => { +export default (test: TestSetup): void => { describe('record', () => { let record: Record diff --git a/packages/interface-stream-muxer-compliance-tests/src/base-test.ts b/packages/interface-stream-muxer-compliance-tests/src/base-test.ts index 22ad218fc..a5abb45ef 100644 --- a/packages/interface-stream-muxer-compliance-tests/src/base-test.ts +++ b/packages/interface-stream-muxer-compliance-tests/src/base-test.ts @@ -15,11 +15,11 @@ import type { StreamMuxerFactory } from '@libp2p/interface-stream-muxer' import type { Source, Duplex } from 'it-stream-types' import { Uint8ArrayList } from 'uint8arraylist' -async function drainAndClose (stream: Duplex) { - return await pipe([], stream, drain) +async function drainAndClose (stream: Duplex): Promise { + await pipe([], stream, drain) } -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('base', () => { it('Open a stream from the dialer', async () => { const p = duplexPair() @@ -134,8 +134,8 @@ export default (common: TestSetup) => { await Promise.all([ drainAndClose(dialerInitiatorStream), drainAndClose(listenerInitiatorStream), - onDialerStreamPromise.promise.then(async stream => await drainAndClose(stream)), - onListenerStreamPromise.promise.then(async stream => await drainAndClose(stream)) + onDialerStreamPromise.promise.then(async stream => { await drainAndClose(stream) }), + onListenerStreamPromise.promise.then(async stream => { await drainAndClose(stream) }) ]) await Promise.all([ @@ -145,7 +145,7 @@ export default (common: TestSetup) => { }) it('Open a stream on one side, write, open a stream on the other side', async () => { - const toString = (source: Source) => map(source, (u) => uint8ArrayToString(u.subarray())) + const toString = (source: Source): AsyncGenerator => map(source, (u) => uint8ArrayToString(u.subarray())) const p = duplexPair() const onDialerStreamPromise: DeferredPromise = defer() const onListenerStreamPromise: DeferredPromise = defer() diff --git a/packages/interface-stream-muxer-compliance-tests/src/close-test.ts b/packages/interface-stream-muxer-compliance-tests/src/close-test.ts index a2c78c84c..438437fdc 100644 --- a/packages/interface-stream-muxer-compliance-tests/src/close-test.ts +++ b/packages/interface-stream-muxer-compliance-tests/src/close-test.ts @@ -12,7 +12,7 @@ import pDefer from 'p-defer' import all from 'it-all' import { Uint8ArrayList } from 'uint8arraylist' -function randomBuffer () { +function randomBuffer (): Uint8Array { return uint8ArrayFromString(Math.random().toString()) } @@ -25,7 +25,7 @@ const infiniteRandom = { } } -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('close', () => { it('closing underlying socket closes streams', async () => { let openedStreams = 0 @@ -51,7 +51,7 @@ export default (common: TestSetup) => { void Promise.all( streams.map(async stream => { - return await pipe( + await pipe( infiniteRandom, stream, drain @@ -93,7 +93,7 @@ export default (common: TestSetup) => { void Promise.all( streams.map(async stream => { - return await pipe( + await pipe( infiniteRandom, stream, drain @@ -135,7 +135,7 @@ export default (common: TestSetup) => { const streams = await Promise.all(Array(expectedStreams).fill(0).map(() => dialer.newStream())) const streamPipes = streams.map(async stream => { - return await pipe( + await pipe( infiniteRandom, stream, drain @@ -155,7 +155,7 @@ export default (common: TestSetup) => { try { await Promise.race([ pipe, - new Promise((_resolve, reject) => setTimeout(() => reject(timeoutError), 20)) + new Promise((_resolve, reject) => setTimeout(() => { reject(timeoutError) }, 20)) ]) expect.fail('stream pipe with infinite source should never return') } catch (e) { @@ -226,7 +226,7 @@ export default (common: TestSetup) => { // Abort all the other streams later await delay(50) - controllers.forEach(c => c.abort()) + controllers.forEach(c => { c.abort() }) // These should now all resolve without error await Promise.all(streamResults) @@ -246,7 +246,7 @@ export default (common: TestSetup) => { onIncomingStream: (stream) => { void Promise.resolve().then(async () => { // Immediate close for write - await stream.closeWrite() + stream.closeWrite() const results = await pipe(stream, async (source) => { const data = [] @@ -298,7 +298,7 @@ export default (common: TestSetup) => { void pipe(p[1], listener, p[1]) const stream = await dialer.newStream() - await stream.closeRead() + stream.closeRead() // Source should be done void Promise.resolve().then(async () => { @@ -314,7 +314,7 @@ export default (common: TestSetup) => { it('calls onStreamEnd for closed streams not previously written', async () => { const deferred = pDefer() - const onStreamEnd = () => deferred.resolve() + const onStreamEnd = (): void => { deferred.resolve() } const dialerFactory = await common.setup() const dialer = dialerFactory.createStreamMuxer({ direction: 'outbound', @@ -323,14 +323,14 @@ export default (common: TestSetup) => { const stream = await dialer.newStream() - await stream.close() + stream.close() await deferred.promise }) it('calls onStreamEnd for read and write closed streams not previously written', async () => { const deferred = pDefer() - const onStreamEnd = () => deferred.resolve() + const onStreamEnd = (): void => { deferred.resolve() } const dialerFactory = await common.setup() const dialer = dialerFactory.createStreamMuxer({ direction: 'outbound', @@ -339,8 +339,8 @@ export default (common: TestSetup) => { const stream = await dialer.newStream() - await stream.closeWrite() - await stream.closeRead() + stream.closeWrite() + stream.closeRead() await deferred.promise }) }) diff --git a/packages/interface-stream-muxer-compliance-tests/src/index.ts b/packages/interface-stream-muxer-compliance-tests/src/index.ts index 8b2d57a19..38af55bda 100644 --- a/packages/interface-stream-muxer-compliance-tests/src/index.ts +++ b/packages/interface-stream-muxer-compliance-tests/src/index.ts @@ -5,7 +5,7 @@ import megaStressTest from './mega-stress-test.js' import type { TestSetup } from '@libp2p/interface-compliance-tests' import type { StreamMuxerFactory } from '@libp2p/interface-stream-muxer' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('interface-stream-muxer', () => { baseTest(common) closeTest(common) diff --git a/packages/interface-stream-muxer-compliance-tests/src/mega-stress-test.ts b/packages/interface-stream-muxer-compliance-tests/src/mega-stress-test.ts index e3975d0c9..1d86075b5 100644 --- a/packages/interface-stream-muxer-compliance-tests/src/mega-stress-test.ts +++ b/packages/interface-stream-muxer-compliance-tests/src/mega-stress-test.ts @@ -2,13 +2,13 @@ import spawn from './spawner.js' import type { TestSetup } from '@libp2p/interface-compliance-tests' import type { StreamMuxer, StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface-stream-muxer' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { const createMuxer = async (init?: StreamMuxerInit): Promise => { const factory = await common.setup() return factory.createStreamMuxer(init) } describe.skip('mega stress test', function () { - it('10,000 streams with 10,000 msg', async () => await spawn(createMuxer, 10000, 10000, 5000)) + it('10,000 streams with 10,000 msg', async () => { await spawn(createMuxer, 10000, 10000, 5000) }) }) } diff --git a/packages/interface-stream-muxer-compliance-tests/src/spawner.ts b/packages/interface-stream-muxer-compliance-tests/src/spawner.ts index 15ed73c53..31cf2cb8b 100644 --- a/packages/interface-stream-muxer-compliance-tests/src/spawner.ts +++ b/packages/interface-stream-muxer-compliance-tests/src/spawner.ts @@ -8,7 +8,7 @@ import all from 'it-all' import type { StreamMuxer, StreamMuxerInit } from '@libp2p/interface-stream-muxer' import { Uint8ArrayList } from 'uint8arraylist' -export default async (createMuxer: (init?: StreamMuxerInit) => Promise, nStreams: number, nMsg: number, limit?: number) => { +export default async (createMuxer: (init?: StreamMuxerInit) => Promise, nStreams: number, nMsg: number, limit?: number): Promise => { const [dialerSocket, listenerSocket] = duplexPair() const msg = new Uint8ArrayList(uint8ArrayFromString('simple msg')) @@ -29,7 +29,7 @@ export default async (createMuxer: (init?: StreamMuxerInit) => Promise { + const spawnStream = async (): Promise => { const stream = await dialer.newStream() expect(stream).to.exist // eslint-disable-line @@ -49,6 +49,6 @@ export default async (createMuxer: (init?: StreamMuxerInit) => Promise await limiter(async () => await spawnStream())) + Array.from(Array(nStreams), async () => { await limiter(async () => { await spawnStream() }) }) ) } diff --git a/packages/interface-stream-muxer-compliance-tests/src/stress-test.ts b/packages/interface-stream-muxer-compliance-tests/src/stress-test.ts index 5ded44103..c3b3ca4aa 100644 --- a/packages/interface-stream-muxer-compliance-tests/src/stress-test.ts +++ b/packages/interface-stream-muxer-compliance-tests/src/stress-test.ts @@ -2,7 +2,7 @@ import spawn from './spawner.js' import type { TestSetup } from '@libp2p/interface-compliance-tests' import type { StreamMuxerFactory, StreamMuxerInit, StreamMuxer } from '@libp2p/interface-stream-muxer' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { const createMuxer = async (init?: StreamMuxerInit): Promise => { const factory = await common.setup() return factory.createStreamMuxer(init) @@ -11,17 +11,17 @@ export default (common: TestSetup) => { describe('stress test', function () { this.timeout(800000) - it('1 stream with 1 msg', async () => await spawn(createMuxer, 1, 1)) - it('1 stream with 10 msg', async () => await spawn(createMuxer, 1, 10)) - it('1 stream with 100 msg', async () => await spawn(createMuxer, 1, 100)) - it('10 streams with 1 msg', async () => await spawn(createMuxer, 10, 1)) - it('10 streams with 10 msg', async () => await spawn(createMuxer, 10, 10)) - it('10 streams with 100 msg', async () => await spawn(createMuxer, 10, 100)) - it('100 streams with 1 msg', async () => await spawn(createMuxer, 100, 1)) - it('100 streams with 10 msg', async () => await spawn(createMuxer, 100, 10)) - it('100 streams with 100 msg', async () => await spawn(createMuxer, 100, 100)) - it('1000 streams with 1 msg', async () => await spawn(createMuxer, 1000, 1)) - it('1000 streams with 10 msg', async () => await spawn(createMuxer, 1000, 10)) - it('1000 streams with 100 msg', async () => await spawn(createMuxer, 1000, 100)) + it('1 stream with 1 msg', async () => { await spawn(createMuxer, 1, 1) }) + it('1 stream with 10 msg', async () => { await spawn(createMuxer, 1, 10) }) + it('1 stream with 100 msg', async () => { await spawn(createMuxer, 1, 100) }) + it('10 streams with 1 msg', async () => { await spawn(createMuxer, 10, 1) }) + it('10 streams with 10 msg', async () => { await spawn(createMuxer, 10, 10) }) + it('10 streams with 100 msg', async () => { await spawn(createMuxer, 10, 100) }) + it('100 streams with 1 msg', async () => { await spawn(createMuxer, 100, 1) }) + it('100 streams with 10 msg', async () => { await spawn(createMuxer, 100, 10) }) + it('100 streams with 100 msg', async () => { await spawn(createMuxer, 100, 100) }) + it('1000 streams with 1 msg', async () => { await spawn(createMuxer, 1000, 1) }) + it('1000 streams with 10 msg', async () => { await spawn(createMuxer, 1000, 10) }) + it('1000 streams with 100 msg', async () => { await spawn(createMuxer, 1000, 100) }) }) } diff --git a/packages/interface-transport-compliance-tests/src/dial-test.ts b/packages/interface-transport-compliance-tests/src/dial-test.ts index d6bc73a60..a40c0e258 100644 --- a/packages/interface-transport-compliance-tests/src/dial-test.ts +++ b/packages/interface-transport-compliance-tests/src/dial-test.ts @@ -13,7 +13,7 @@ import type { TransportTestFixtures, Connector } from './index.js' import type { Multiaddr } from '@multiformats/multiaddr' import type { Registrar } from '@libp2p/interface-registrar' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('dial', () => { let upgrader: Upgrader let registrar: Registrar @@ -39,13 +39,13 @@ export default (common: TestSetup) => { listener = transport.createListener({ upgrader }) - return await listener.listen(addrs[0]) + await listener.listen(addrs[0]) }) afterEach(async () => { sinon.restore() connector.restore() - return await listener.close() + await listener.close() }) it('simple', async () => { @@ -113,7 +113,7 @@ export default (common: TestSetup) => { const controller = new AbortController() const conn = transport.dial(addrs[0], { signal: controller.signal, upgrader }) - setTimeout(() => controller.abort(), 50) + setTimeout(() => { controller.abort() }, 50) await expect(conn).to.eventually.be.rejected().with.property('code', AbortError.code) expect(upgradeSpy.callCount).to.equal(0) diff --git a/packages/interface-transport-compliance-tests/src/filter-test.ts b/packages/interface-transport-compliance-tests/src/filter-test.ts index 3145f59f2..52a1951df 100644 --- a/packages/interface-transport-compliance-tests/src/filter-test.ts +++ b/packages/interface-transport-compliance-tests/src/filter-test.ts @@ -4,7 +4,7 @@ import type { Transport } from '@libp2p/interface-transport' import type { TransportTestFixtures } from './index.js' import type { Multiaddr } from '@multiformats/multiaddr' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('filter', () => { let addrs: Multiaddr[] let transport: Transport diff --git a/packages/interface-transport-compliance-tests/src/index.ts b/packages/interface-transport-compliance-tests/src/index.ts index 0301a6833..dedf37859 100644 --- a/packages/interface-transport-compliance-tests/src/index.ts +++ b/packages/interface-transport-compliance-tests/src/index.ts @@ -16,7 +16,7 @@ export interface TransportTestFixtures { connector: Connector } -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('interface-transport', () => { dial(common) listen(common) diff --git a/packages/interface-transport-compliance-tests/src/listen-test.ts b/packages/interface-transport-compliance-tests/src/listen-test.ts index 7463480c7..e42fc6f42 100644 --- a/packages/interface-transport-compliance-tests/src/listen-test.ts +++ b/packages/interface-transport-compliance-tests/src/listen-test.ts @@ -16,7 +16,7 @@ import type { Multiaddr } from '@multiformats/multiaddr' import type { Connection } from '@libp2p/interface-connection' import type { Registrar } from '@libp2p/interface-registrar' -export default (common: TestSetup) => { +export default (common: TestSetup): void => { describe('listen', () => { let upgrader: Upgrader let addrs: Multiaddr[] @@ -92,7 +92,7 @@ export default (common: TestSetup) => { listener.close() ]) - await stream1.close() + stream1.close() await conn1.close() expect(isValidTick(conn1.stat.timeline.close)).to.equal(true) @@ -178,7 +178,7 @@ export default (common: TestSetup) => { const listener = transport.createListener({ upgrader }) - listener.addEventListener('close', () => done()) + listener.addEventListener('close', () => { done() }) void (async () => { await listener.listen(addrs[0]) diff --git a/packages/interfaces/src/errors.ts b/packages/interfaces/src/errors.ts index b5f59d863..8bfd0838a 100644 --- a/packages/interfaces/src/errors.ts +++ b/packages/interfaces/src/errors.ts @@ -14,11 +14,11 @@ export class AbortError extends Error { this.type = AbortError.type } - static get code () { + static get code (): string { return 'ABORT_ERR' } - static get type () { + static get type (): string { return 'aborted' } } diff --git a/packages/interfaces/src/events.ts b/packages/interfaces/src/events.ts index d63726288..fa1eac05c 100644 --- a/packages/interfaces/src/events.ts +++ b/packages/interfaces/src/events.ts @@ -16,10 +16,10 @@ interface Listener { * https://github.com/microsoft/TypeScript/issues/299 * etc */ -export class EventEmitter extends EventTarget { +export class EventEmitter> extends EventTarget { #listeners: Map = new Map() - listenerCount (type: string) { + listenerCount (type: string): number { const listeners = this.#listeners.get(type) if (listeners == null) { diff --git a/packages/interfaces/src/startable.ts b/packages/interfaces/src/startable.ts index 3a804569e..5d9be74c9 100644 --- a/packages/interfaces/src/startable.ts +++ b/packages/interfaces/src/startable.ts @@ -52,7 +52,7 @@ export function isStartable (obj: any): obj is Startable { return obj != null && typeof obj.start === 'function' && typeof obj.stop === 'function' } -export async function start (...objs: any[]) { +export async function start (...objs: any[]): Promise { const startables: Startable[] = [] for (const obj of objs) { @@ -84,7 +84,7 @@ export async function start (...objs: any[]) { ) } -export async function stop (...objs: any[]) { +export async function stop (...objs: any[]): Promise { const startables: Startable[] = [] for (const obj of objs) { From 0358f4a8d9e83cb4e0609417a923c2e211a254e9 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Wed, 18 Jan 2023 12:35:18 +0000 Subject: [PATCH 3/3] chore: update config --- packages/interface-address-manager/README.md | 4 ++-- packages/interface-compliance-tests/README.md | 4 ++-- packages/interface-connection-compliance-tests/README.md | 4 ++-- .../README.md | 4 ++-- packages/interface-connection-encrypter/README.md | 4 ++-- packages/interface-connection-manager/README.md | 4 ++-- packages/interface-connection/README.md | 4 ++-- packages/interface-content-routing/README.md | 4 ++-- packages/interface-dht/README.md | 4 ++-- packages/interface-keychain/README.md | 4 ++-- packages/interface-keychain/tsconfig.json | 5 +++++ packages/interface-keys/README.md | 4 ++-- packages/interface-libp2p/tsconfig.json | 3 --- packages/interface-metrics/README.md | 4 ++-- packages/interface-mocks/README.md | 4 ++-- .../interface-peer-discovery-compliance-tests/README.md | 4 ++-- packages/interface-peer-discovery/README.md | 4 ++-- packages/interface-peer-id/README.md | 4 ++-- packages/interface-peer-info/README.md | 4 ++-- packages/interface-peer-routing/README.md | 4 ++-- packages/interface-peer-store/README.md | 4 ++-- packages/interface-pubsub-compliance-tests/README.md | 4 ++-- packages/interface-pubsub-compliance-tests/tsconfig.json | 6 ++++++ packages/interface-pubsub/README.md | 4 ++-- packages/interface-record-compliance-tests/README.md | 4 ++-- packages/interface-record/README.md | 4 ++-- packages/interface-registrar/README.md | 4 ++-- packages/interface-stream-muxer-compliance-tests/README.md | 4 ++-- packages/interface-stream-muxer/README.md | 4 ++-- packages/interface-transport-compliance-tests/README.md | 4 ++-- packages/interface-transport/README.md | 4 ++-- packages/interfaces/README.md | 4 ++-- 32 files changed, 69 insertions(+), 61 deletions(-) diff --git a/packages/interface-address-manager/README.md b/packages/interface-address-manager/README.md index 18a06a820..57e7c12aa 100644 --- a/packages/interface-address-manager/README.md +++ b/packages/interface-address-manager/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -38,6 +38,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-compliance-tests/README.md b/packages/interface-compliance-tests/README.md index afb75d7d5..8300bbcc1 100644 --- a/packages/interface-compliance-tests/README.md +++ b/packages/interface-compliance-tests/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -36,6 +36,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-connection-compliance-tests/README.md b/packages/interface-connection-compliance-tests/README.md index da236c7fc..6844b9352 100644 --- a/packages/interface-connection-compliance-tests/README.md +++ b/packages/interface-connection-compliance-tests/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -56,6 +56,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-connection-encrypter-compliance-tests/README.md b/packages/interface-connection-encrypter-compliance-tests/README.md index 77766d334..3845dcad2 100644 --- a/packages/interface-connection-encrypter-compliance-tests/README.md +++ b/packages/interface-connection-encrypter-compliance-tests/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -49,6 +49,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-connection-encrypter/README.md b/packages/interface-connection-encrypter/README.md index fae0b5908..71e7d0a31 100644 --- a/packages/interface-connection-encrypter/README.md +++ b/packages/interface-connection-encrypter/README.md @@ -17,7 +17,7 @@ - [Error Types](#error-types) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -105,7 +105,7 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-connection-manager/README.md b/packages/interface-connection-manager/README.md index e8e39e88b..9cae29d73 100644 --- a/packages/interface-connection-manager/README.md +++ b/packages/interface-connection-manager/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -38,6 +38,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-connection/README.md b/packages/interface-connection/README.md index 12025424c..030d70c5d 100644 --- a/packages/interface-connection/README.md +++ b/packages/interface-connection/README.md @@ -31,7 +31,7 @@ - [Tags](#tags) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -310,6 +310,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-content-routing/README.md b/packages/interface-content-routing/README.md index 3345c2df9..c66182eaa 100644 --- a/packages/interface-content-routing/README.md +++ b/packages/interface-content-routing/README.md @@ -19,7 +19,7 @@ - [provide](#provide) - [API Docs](#api-docs) - [License](#license) - - [Contribute](#contribute) + - [Contribution](#contribution) ## Install @@ -95,6 +95,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-dht/README.md b/packages/interface-dht/README.md index 09b6afd25..30a8eef68 100644 --- a/packages/interface-dht/README.md +++ b/packages/interface-dht/README.md @@ -12,7 +12,7 @@ - [Install](#install) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -31,6 +31,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-keychain/README.md b/packages/interface-keychain/README.md index dd813944d..c0a9950c4 100644 --- a/packages/interface-keychain/README.md +++ b/packages/interface-keychain/README.md @@ -19,7 +19,7 @@ - [provide](#provide) - [API Docs](#api-docs) - [License](#license) - - [Contribute](#contribute) + - [Contribution](#contribution) ## Install @@ -95,6 +95,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-keychain/tsconfig.json b/packages/interface-keychain/tsconfig.json index 5fe8ea40d..d8db0b667 100644 --- a/packages/interface-keychain/tsconfig.json +++ b/packages/interface-keychain/tsconfig.json @@ -5,5 +5,10 @@ }, "include": [ "src" + ], + "references": [ + { + "path": "../interface-peer-id" + } ] } diff --git a/packages/interface-keys/README.md b/packages/interface-keys/README.md index 149f685ac..e498f1eea 100644 --- a/packages/interface-keys/README.md +++ b/packages/interface-keys/README.md @@ -13,7 +13,7 @@ - [Using the Test Suite](#using-the-test-suite) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -51,6 +51,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-libp2p/tsconfig.json b/packages/interface-libp2p/tsconfig.json index 1ff7778f2..fc2c5d600 100644 --- a/packages/interface-libp2p/tsconfig.json +++ b/packages/interface-libp2p/tsconfig.json @@ -10,9 +10,6 @@ { "path": "../interface-connection" }, - { - "path": "../interface-connection-manager" - }, { "path": "../interface-content-routing" }, diff --git a/packages/interface-metrics/README.md b/packages/interface-metrics/README.md index 8e8356842..25ed8506b 100644 --- a/packages/interface-metrics/README.md +++ b/packages/interface-metrics/README.md @@ -13,7 +13,7 @@ - [Implementations](#implementations) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -36,6 +36,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-mocks/README.md b/packages/interface-mocks/README.md index 8e700c76e..b00807ccb 100644 --- a/packages/interface-mocks/README.md +++ b/packages/interface-mocks/README.md @@ -14,7 +14,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -45,6 +45,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-peer-discovery-compliance-tests/README.md b/packages/interface-peer-discovery-compliance-tests/README.md index bbb95a961..36a7ef2a3 100644 --- a/packages/interface-peer-discovery-compliance-tests/README.md +++ b/packages/interface-peer-discovery-compliance-tests/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -50,6 +50,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-peer-discovery/README.md b/packages/interface-peer-discovery/README.md index 8b50c5835..5ab7533e1 100644 --- a/packages/interface-peer-discovery/README.md +++ b/packages/interface-peer-discovery/README.md @@ -20,7 +20,7 @@ - [discovering peers](#discovering-peers) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -113,6 +113,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-peer-id/README.md b/packages/interface-peer-id/README.md index b63ba8a4a..f30058ca7 100644 --- a/packages/interface-peer-id/README.md +++ b/packages/interface-peer-id/README.md @@ -16,7 +16,7 @@ - [Node.js](#nodejs) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -75,6 +75,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-peer-info/README.md b/packages/interface-peer-info/README.md index cb28227fc..231fb89a7 100644 --- a/packages/interface-peer-info/README.md +++ b/packages/interface-peer-info/README.md @@ -12,7 +12,7 @@ - [Install](#install) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -31,6 +31,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-peer-routing/README.md b/packages/interface-peer-routing/README.md index 65b727925..a4621fff7 100644 --- a/packages/interface-peer-routing/README.md +++ b/packages/interface-peer-routing/README.md @@ -18,7 +18,7 @@ - - [findPeer](#findpeer) - [API Docs](#api-docs) - [License](#license) - - [Contribute](#contribute) + - [Contribution](#contribution) ## Install @@ -78,6 +78,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-peer-store/README.md b/packages/interface-peer-store/README.md index 5fd4489be..ce1e3ef5c 100644 --- a/packages/interface-peer-store/README.md +++ b/packages/interface-peer-store/README.md @@ -14,7 +14,7 @@ - [Tags](#tags) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -45,6 +45,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-pubsub-compliance-tests/README.md b/packages/interface-pubsub-compliance-tests/README.md index 95f29bc11..69df607fa 100644 --- a/packages/interface-pubsub-compliance-tests/README.md +++ b/packages/interface-pubsub-compliance-tests/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -50,6 +50,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-pubsub-compliance-tests/tsconfig.json b/packages/interface-pubsub-compliance-tests/tsconfig.json index 26b67bfb0..e128c8d1e 100644 --- a/packages/interface-pubsub-compliance-tests/tsconfig.json +++ b/packages/interface-pubsub-compliance-tests/tsconfig.json @@ -11,6 +11,9 @@ { "path": "../interface-compliance-tests" }, + { + "path": "../interface-connection-manager" + }, { "path": "../interface-mocks" }, @@ -20,6 +23,9 @@ { "path": "../interface-pubsub" }, + { + "path": "../interface-registrar" + }, { "path": "../interfaces" } diff --git a/packages/interface-pubsub/README.md b/packages/interface-pubsub/README.md index f40a73768..4c9235d37 100644 --- a/packages/interface-pubsub/README.md +++ b/packages/interface-pubsub/README.md @@ -47,7 +47,7 @@ - [Test suite usage](#test-suite-usage) - [API Docs](#api-docs) - [License](#license) - - [Contribute](#contribute) + - [Contribution](#contribution) ## Install @@ -318,6 +318,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-record-compliance-tests/README.md b/packages/interface-record-compliance-tests/README.md index e5ce844aa..b60bed186 100644 --- a/packages/interface-record-compliance-tests/README.md +++ b/packages/interface-record-compliance-tests/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -50,6 +50,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-record/README.md b/packages/interface-record/README.md index cc328ad01..5029cf27f 100644 --- a/packages/interface-record/README.md +++ b/packages/interface-record/README.md @@ -17,7 +17,7 @@ - [equals](#equals) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -127,6 +127,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-registrar/README.md b/packages/interface-registrar/README.md index b05fb9c01..bddd833cb 100644 --- a/packages/interface-registrar/README.md +++ b/packages/interface-registrar/README.md @@ -12,7 +12,7 @@ - [Install](#install) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -31,6 +31,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-stream-muxer-compliance-tests/README.md b/packages/interface-stream-muxer-compliance-tests/README.md index e527d11dc..2e10e82bd 100644 --- a/packages/interface-stream-muxer-compliance-tests/README.md +++ b/packages/interface-stream-muxer-compliance-tests/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -50,6 +50,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-stream-muxer/README.md b/packages/interface-stream-muxer/README.md index fba4b7cfa..db595eff3 100644 --- a/packages/interface-stream-muxer/README.md +++ b/packages/interface-stream-muxer/README.md @@ -21,7 +21,7 @@ - [`const streams = muxer.streams`](#const-streams--muxerstreams) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -186,6 +186,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-transport-compliance-tests/README.md b/packages/interface-transport-compliance-tests/README.md index 1a0b6568a..9d696f51c 100644 --- a/packages/interface-transport-compliance-tests/README.md +++ b/packages/interface-transport-compliance-tests/README.md @@ -13,7 +13,7 @@ - [Usage](#usage) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -50,6 +50,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interface-transport/README.md b/packages/interface-transport/README.md index 4ec1de715..d43b6f6b2 100644 --- a/packages/interface-transport/README.md +++ b/packages/interface-transport/README.md @@ -28,7 +28,7 @@ - [Stop a listener](#stop-a-listener) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -259,6 +259,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/interfaces/README.md b/packages/interfaces/README.md index c47462dbb..117a04da7 100644 --- a/packages/interfaces/README.md +++ b/packages/interfaces/README.md @@ -17,7 +17,7 @@ - [Startable](#startable) - [API Docs](#api-docs) - [License](#license) -- [Contribute](#contribute) +- [Contribution](#contribution) ## Install @@ -96,6 +96,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.