@libp2p/interface-compliance-tests 6.3.4-5b084e968 → 6.3.4-90cca822b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"upgrader.d.ts","sourceRoot":"","sources":["../../../src/mocks/upgrader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAmC,gBAAgB,EAAE,QAAQ,EAAmB,MAAM,mBAAmB,CAAA;AACnI,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;CACxC;AAkCD,wBAAgB,YAAY,CAAE,IAAI,GAAE,gBAAqB,GAAG,QAAQ,CAEnE"}
1
+ {"version":3,"file":"upgrader.d.ts","sourceRoot":"","sources":["../../../src/mocks/upgrader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAmC,gBAAgB,EAAE,QAAQ,EAAoC,MAAM,mBAAmB,CAAA;AACpJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;CACxC;AA4CD,wBAAgB,YAAY,CAAE,IAAI,GAAE,gBAAqB,GAAG,QAAQ,CAEnE"}
@@ -1,3 +1,5 @@
1
+ import { setMaxListeners } from '@libp2p/interface';
2
+ import { anySignal } from 'any-signal';
1
3
  import { mockConnection } from './connection.js';
2
4
  class MockUpgrader {
3
5
  registrar;
@@ -6,7 +8,7 @@ class MockUpgrader {
6
8
  this.registrar = init.registrar;
7
9
  this.events = init.events;
8
10
  }
9
- async upgradeOutbound(multiaddrConnection, opts = {}) {
11
+ async upgradeOutbound(multiaddrConnection, opts) {
10
12
  const connection = mockConnection(multiaddrConnection, {
11
13
  direction: 'outbound',
12
14
  registrar: this.registrar,
@@ -15,7 +17,7 @@ class MockUpgrader {
15
17
  this.events?.safeDispatchEvent('connection:open', { detail: connection });
16
18
  return connection;
17
19
  }
18
- async upgradeInbound(multiaddrConnection, opts = {}) {
20
+ async upgradeInbound(multiaddrConnection, opts) {
19
21
  const connection = mockConnection(multiaddrConnection, {
20
22
  direction: 'inbound',
21
23
  registrar: this.registrar,
@@ -23,6 +25,14 @@ class MockUpgrader {
23
25
  });
24
26
  this.events?.safeDispatchEvent('connection:open', { detail: connection });
25
27
  }
28
+ createInboundAbortSignal(signal) {
29
+ const output = anySignal([
30
+ AbortSignal.timeout(10_000),
31
+ signal
32
+ ]);
33
+ setMaxListeners(Infinity, output);
34
+ return output;
35
+ }
26
36
  }
27
37
  export function mockUpgrader(init = {}) {
28
38
  return new MockUpgrader(init);
@@ -1 +1 @@
1
- {"version":3,"file":"upgrader.js","sourceRoot":"","sources":["../../../src/mocks/upgrader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAShD,MAAM,YAAY;IACC,SAAS,CAAY;IACrB,MAAM,CAAiC;IAExD,YAAa,IAAsB;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;QAC/B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC3B,CAAC;IAED,KAAK,CAAC,eAAe,CAAE,mBAAwC,EAAE,OAAwB,EAAE;QACzF,MAAM,UAAU,GAAG,cAAc,CAAC,mBAAmB,EAAE;YACrD,SAAS,EAAE,UAAU;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,GAAG,IAAI;SACR,CAAC,CAAA;QAEF,IAAI,CAAC,MAAM,EAAE,iBAAiB,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,C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AK,CAAC,cAAc,CAAE,mBAAwC,EAAE,IAAqB;QACnF,MAAM,UAAU,GAAG,cAAc,CAAC,mBAAmB,EAAE;YACrD,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,GAAG,IAAI;SACR,CAAC,CAAA;QAEF,IAAI,CAAC,MAAM,EAAE,iBAAiB,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAA;IAC3E,CAAC;IAED,wBAAwB,CAAE,MAAoB;QAC5C,MAAM,MAAM,GAAG,SAAS,CAAC;YACvB,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC;YAC3B,MAAM;SACP,CAAC,CAAA;QACF,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAEjC,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,MAAM,UAAU,YAAY,CAAE,OAAyB,EAAE;IACvD,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAA;AAC/B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface-compliance-tests",
3
- "version": "6.3.4-5b084e968",
3
+ "version": "6.3.4-90cca822b",
4
4
  "description": "Compliance tests for JS libp2p interfaces",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-compliance-tests#readme",
@@ -104,21 +104,22 @@
104
104
  "test:electron-main": "aegir test -t electron-main"
105
105
  },
106
106
  "dependencies": {
107
- "@libp2p/crypto": "5.0.12-5b084e968",
108
- "@libp2p/echo": "2.1.13-5b084e968",
109
- "@libp2p/interface": "2.6.0-5b084e968",
110
- "@libp2p/interface-internal": "2.3.4-5b084e968",
111
- "@libp2p/logger": "5.1.9-5b084e968",
112
- "@libp2p/memory": "1.1.0-5b084e968",
113
- "@libp2p/multistream-select": "6.0.16-5b084e968",
114
- "@libp2p/peer-collections": "6.0.20-5b084e968",
115
- "@libp2p/peer-id": "5.0.13-5b084e968",
116
- "@libp2p/plaintext": "2.0.16-5b084e968",
117
- "@libp2p/utils": "6.5.4-5b084e968",
107
+ "@libp2p/crypto": "5.0.12-90cca822b",
108
+ "@libp2p/echo": "2.1.13-90cca822b",
109
+ "@libp2p/interface": "2.6.0-90cca822b",
110
+ "@libp2p/interface-internal": "2.3.4-90cca822b",
111
+ "@libp2p/logger": "5.1.9-90cca822b",
112
+ "@libp2p/memory": "1.1.0-90cca822b",
113
+ "@libp2p/multistream-select": "6.0.16-90cca822b",
114
+ "@libp2p/peer-collections": "6.0.20-90cca822b",
115
+ "@libp2p/peer-id": "5.0.13-90cca822b",
116
+ "@libp2p/plaintext": "2.0.16-90cca822b",
117
+ "@libp2p/utils": "6.5.4-90cca822b",
118
118
  "@multiformats/multiaddr": "^12.3.3",
119
119
  "@multiformats/multiaddr-matcher": "^1.6.0",
120
120
  "abortable-iterator": "^5.1.0",
121
- "aegir": "^45.0.5",
121
+ "aegir": "^45.1.1",
122
+ "any-signal": "^4.1.1",
122
123
  "delay": "^6.0.0",
123
124
  "it-all": "^3.0.6",
124
125
  "it-byte-stream": "^1.1.0",
@@ -131,7 +132,7 @@
131
132
  "it-pushable": "^3.2.3",
132
133
  "it-stream-types": "^2.0.2",
133
134
  "it-to-buffer": "^4.0.7",
134
- "libp2p": "2.7.2-5b084e968",
135
+ "libp2p": "2.7.2-90cca822b",
135
136
  "merge-options": "^3.0.4",
136
137
  "p-defer": "^4.0.1",
137
138
  "p-event": "^6.0.1",
@@ -1,5 +1,7 @@
1
+ import { setMaxListeners } from '@libp2p/interface'
2
+ import { anySignal } from 'any-signal'
1
3
  import { mockConnection } from './connection.js'
2
- import type { Libp2pEvents, Connection, MultiaddrConnection, TypedEventTarget, Upgrader, UpgraderOptions } from '@libp2p/interface'
4
+ import type { Libp2pEvents, Connection, MultiaddrConnection, TypedEventTarget, Upgrader, UpgraderOptions, ClearableSignal } from '@libp2p/interface'
3
5
  import type { Registrar } from '@libp2p/interface-internal'
4
6
 
5
7
  export interface MockUpgraderInit {
@@ -16,7 +18,7 @@ class MockUpgrader implements Upgrader {
16
18
  this.events = init.events
17
19
  }
18
20
 
19
- async upgradeOutbound (multiaddrConnection: MultiaddrConnection, opts: UpgraderOptions = {}): Promise<Connection> {
21
+ async upgradeOutbound (multiaddrConnection: MultiaddrConnection, opts: UpgraderOptions): Promise<Connection> {
20
22
  const connection = mockConnection(multiaddrConnection, {
21
23
  direction: 'outbound',
22
24
  registrar: this.registrar,
@@ -28,7 +30,7 @@ class MockUpgrader implements Upgrader {
28
30
  return connection
29
31
  }
30
32
 
31
- async upgradeInbound (multiaddrConnection: MultiaddrConnection, opts: UpgraderOptions = {}): Promise<void> {
33
+ async upgradeInbound (multiaddrConnection: MultiaddrConnection, opts: UpgraderOptions): Promise<void> {
32
34
  const connection = mockConnection(multiaddrConnection, {
33
35
  direction: 'inbound',
34
36
  registrar: this.registrar,
@@ -37,6 +39,16 @@ class MockUpgrader implements Upgrader {
37
39
 
38
40
  this.events?.safeDispatchEvent('connection:open', { detail: connection })
39
41
  }
42
+
43
+ createInboundAbortSignal (signal?: AbortSignal): ClearableSignal {
44
+ const output = anySignal([
45
+ AbortSignal.timeout(10_000),
46
+ signal
47
+ ])
48
+ setMaxListeners(Infinity, output)
49
+
50
+ return output
51
+ }
40
52
  }
41
53
 
42
54
  export function mockUpgrader (init: MockUpgraderInit = {}): Upgrader {