@acala-network/chopsticks-core 0.9.2 → 0.9.3-2
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/blockchain/index.js +5 -7
- package/dist/cjs/wasm-executor/index.js +4 -6
- package/dist/esm/blockchain/index.js +1 -3
- package/dist/esm/wasm-executor/index.js +1 -3
- package/dist/types/blockchain/index.d.ts +1 -1
- package/dist/types/wasm-executor/index.d.ts +1 -1
- package/package.json +8 -9
|
@@ -17,8 +17,7 @@ const _block = require("./block.js");
|
|
|
17
17
|
const _txpool = require("./txpool.js");
|
|
18
18
|
const _headstate = require("./head-state.js");
|
|
19
19
|
const _offchain = require("../offchain.js");
|
|
20
|
-
const _index = require("../
|
|
21
|
-
const _index1 = require("../utils/index.js");
|
|
20
|
+
const _index = require("../utils/index.js");
|
|
22
21
|
const _logger = require("../logger.js");
|
|
23
22
|
const _blockbuilder = require("./block-builder.js");
|
|
24
23
|
function _check_private_redeclaration(obj, privateCollection) {
|
|
@@ -373,7 +372,7 @@ class Blockchain {
|
|
|
373
372
|
const needsDispatch = meta.registry.createType('Vec<u32>', Object.keys(ump));
|
|
374
373
|
const storageValues = [
|
|
375
374
|
[
|
|
376
|
-
(0,
|
|
375
|
+
(0, _index.compactHex)(meta.query.ump.needsDispatch()),
|
|
377
376
|
needsDispatch.toHex()
|
|
378
377
|
]
|
|
379
378
|
];
|
|
@@ -385,11 +384,11 @@ class Blockchain {
|
|
|
385
384
|
upwardMessages.map((x)=>x.byteLength).reduce((s, i)=>s + i, 0)
|
|
386
385
|
]);
|
|
387
386
|
storageValues.push([
|
|
388
|
-
(0,
|
|
387
|
+
(0, _index.compactHex)(meta.query.ump.relayDispatchQueues(paraId)),
|
|
389
388
|
upwardMessages.toHex()
|
|
390
389
|
]);
|
|
391
390
|
storageValues.push([
|
|
392
|
-
(0,
|
|
391
|
+
(0, _index.compactHex)(meta.query.ump.relayDispatchQueueSize(paraId)),
|
|
393
392
|
queueSize.toHex()
|
|
394
393
|
]);
|
|
395
394
|
}
|
|
@@ -415,9 +414,8 @@ class Blockchain {
|
|
|
415
414
|
return inherents;
|
|
416
415
|
}
|
|
417
416
|
/**
|
|
418
|
-
* Close the db and
|
|
417
|
+
* Close the db and disconnect api.
|
|
419
418
|
*/ async close() {
|
|
420
|
-
await (0, _index.releaseWorker)();
|
|
421
419
|
await this.api.disconnect();
|
|
422
420
|
await this.db?.close();
|
|
423
421
|
}
|
|
@@ -18,6 +18,9 @@ _export(exports, {
|
|
|
18
18
|
decodeProof: function() {
|
|
19
19
|
return decodeProof;
|
|
20
20
|
},
|
|
21
|
+
destroyWorker: function() {
|
|
22
|
+
return destroyWorker;
|
|
23
|
+
},
|
|
21
24
|
emptyTaskHandler: function() {
|
|
22
25
|
return emptyTaskHandler;
|
|
23
26
|
},
|
|
@@ -27,9 +30,6 @@ _export(exports, {
|
|
|
27
30
|
getRuntimeVersion: function() {
|
|
28
31
|
return getRuntimeVersion;
|
|
29
32
|
},
|
|
30
|
-
releaseWorker: function() {
|
|
31
|
-
return releaseWorker;
|
|
32
|
-
},
|
|
33
33
|
runTask: function() {
|
|
34
34
|
return runTask;
|
|
35
35
|
},
|
|
@@ -229,12 +229,10 @@ const getAuraSlotDuration = _lodash.default.memoize(async (wasm)=>{
|
|
|
229
229
|
if ('Error' in result) throw new Error(result.Error);
|
|
230
230
|
return (0, _util.u8aToBn)((0, _util.hexToU8a)(result.Call.result).subarray(0, 8 /* u64: 8 bytes */ )).toNumber();
|
|
231
231
|
});
|
|
232
|
-
const
|
|
232
|
+
const destroyWorker = async ()=>{
|
|
233
233
|
if (!__executor_worker) return;
|
|
234
234
|
const executor = await __executor_worker;
|
|
235
235
|
executor.remote[_comlink.releaseProxy]();
|
|
236
|
-
// this delay seems to fix hanging tests
|
|
237
|
-
// https://github.com/vitest-dev/vitest/issues/3077
|
|
238
236
|
await new Promise((resolve)=>setTimeout(resolve, 50));
|
|
239
237
|
await executor.terminate();
|
|
240
238
|
__executor_worker = undefined;
|
|
@@ -7,7 +7,6 @@ import { Block } from './block.js';
|
|
|
7
7
|
import { TxPool } from './txpool.js';
|
|
8
8
|
import { HeadState } from './head-state.js';
|
|
9
9
|
import { OffchainWorker } from '../offchain.js';
|
|
10
|
-
import { releaseWorker } from '../wasm-executor/index.js';
|
|
11
10
|
import { compactHex } from '../utils/index.js';
|
|
12
11
|
import { defaultLogger } from '../logger.js';
|
|
13
12
|
import { dryRunExtrinsic, dryRunInherents } from './block-builder.js';
|
|
@@ -415,9 +414,8 @@ const logger = defaultLogger.child({
|
|
|
415
414
|
return inherents;
|
|
416
415
|
}
|
|
417
416
|
/**
|
|
418
|
-
* Close the db and
|
|
417
|
+
* Close the db and disconnect api.
|
|
419
418
|
*/ async close() {
|
|
420
|
-
await releaseWorker();
|
|
421
419
|
await this.api.disconnect();
|
|
422
420
|
await this.db?.close();
|
|
423
421
|
}
|
|
@@ -145,12 +145,10 @@ export const getAuraSlotDuration = _.memoize(async (wasm)=>{
|
|
|
145
145
|
if ('Error' in result) throw new Error(result.Error);
|
|
146
146
|
return u8aToBn(hexToU8a(result.Call.result).subarray(0, 8 /* u64: 8 bytes */ )).toNumber();
|
|
147
147
|
});
|
|
148
|
-
export const
|
|
148
|
+
export const destroyWorker = async ()=>{
|
|
149
149
|
if (!__executor_worker) return;
|
|
150
150
|
const executor = await __executor_worker;
|
|
151
151
|
executor.remote[Comlink.releaseProxy]();
|
|
152
|
-
// this delay seems to fix hanging tests
|
|
153
|
-
// https://github.com/vitest-dev/vitest/issues/3077
|
|
154
152
|
await new Promise((resolve)=>setTimeout(resolve, 50));
|
|
155
153
|
await executor.terminate();
|
|
156
154
|
__executor_worker = undefined;
|
|
@@ -71,4 +71,4 @@ export declare const emptyTaskHandler: {
|
|
|
71
71
|
offchainSubmitTransaction: (_tx: HexString) => Promise<never>;
|
|
72
72
|
};
|
|
73
73
|
export declare const getAuraSlotDuration: ((wasm: HexString) => Promise<number>) & _.MemoizedFunction;
|
|
74
|
-
export declare const
|
|
74
|
+
export declare const destroyWorker: () => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks-core",
|
|
3
|
-
"version": "0.9.2",
|
|
3
|
+
"version": "0.9.3-2",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"docs:prep": "typedoc"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@acala-network/chopsticks-executor": "0.9.2",
|
|
17
|
-
"@polkadot/api": "^10.10.1",
|
|
16
|
+
"@acala-network/chopsticks-executor": "0.9.3-2",
|
|
18
17
|
"@polkadot/rpc-provider": "^10.10.1",
|
|
19
18
|
"@polkadot/types": "^10.10.1",
|
|
20
19
|
"@polkadot/types-codec": "^10.10.1",
|
|
@@ -24,18 +23,18 @@
|
|
|
24
23
|
"comlink": "^4.4.1",
|
|
25
24
|
"eventemitter3": "^5.0.1",
|
|
26
25
|
"lodash": "^4.17.21",
|
|
27
|
-
"lru-cache": "^10.0.
|
|
28
|
-
"pino": "^8.16.
|
|
26
|
+
"lru-cache": "^10.0.3",
|
|
27
|
+
"pino": "^8.16.2",
|
|
29
28
|
"pino-pretty": "^10.2.3",
|
|
30
29
|
"rxjs": "^7.8.1",
|
|
31
30
|
"zod": "^3.22.4"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
|
-
"@swc/cli": "0.1.
|
|
35
|
-
"@swc/core": "^1.3.
|
|
36
|
-
"@types/lodash": "^4.14.
|
|
33
|
+
"@swc/cli": "0.1.63",
|
|
34
|
+
"@swc/core": "^1.3.99",
|
|
35
|
+
"@types/lodash": "^4.14.202",
|
|
37
36
|
"typescript": "^5.2.2",
|
|
38
|
-
"vitest": "^0.
|
|
37
|
+
"vitest": "^1.0.0-beta.5"
|
|
39
38
|
},
|
|
40
39
|
"files": [
|
|
41
40
|
"dist/esm/**",
|