@acala-network/chopsticks-testing 0.5.10 → 0.6.0

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/index.d.ts CHANGED
@@ -10,8 +10,9 @@ export type SetupOption = {
10
10
  blockHash?: HexString;
11
11
  wasmOverride?: string;
12
12
  db?: string;
13
+ timeout?: number;
13
14
  };
14
- export declare const setupContext: ({ endpoint, blockNumber, blockHash, wasmOverride, db }: SetupOption) => Promise<{
15
+ export declare const setupContext: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout }: SetupOption) => Promise<{
15
16
  chain: import("@acala-network/chopsticks").Blockchain;
16
17
  ws: WsProvider;
17
18
  api: ApiPromise;
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@ import { ApiPromise, WsProvider } from '@polkadot/api';
2
2
  import { BuildBlockMode, setupWithServer } from '@acala-network/chopsticks';
3
3
  import { Keyring } from '@polkadot/keyring';
4
4
  import { expect } from 'vitest';
5
- export const setupContext = async ({ endpoint, blockNumber, blockHash, wasmOverride, db }) => {
5
+ export const setupContext = async ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout }) => {
6
6
  // random port
7
7
  const port = Math.floor(Math.random() * 10000) + 10000;
8
8
  const config = {
@@ -15,7 +15,7 @@ export const setupContext = async ({ endpoint, blockNumber, blockHash, wasmOverr
15
15
  'wasm-override': wasmOverride,
16
16
  };
17
17
  const { chain, listenPort, close } = await setupWithServer(config);
18
- const ws = new WsProvider(`ws://localhost:${listenPort}`);
18
+ const ws = new WsProvider(`ws://localhost:${listenPort}`, undefined, undefined, timeout);
19
19
  const api = await ApiPromise.create({
20
20
  provider: ws,
21
21
  signedExtensions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-testing",
3
- "version": "0.5.10",
3
+ "version": "0.6.0",
4
4
  "author": "Bryan Chen <xlchen1291@gmail.com>",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
@@ -8,14 +8,14 @@
8
8
  "build": "tsc -p ./tsconfig.json"
9
9
  },
10
10
  "dependencies": {
11
- "@acala-network/chopsticks": "^0.5.10"
11
+ "@acala-network/chopsticks": "^0.6.0"
12
12
  },
13
13
  "peerDependencies": {
14
14
  "vitest": "^0.29.2"
15
15
  },
16
16
  "devDependencies": {
17
- "@types/chai": "^4",
18
- "typescript": "^4.9.5"
17
+ "@types/chai": "^4.3.4",
18
+ "typescript": "^5.0.2"
19
19
  },
20
20
  "files": [
21
21
  "lib"