@acala-network/chopsticks-utils 1.4.1 → 1.5.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.
@@ -6,6 +6,7 @@ import type { SubmittableExtrinsic } from '@polkadot/api-base/types';
6
6
  import { Keyring } from '@polkadot/keyring';
7
7
  import type { Codec } from '@polkadot/types/types';
8
8
  import type { HexString } from '@polkadot/util/types';
9
+ export { type BridgeHandle, type ConnectBridgeHubsConfig, connectBridgeHubs } from '@acala-network/chopsticks';
9
10
  export * from './signFake.js';
10
11
  /**
11
12
  * Configuration options for setting up a blockchain network instance
@@ -21,8 +22,10 @@ export type SetupOption = {
21
22
  wasmOverride?: string;
22
23
  /** Path to database file */
23
24
  db?: string;
24
- /** Connection timeout in milliseconds */
25
+ /** Timeout (ms) for the test-side WsProvider connecting to the in-process chopsticks server */
25
26
  timeout?: number;
27
+ /** Timeout (ms) for chopsticks' own upstream RPC client (chopsticks → upstream/proxy). Forwarded as `rpc-timeout` in the chopsticks config */
28
+ rpcTimeout?: number;
26
29
  /** Host address to bind the server to */
27
30
  host?: string;
28
31
  /** Port number to bind the server to */
@@ -52,7 +55,7 @@ export type SetupConfig = Config & {
52
55
  * @param options - Setup options for the network
53
56
  * @returns Configuration object compatible with chopsticks
54
57
  */
55
- export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock, }: SetupOption) => SetupConfig;
58
+ export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, rpcTimeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock, }: SetupOption) => SetupConfig;
56
59
  /**
57
60
  * Sets up a blockchain network context using provided options
58
61
  * @param option - Setup options for the network
package/dist/cjs/index.js CHANGED
@@ -9,6 +9,9 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ get connectBridgeHubs () {
13
+ return _chopsticks.connectBridgeHubs;
14
+ },
12
15
  get createConfig () {
13
16
  return createConfig;
14
17
  },
@@ -57,7 +60,7 @@ function _export_star(from, to) {
57
60
  const logger = _chopsticks.defaultLogger.child({
58
61
  name: 'utils'
59
62
  });
60
- const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock })=>{
63
+ const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, rpcTimeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock })=>{
61
64
  // random port if not specified
62
65
  port = port ?? Math.floor(Math.random() * 10000) + 10000;
63
66
  const config = {
@@ -72,6 +75,7 @@ const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, time
72
75
  db,
73
76
  'wasm-override': wasmOverride,
74
77
  timeout,
78
+ 'rpc-timeout': rpcTimeout,
75
79
  resume: resume ?? false,
76
80
  'allow-unresolved-imports': allowUnresolvedImports,
77
81
  'process-queued-messages': processQueuedMessages,
@@ -6,6 +6,7 @@ import type { SubmittableExtrinsic } from '@polkadot/api-base/types';
6
6
  import { Keyring } from '@polkadot/keyring';
7
7
  import type { Codec } from '@polkadot/types/types';
8
8
  import type { HexString } from '@polkadot/util/types';
9
+ export { type BridgeHandle, type ConnectBridgeHubsConfig, connectBridgeHubs } from '@acala-network/chopsticks';
9
10
  export * from './signFake.js';
10
11
  /**
11
12
  * Configuration options for setting up a blockchain network instance
@@ -21,8 +22,10 @@ export type SetupOption = {
21
22
  wasmOverride?: string;
22
23
  /** Path to database file */
23
24
  db?: string;
24
- /** Connection timeout in milliseconds */
25
+ /** Timeout (ms) for the test-side WsProvider connecting to the in-process chopsticks server */
25
26
  timeout?: number;
27
+ /** Timeout (ms) for chopsticks' own upstream RPC client (chopsticks → upstream/proxy). Forwarded as `rpc-timeout` in the chopsticks config */
28
+ rpcTimeout?: number;
26
29
  /** Host address to bind the server to */
27
30
  host?: string;
28
31
  /** Port number to bind the server to */
@@ -52,7 +55,7 @@ export type SetupConfig = Config & {
52
55
  * @param options - Setup options for the network
53
56
  * @returns Configuration object compatible with chopsticks
54
57
  */
55
- export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock, }: SetupOption) => SetupConfig;
58
+ export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, rpcTimeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock, }: SetupOption) => SetupConfig;
56
59
  /**
57
60
  * Sets up a blockchain network context using provided options
58
61
  * @param option - Setup options for the network
package/dist/esm/index.js CHANGED
@@ -7,12 +7,14 @@ import { getPolkadotSigner } from 'polkadot-api/signer';
7
7
  const logger = defaultLogger.child({
8
8
  name: 'utils'
9
9
  });
10
+ // Re-exported from `@acala-network/chopsticks` (lives there because the CLI needs it).
11
+ export { connectBridgeHubs } from '@acala-network/chopsticks';
10
12
  export * from './signFake.js';
11
13
  /**
12
14
  * Creates a configuration object from setup options
13
15
  * @param options - Setup options for the network
14
16
  * @returns Configuration object compatible with chopsticks
15
- */ export const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock })=>{
17
+ */ export const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, rpcTimeout, host, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports, processQueuedMessages, saveBlock })=>{
16
18
  // random port if not specified
17
19
  port = port ?? Math.floor(Math.random() * 10000) + 10000;
18
20
  const config = {
@@ -27,6 +29,7 @@ export * from './signFake.js';
27
29
  db,
28
30
  'wasm-override': wasmOverride,
29
31
  timeout,
32
+ 'rpc-timeout': rpcTimeout,
30
33
  resume: resume ?? false,
31
34
  'allow-unresolved-imports': allowUnresolvedImports,
32
35
  'process-queued-messages': processQueuedMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-utils",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -13,8 +13,8 @@
13
13
  "depcheck": "npx depcheck"
14
14
  },
15
15
  "dependencies": {
16
- "@acala-network/chopsticks": "1.4.1",
17
- "@acala-network/chopsticks-core": "1.4.1",
16
+ "@acala-network/chopsticks": "1.5.0",
17
+ "@acala-network/chopsticks-core": "1.5.0",
18
18
  "@polkadot-labs/hdkd": "^0.0.19",
19
19
  "@polkadot-labs/hdkd-helpers": "^0.0.19",
20
20
  "@polkadot/api": "^16.4.1",