@peerbit/test-utils 1.0.33 → 2.0.1
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.
- package/lib/esm/index.d.ts +0 -1
- package/lib/esm/index.js +0 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/session.d.ts +3 -2
- package/lib/esm/session.js +2 -0
- package/lib/esm/session.js.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +0 -2
- package/src/session.ts +5 -5
- package/lib/esm/storage.d.ts +0 -2
- package/lib/esm/storage.js +0 -5
- package/lib/esm/storage.js.map +0 -1
- package/src/storage.ts +0 -5
package/lib/esm/index.d.ts
CHANGED
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/lib/esm/session.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { TestSession as SSession
|
|
1
|
+
import { TestSession as SSession } from "@peerbit/libp2p-test-utils";
|
|
2
2
|
import { Libp2pCreateOptions, Libp2pExtendServices } from "peerbit";
|
|
3
3
|
import { Peerbit } from "peerbit";
|
|
4
4
|
import { ProgramClient } from "@peerbit/program";
|
|
5
|
-
|
|
5
|
+
import { Libp2pOptions } from "libp2p";
|
|
6
|
+
export type LibP2POptions = Libp2pOptions<Libp2pExtendServices>;
|
|
6
7
|
type CreateOptions = {
|
|
7
8
|
libp2p?: Libp2pCreateOptions;
|
|
8
9
|
directory?: string;
|
package/lib/esm/session.js
CHANGED
|
@@ -4,6 +4,7 @@ import { DirectBlock } from "@peerbit/blocks";
|
|
|
4
4
|
import { DirectSub } from "@peerbit/pubsub";
|
|
5
5
|
import { Peerbit } from "peerbit";
|
|
6
6
|
import { mplex } from "@libp2p/mplex";
|
|
7
|
+
import { DefaultKeychain } from "@peerbit/keychain";
|
|
7
8
|
export class TestSession {
|
|
8
9
|
session;
|
|
9
10
|
_peers;
|
|
@@ -36,6 +37,7 @@ export class TestSession {
|
|
|
36
37
|
services: {
|
|
37
38
|
blocks: (c) => new DirectBlock(c),
|
|
38
39
|
pubsub: (c) => new DirectSub(c, { canRelayMessage: true }),
|
|
40
|
+
keychain: (c) => new DefaultKeychain(),
|
|
39
41
|
...o?.libp2p?.services
|
|
40
42
|
},
|
|
41
43
|
streamMuxers: [mplex({ disconnectThreshold: 10 })]
|
package/lib/esm/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAEN,YAAY,IAAI,mBAAmB,EACnC,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,MAAM,OAAO,WAAW;IACf,OAAO,CAAiC;IACxC,MAAM,CAAY;IAC1B,YAAY,OAAuC,EAAE,KAAgB;QACpE,IAAI,CAAC,OAAO,GAAG,OAAO,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1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peerbit/test-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Test utils for Peerbit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"author": "dao.xyz",
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@peerbit/libp2p-test-utils": "
|
|
41
|
-
"peerbit": "
|
|
40
|
+
"@peerbit/libp2p-test-utils": "2.0.0",
|
|
41
|
+
"peerbit": "3.0.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@peerbit/time": "
|
|
44
|
+
"@peerbit/time": "2.0.0"
|
|
45
45
|
},
|
|
46
46
|
"localMaintainers": [
|
|
47
47
|
"dao.xyz"
|
|
48
48
|
],
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "c48cb37d237a25b0bcc849482b43f6941d53e3d5"
|
|
50
50
|
}
|
package/src/index.ts
CHANGED
package/src/session.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TestSession as SSession,
|
|
3
|
-
LibP2POptions as SLibP2POptions
|
|
4
|
-
} from "@peerbit/libp2p-test-utils";
|
|
1
|
+
import { TestSession as SSession } from "@peerbit/libp2p-test-utils";
|
|
5
2
|
import {
|
|
6
3
|
DirectStream,
|
|
7
4
|
waitForPeers as waitForPeersStreams
|
|
@@ -16,8 +13,10 @@ import { DirectSub } from "@peerbit/pubsub";
|
|
|
16
13
|
import { Peerbit } from "peerbit";
|
|
17
14
|
import { ProgramClient } from "@peerbit/program";
|
|
18
15
|
import { mplex } from "@libp2p/mplex";
|
|
16
|
+
import { DefaultKeychain } from "@peerbit/keychain";
|
|
17
|
+
import { Libp2pOptions } from "libp2p";
|
|
19
18
|
|
|
20
|
-
export type LibP2POptions =
|
|
19
|
+
export type LibP2POptions = Libp2pOptions<Libp2pExtendServices>;
|
|
21
20
|
|
|
22
21
|
type CreateOptions = { libp2p?: Libp2pCreateOptions; directory?: string };
|
|
23
22
|
export class TestSession {
|
|
@@ -61,6 +60,7 @@ export class TestSession {
|
|
|
61
60
|
services: {
|
|
62
61
|
blocks: (c) => new DirectBlock(c),
|
|
63
62
|
pubsub: (c) => new DirectSub(c, { canRelayMessage: true }),
|
|
63
|
+
keychain: (c) => new DefaultKeychain(),
|
|
64
64
|
...o?.libp2p?.services
|
|
65
65
|
},
|
|
66
66
|
streamMuxers: [mplex({ disconnectThreshold: 10 })]
|
package/lib/esm/storage.d.ts
DELETED
package/lib/esm/storage.js
DELETED
package/lib/esm/storage.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG,GAA2C,EAAE;IACvE,OAAO,IAAI,WAAW,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC;AACnD,CAAC,CAAC"}
|