@acala-network/chopsticks-testing 0.9.2-3 → 0.9.2-4
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/dist/cjs/index.js +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/types/index.d.ts +2 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -65,7 +65,7 @@ function _export_star(from, to) {
|
|
|
65
65
|
});
|
|
66
66
|
return from;
|
|
67
67
|
}
|
|
68
|
-
const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, port, maxMemoryBlockCount, resume })=>{
|
|
68
|
+
const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, port, maxMemoryBlockCount, resume, runtimeLogLevel })=>{
|
|
69
69
|
// random port if not specified
|
|
70
70
|
port = port ?? Math.floor(Math.random() * 10000) + 10000;
|
|
71
71
|
const config = {
|
|
@@ -75,6 +75,7 @@ const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, time
|
|
|
75
75
|
'mock-signature-host': true,
|
|
76
76
|
'build-block-mode': _chopsticks.BuildBlockMode.Manual,
|
|
77
77
|
'max-memory-block-count': maxMemoryBlockCount ?? 100,
|
|
78
|
+
'runtime-log-level': runtimeLogLevel,
|
|
78
79
|
db,
|
|
79
80
|
'wasm-override': wasmOverride,
|
|
80
81
|
timeout,
|
|
@@ -88,12 +89,11 @@ const setupContext = async (option)=>{
|
|
|
88
89
|
const setupContextWithConfig = async ({ timeout, ...config })=>{
|
|
89
90
|
const { chain, listenPort, close } = await (0, _chopsticks.setupWithServer)(config);
|
|
90
91
|
const url = `ws://localhost:${listenPort}`;
|
|
91
|
-
const ws = new _api.WsProvider(url,
|
|
92
|
+
const ws = new _api.WsProvider(url, 3_000, undefined, timeout);
|
|
92
93
|
const api = await _api.ApiPromise.create({
|
|
93
94
|
provider: ws,
|
|
94
95
|
noInitWarn: true
|
|
95
96
|
});
|
|
96
|
-
await api.isReady;
|
|
97
97
|
return {
|
|
98
98
|
url,
|
|
99
99
|
chain,
|
package/dist/esm/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Keyring, createTestKeyring } from '@polkadot/keyring';
|
|
|
4
4
|
import { expect } from 'vitest';
|
|
5
5
|
export * from './check.js';
|
|
6
6
|
export * from './signFake.js';
|
|
7
|
-
export const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, port, maxMemoryBlockCount, resume })=>{
|
|
7
|
+
export const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, port, maxMemoryBlockCount, resume, runtimeLogLevel })=>{
|
|
8
8
|
// random port if not specified
|
|
9
9
|
port = port ?? Math.floor(Math.random() * 10000) + 10000;
|
|
10
10
|
const config = {
|
|
@@ -14,6 +14,7 @@ export const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, d
|
|
|
14
14
|
'mock-signature-host': true,
|
|
15
15
|
'build-block-mode': BuildBlockMode.Manual,
|
|
16
16
|
'max-memory-block-count': maxMemoryBlockCount ?? 100,
|
|
17
|
+
'runtime-log-level': runtimeLogLevel,
|
|
17
18
|
db,
|
|
18
19
|
'wasm-override': wasmOverride,
|
|
19
20
|
timeout,
|
|
@@ -27,12 +28,11 @@ export const setupContext = async (option)=>{
|
|
|
27
28
|
export const setupContextWithConfig = async ({ timeout, ...config })=>{
|
|
28
29
|
const { chain, listenPort, close } = await setupWithServer(config);
|
|
29
30
|
const url = `ws://localhost:${listenPort}`;
|
|
30
|
-
const ws = new WsProvider(url,
|
|
31
|
+
const ws = new WsProvider(url, 3_000, undefined, timeout);
|
|
31
32
|
const api = await ApiPromise.create({
|
|
32
33
|
provider: ws,
|
|
33
34
|
noInitWarn: true
|
|
34
35
|
});
|
|
35
|
-
await api.isReady;
|
|
36
36
|
return {
|
|
37
37
|
url,
|
|
38
38
|
chain,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,11 +17,12 @@ export type SetupOption = {
|
|
|
17
17
|
port?: number;
|
|
18
18
|
maxMemoryBlockCount?: number;
|
|
19
19
|
resume?: boolean | HexString | number;
|
|
20
|
+
runtimeLogLevel?: number;
|
|
20
21
|
};
|
|
21
22
|
export type SetupConfig = Config & {
|
|
22
23
|
timeout?: number;
|
|
23
24
|
};
|
|
24
|
-
export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, port, maxMemoryBlockCount, resume, }: SetupOption) => SetupConfig;
|
|
25
|
+
export declare const createConfig: ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, port, maxMemoryBlockCount, resume, runtimeLogLevel, }: SetupOption) => SetupConfig;
|
|
25
26
|
export declare const setupContext: (option: SetupOption) => Promise<{
|
|
26
27
|
url: string;
|
|
27
28
|
chain: import("@acala-network/chopsticks").Blockchain;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks-testing",
|
|
3
|
-
"version": "0.9.2-
|
|
3
|
+
"version": "0.9.2-4",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly --outDir dist/types"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@acala-network/chopsticks": "0.9.2-
|
|
15
|
+
"@acala-network/chopsticks": "0.9.2-4"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"vitest": "^0.34.0"
|