@acala-network/chopsticks-core 1.1.0 → 1.2.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/dist/cjs/blockchain/index.js +1 -1
- package/dist/cjs/blockchain/inherent/parachain/validation-data.js +55 -18
- package/dist/cjs/index.d.ts +12 -12
- package/dist/cjs/index.js +12 -12
- package/dist/cjs/rpc/dev/new-block.js +1 -1
- package/dist/cjs/rpc/dev/set-storage.d.ts +1 -1
- package/dist/cjs/rpc/dev/set-storage.js +1 -1
- package/dist/cjs/rpc/index.d.ts +1 -1
- package/dist/cjs/utils/index.d.ts +2 -2
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/wasm-executor/index.d.ts +1 -1
- package/dist/cjs/wasm-executor/node-wasm-executor.js +1 -1
- package/dist/esm/blockchain/index.js +1 -1
- package/dist/esm/blockchain/inherent/parachain/validation-data.js +56 -19
- package/dist/esm/blockchain/storage-layer.js +1 -1
- package/dist/esm/index.d.ts +12 -12
- package/dist/esm/index.js +12 -12
- package/dist/esm/rpc/dev/new-block.js +1 -1
- package/dist/esm/rpc/dev/set-storage.d.ts +1 -1
- package/dist/esm/rpc/dev/set-storage.js +1 -1
- package/dist/esm/rpc/index.d.ts +1 -1
- package/dist/esm/utils/index.d.ts +2 -2
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/wasm-executor/index.d.ts +1 -1
- package/dist/esm/wasm-executor/node-wasm-executor.js +1 -1
- package/package.json +14 -14
|
@@ -16,8 +16,8 @@ const _lodash = /*#__PURE__*/ _interop_require_default(require("lodash"));
|
|
|
16
16
|
const _logger = require("../logger.js");
|
|
17
17
|
const _offchain = require("../offchain.js");
|
|
18
18
|
const _index = require("../utils/index.js");
|
|
19
|
-
const _blockbuilder = require("./block-builder.js");
|
|
20
19
|
const _block = require("./block.js");
|
|
20
|
+
const _blockbuilder = require("./block-builder.js");
|
|
21
21
|
const _headstate = require("./head-state.js");
|
|
22
22
|
const _txpool = require("./txpool.js");
|
|
23
23
|
function _check_private_redeclaration(obj, privateCollection) {
|
|
@@ -10,8 +10,8 @@ Object.defineProperty(exports, "SetValidationData", {
|
|
|
10
10
|
});
|
|
11
11
|
const _types = require("@polkadot/types");
|
|
12
12
|
const _util = require("@polkadot/util");
|
|
13
|
-
const _lodash = /*#__PURE__*/ _interop_require_default(require("lodash"));
|
|
14
13
|
const _utilcrypto = require("@polkadot/util-crypto");
|
|
14
|
+
const _lodash = /*#__PURE__*/ _interop_require_default(require("lodash"));
|
|
15
15
|
const _index = require("../../../utils/index.js");
|
|
16
16
|
const _proof = require("../../../utils/proof.js");
|
|
17
17
|
const _index1 = require("../../../wasm-executor/index.js");
|
|
@@ -242,22 +242,59 @@ class SetValidationData {
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
const { trieRootHash, nodes } = await (0, _index1.createProof)(extrinsic.relayChainState.trieNodes, newEntries);
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
245
|
+
const argsLengh = meta.tx.parachainSystem.setValidationData.meta.args.length;
|
|
246
|
+
if (argsLengh === 1) {
|
|
247
|
+
// old version
|
|
248
|
+
const newData = {
|
|
249
|
+
...extrinsic,
|
|
250
|
+
downwardMessages,
|
|
251
|
+
horizontalMessages,
|
|
252
|
+
validationData: {
|
|
253
|
+
...extrinsic.validationData,
|
|
254
|
+
relayParentStorageRoot: trieRootHash,
|
|
255
|
+
relayParentNumber: params.relayParentNumber ?? extrinsic.validationData.relayParentNumber + relaySlotIncrease
|
|
256
|
+
},
|
|
257
|
+
relayChainState: {
|
|
258
|
+
trieNodes: nodes
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
const inherent = new _types.GenericExtrinsic(meta.registry, meta.tx.parachainSystem.setValidationData(newData));
|
|
262
|
+
return [
|
|
263
|
+
inherent.toHex()
|
|
264
|
+
];
|
|
265
|
+
} else if (argsLengh === 2) {
|
|
266
|
+
// new version
|
|
267
|
+
const newData = {
|
|
268
|
+
...extrinsic,
|
|
269
|
+
validationData: {
|
|
270
|
+
...extrinsic.validationData,
|
|
271
|
+
relayParentStorageRoot: trieRootHash,
|
|
272
|
+
relayParentNumber: params.relayParentNumber ?? extrinsic.validationData.relayParentNumber + relaySlotIncrease
|
|
273
|
+
},
|
|
274
|
+
relayChainState: {
|
|
275
|
+
trieNodes: nodes
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
const horizontalMessagesArray = Object.entries(horizontalMessages).flatMap(([sender, messages])=>messages.map((msg)=>[
|
|
279
|
+
sender,
|
|
280
|
+
msg
|
|
281
|
+
]));
|
|
282
|
+
const inboundMessagesData = {
|
|
283
|
+
downwardMessages: {
|
|
284
|
+
full_messages: downwardMessages,
|
|
285
|
+
hashed_messages: []
|
|
286
|
+
},
|
|
287
|
+
horizontalMessages: {
|
|
288
|
+
full_messages: horizontalMessagesArray,
|
|
289
|
+
hashed_messages: []
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
const inherent = new _types.GenericExtrinsic(meta.registry, meta.tx.parachainSystem.setValidationData(newData, inboundMessagesData));
|
|
293
|
+
return [
|
|
294
|
+
inherent.toHex()
|
|
295
|
+
];
|
|
296
|
+
} else {
|
|
297
|
+
throw new Error('Unsupported setValidationData');
|
|
298
|
+
}
|
|
262
299
|
}
|
|
263
300
|
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -30,22 +30,22 @@ export type SignedBlock = {
|
|
|
30
30
|
justifications?: HexString[];
|
|
31
31
|
};
|
|
32
32
|
export * from './api.js';
|
|
33
|
-
export * from './blockchain/index.js';
|
|
34
33
|
export * from './blockchain/block.js';
|
|
35
34
|
export * from './blockchain/block-builder.js';
|
|
36
|
-
export * from './blockchain/txpool.js';
|
|
37
|
-
export * from './blockchain/storage-layer.js';
|
|
38
35
|
export * from './blockchain/head-state.js';
|
|
39
|
-
export * from './
|
|
40
|
-
export * from './utils/index.js';
|
|
41
|
-
export * from './wasm-executor/index.js';
|
|
42
|
-
export * from './schema/index.js';
|
|
43
|
-
export * from './xcm/index.js';
|
|
44
|
-
export * from './setup.js';
|
|
45
|
-
export * from './database.js';
|
|
36
|
+
export * from './blockchain/index.js';
|
|
46
37
|
export * from './blockchain/inherent/index.js';
|
|
47
|
-
export * from './
|
|
48
|
-
export * from './
|
|
38
|
+
export * from './blockchain/storage-layer.js';
|
|
39
|
+
export * from './blockchain/txpool.js';
|
|
49
40
|
export * from './chopsticks-provider.js';
|
|
41
|
+
export * from './database.js';
|
|
42
|
+
export * from './env.js';
|
|
50
43
|
export * from './genesis-provider.js';
|
|
44
|
+
export * from './logger.js';
|
|
45
|
+
export * from './offchain.js';
|
|
51
46
|
export * from './rpc/index.js';
|
|
47
|
+
export * from './schema/index.js';
|
|
48
|
+
export * from './setup.js';
|
|
49
|
+
export * from './utils/index.js';
|
|
50
|
+
export * from './wasm-executor/index.js';
|
|
51
|
+
export * from './xcm/index.js';
|
package/dist/cjs/index.js
CHANGED
|
@@ -11,25 +11,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
11
11
|
value: true
|
|
12
12
|
});
|
|
13
13
|
_export_star(require("./api.js"), exports);
|
|
14
|
-
_export_star(require("./blockchain/index.js"), exports);
|
|
15
14
|
_export_star(require("./blockchain/block.js"), exports);
|
|
16
15
|
_export_star(require("./blockchain/block-builder.js"), exports);
|
|
17
|
-
_export_star(require("./blockchain/txpool.js"), exports);
|
|
18
|
-
_export_star(require("./blockchain/storage-layer.js"), exports);
|
|
19
16
|
_export_star(require("./blockchain/head-state.js"), exports);
|
|
20
|
-
_export_star(require("./
|
|
21
|
-
_export_star(require("./utils/index.js"), exports);
|
|
22
|
-
_export_star(require("./wasm-executor/index.js"), exports);
|
|
23
|
-
_export_star(require("./schema/index.js"), exports);
|
|
24
|
-
_export_star(require("./xcm/index.js"), exports);
|
|
25
|
-
_export_star(require("./setup.js"), exports);
|
|
26
|
-
_export_star(require("./database.js"), exports);
|
|
17
|
+
_export_star(require("./blockchain/index.js"), exports);
|
|
27
18
|
_export_star(require("./blockchain/inherent/index.js"), exports);
|
|
28
|
-
_export_star(require("./
|
|
29
|
-
_export_star(require("./
|
|
19
|
+
_export_star(require("./blockchain/storage-layer.js"), exports);
|
|
20
|
+
_export_star(require("./blockchain/txpool.js"), exports);
|
|
30
21
|
_export_star(require("./chopsticks-provider.js"), exports);
|
|
22
|
+
_export_star(require("./database.js"), exports);
|
|
23
|
+
_export_star(require("./env.js"), exports);
|
|
31
24
|
_export_star(require("./genesis-provider.js"), exports);
|
|
25
|
+
_export_star(require("./logger.js"), exports);
|
|
26
|
+
_export_star(require("./offchain.js"), exports);
|
|
32
27
|
_export_star(require("./rpc/index.js"), exports);
|
|
28
|
+
_export_star(require("./schema/index.js"), exports);
|
|
29
|
+
_export_star(require("./setup.js"), exports);
|
|
30
|
+
_export_star(require("./utils/index.js"), exports);
|
|
31
|
+
_export_star(require("./wasm-executor/index.js"), exports);
|
|
32
|
+
_export_star(require("./xcm/index.js"), exports);
|
|
33
33
|
function _export_star(from, to) {
|
|
34
34
|
Object.keys(from).forEach(function(k) {
|
|
35
35
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "dev_newBlock", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _zod = require("zod");
|
|
12
|
-
const _shared = require("../shared.js");
|
|
13
12
|
const _logger = require("../../logger.js");
|
|
13
|
+
const _shared = require("../shared.js");
|
|
14
14
|
const schema = _zod.z.object({
|
|
15
15
|
count: _zod.z.number().optional(),
|
|
16
16
|
to: _zod.z.number().optional(),
|
|
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "dev_setStorage", {
|
|
|
8
8
|
return dev_setStorage;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _shared = require("../shared.js");
|
|
12
11
|
const _logger = require("../../logger.js");
|
|
13
12
|
const _setstorage = require("../../utils/set-storage.js");
|
|
13
|
+
const _shared = require("../shared.js");
|
|
14
14
|
const dev_setStorage = async (context, params)=>{
|
|
15
15
|
const [values, blockHash] = params;
|
|
16
16
|
const hash = await (0, _setstorage.setStorage)(context.chain, values, blockHash).catch((error)=>{
|
package/dist/cjs/rpc/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import type { Handlers } from './shared.js';
|
|
|
3
3
|
import substrate from './substrate/index.js';
|
|
4
4
|
export declare const allHandlers: Handlers;
|
|
5
5
|
export { substrate, dev };
|
|
6
|
+
export type { Context, Handler, Handlers, SubscriptionManager } from './shared.js';
|
|
6
7
|
export { ResponseError } from './shared.js';
|
|
7
|
-
export type { Context, SubscriptionManager, Handler, Handlers } from './shared.js';
|
|
@@ -2,9 +2,9 @@ import type { StorageKey } from '@polkadot/types';
|
|
|
2
2
|
import type { HexString } from '@polkadot/util/types';
|
|
3
3
|
import type { Block } from '../blockchain/block.js';
|
|
4
4
|
import type { Blockchain } from '../blockchain/index.js';
|
|
5
|
+
export * from './decoder.js';
|
|
5
6
|
export * from './set-storage.js';
|
|
6
7
|
export * from './time-travel.js';
|
|
7
|
-
export * from './decoder.js';
|
|
8
8
|
export type GetKeys = (startKey?: string) => Promise<StorageKey<any>[]>;
|
|
9
9
|
export type ProcessKey = (key: StorageKey<any>) => any;
|
|
10
10
|
export declare function fetchKeys(getKeys: GetKeys, processKey: ProcessKey): Promise<void>;
|
|
@@ -22,7 +22,7 @@ export declare const CHILD_PREFIX_LENGTH: number;
|
|
|
22
22
|
export declare const PREFIX_LENGTH = 66;
|
|
23
23
|
export declare const prefixedChildKey: (prefix: HexString, key: HexString) => HexString;
|
|
24
24
|
export declare const isPrefixedChildKey: (key: HexString) => boolean;
|
|
25
|
-
export declare const splitChildKey: (key: HexString) => [`0x${string}`, `0x${string}`]
|
|
25
|
+
export declare const splitChildKey: (key: HexString) => never[] | [`0x${string}`, `0x${string}`];
|
|
26
26
|
export declare const stripChildPrefix: (key: HexString) => `0x${string}`;
|
|
27
27
|
export declare const getCurrentSlot: (head: Block) => Promise<number>;
|
|
28
28
|
export declare const getCurrentTimestamp: (head: Block) => Promise<bigint>;
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -58,9 +58,9 @@ _export(exports, {
|
|
|
58
58
|
const _util = require("@polkadot/util");
|
|
59
59
|
const _hex = require("@polkadot/util/hex");
|
|
60
60
|
const _index = require("../wasm-executor/index.js");
|
|
61
|
+
_export_star(require("./decoder.js"), exports);
|
|
61
62
|
_export_star(require("./set-storage.js"), exports);
|
|
62
63
|
_export_star(require("./time-travel.js"), exports);
|
|
63
|
-
_export_star(require("./decoder.js"), exports);
|
|
64
64
|
function _export_star(from, to) {
|
|
65
65
|
Object.keys(from).forEach(function(k) {
|
|
66
66
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { JsCallback } from '@acala-network/chopsticks-executor';
|
|
1
2
|
import type { HexString } from '@polkadot/util/types';
|
|
2
3
|
import * as Comlink from 'comlink';
|
|
3
4
|
import _ from 'lodash';
|
|
4
5
|
import type { Block } from '../blockchain/block.js';
|
|
5
|
-
import type { JsCallback } from '@acala-network/chopsticks-executor';
|
|
6
6
|
export type { JsCallback };
|
|
7
7
|
export type RuntimeVersion = {
|
|
8
8
|
specName: string;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
const _nodeworker_threads = require("node:worker_threads");
|
|
5
6
|
const _chopsticksexecutor = /*#__PURE__*/ _interop_require_wildcard(require("@acala-network/chopsticks-executor"));
|
|
6
7
|
const _comlink = /*#__PURE__*/ _interop_require_wildcard(require("comlink"));
|
|
7
|
-
const _nodeworker_threads = require("node:worker_threads");
|
|
8
8
|
const _nodeadapter = /*#__PURE__*/ _interop_require_default(require("comlink/dist/umd/node-adapter.js"));
|
|
9
9
|
function _interop_require_default(obj) {
|
|
10
10
|
return obj && obj.__esModule ? obj : {
|
|
@@ -6,8 +6,8 @@ import _ from 'lodash';
|
|
|
6
6
|
import { defaultLogger } from '../logger.js';
|
|
7
7
|
import { OffchainWorker } from '../offchain.js';
|
|
8
8
|
import { compactHex } from '../utils/index.js';
|
|
9
|
-
import { dryRunExtrinsic, dryRunInherents } from './block-builder.js';
|
|
10
9
|
import { Block } from './block.js';
|
|
10
|
+
import { dryRunExtrinsic, dryRunInherents } from './block-builder.js';
|
|
11
11
|
import { HeadState } from './head-state.js';
|
|
12
12
|
import { TxPool } from './txpool.js';
|
|
13
13
|
const logger = defaultLogger.child({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GenericExtrinsic } from '@polkadot/types';
|
|
2
2
|
import { hexToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
|
|
3
|
-
import _ from 'lodash';
|
|
4
3
|
import { blake2AsHex, blake2AsU8a } from '@polkadot/util-crypto';
|
|
4
|
+
import _ from 'lodash';
|
|
5
5
|
import { compactHex, getCurrentSlot, getParaId } from '../../../utils/index.js';
|
|
6
|
-
import {
|
|
6
|
+
import { dmqMqcHead, hrmpChannels, hrmpEgressChannelIndex, hrmpIngressChannelIndex, paraHead, upgradeGoAheadSignal, WELL_KNOWN_KEYS } from '../../../utils/proof.js';
|
|
7
7
|
import { createProof, decodeProof } from '../../../wasm-executor/index.js';
|
|
8
8
|
const MOCK_VALIDATION_DATA = {
|
|
9
9
|
validationData: {
|
|
@@ -227,22 +227,59 @@ export class SetValidationData {
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
const { trieRootHash, nodes } = await createProof(extrinsic.relayChainState.trieNodes, newEntries);
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
230
|
+
const argsLengh = meta.tx.parachainSystem.setValidationData.meta.args.length;
|
|
231
|
+
if (argsLengh === 1) {
|
|
232
|
+
// old version
|
|
233
|
+
const newData = {
|
|
234
|
+
...extrinsic,
|
|
235
|
+
downwardMessages,
|
|
236
|
+
horizontalMessages,
|
|
237
|
+
validationData: {
|
|
238
|
+
...extrinsic.validationData,
|
|
239
|
+
relayParentStorageRoot: trieRootHash,
|
|
240
|
+
relayParentNumber: params.relayParentNumber ?? extrinsic.validationData.relayParentNumber + relaySlotIncrease
|
|
241
|
+
},
|
|
242
|
+
relayChainState: {
|
|
243
|
+
trieNodes: nodes
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
const inherent = new GenericExtrinsic(meta.registry, meta.tx.parachainSystem.setValidationData(newData));
|
|
247
|
+
return [
|
|
248
|
+
inherent.toHex()
|
|
249
|
+
];
|
|
250
|
+
} else if (argsLengh === 2) {
|
|
251
|
+
// new version
|
|
252
|
+
const newData = {
|
|
253
|
+
...extrinsic,
|
|
254
|
+
validationData: {
|
|
255
|
+
...extrinsic.validationData,
|
|
256
|
+
relayParentStorageRoot: trieRootHash,
|
|
257
|
+
relayParentNumber: params.relayParentNumber ?? extrinsic.validationData.relayParentNumber + relaySlotIncrease
|
|
258
|
+
},
|
|
259
|
+
relayChainState: {
|
|
260
|
+
trieNodes: nodes
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
const horizontalMessagesArray = Object.entries(horizontalMessages).flatMap(([sender, messages])=>messages.map((msg)=>[
|
|
264
|
+
sender,
|
|
265
|
+
msg
|
|
266
|
+
]));
|
|
267
|
+
const inboundMessagesData = {
|
|
268
|
+
downwardMessages: {
|
|
269
|
+
full_messages: downwardMessages,
|
|
270
|
+
hashed_messages: []
|
|
271
|
+
},
|
|
272
|
+
horizontalMessages: {
|
|
273
|
+
full_messages: horizontalMessagesArray,
|
|
274
|
+
hashed_messages: []
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
const inherent = new GenericExtrinsic(meta.registry, meta.tx.parachainSystem.setValidationData(newData, inboundMessagesData));
|
|
278
|
+
return [
|
|
279
|
+
inherent.toHex()
|
|
280
|
+
];
|
|
281
|
+
} else {
|
|
282
|
+
throw new Error('Unsupported setValidationData');
|
|
283
|
+
}
|
|
247
284
|
}
|
|
248
285
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { defaultLogger } from '../logger.js';
|
|
3
|
-
import { CHILD_PREFIX_LENGTH,
|
|
3
|
+
import { CHILD_PREFIX_LENGTH, isPrefixedChildKey, PREFIX_LENGTH } from '../utils/index.js';
|
|
4
4
|
import KeyCache from '../utils/key-cache.js';
|
|
5
5
|
const logger = defaultLogger.child({
|
|
6
6
|
name: 'layer'
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -30,22 +30,22 @@ export type SignedBlock = {
|
|
|
30
30
|
justifications?: HexString[];
|
|
31
31
|
};
|
|
32
32
|
export * from './api.js';
|
|
33
|
-
export * from './blockchain/index.js';
|
|
34
33
|
export * from './blockchain/block.js';
|
|
35
34
|
export * from './blockchain/block-builder.js';
|
|
36
|
-
export * from './blockchain/txpool.js';
|
|
37
|
-
export * from './blockchain/storage-layer.js';
|
|
38
35
|
export * from './blockchain/head-state.js';
|
|
39
|
-
export * from './
|
|
40
|
-
export * from './utils/index.js';
|
|
41
|
-
export * from './wasm-executor/index.js';
|
|
42
|
-
export * from './schema/index.js';
|
|
43
|
-
export * from './xcm/index.js';
|
|
44
|
-
export * from './setup.js';
|
|
45
|
-
export * from './database.js';
|
|
36
|
+
export * from './blockchain/index.js';
|
|
46
37
|
export * from './blockchain/inherent/index.js';
|
|
47
|
-
export * from './
|
|
48
|
-
export * from './
|
|
38
|
+
export * from './blockchain/storage-layer.js';
|
|
39
|
+
export * from './blockchain/txpool.js';
|
|
49
40
|
export * from './chopsticks-provider.js';
|
|
41
|
+
export * from './database.js';
|
|
42
|
+
export * from './env.js';
|
|
50
43
|
export * from './genesis-provider.js';
|
|
44
|
+
export * from './logger.js';
|
|
45
|
+
export * from './offchain.js';
|
|
51
46
|
export * from './rpc/index.js';
|
|
47
|
+
export * from './schema/index.js';
|
|
48
|
+
export * from './setup.js';
|
|
49
|
+
export * from './utils/index.js';
|
|
50
|
+
export * from './wasm-executor/index.js';
|
|
51
|
+
export * from './xcm/index.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -7,22 +7,22 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/ export * from './api.js';
|
|
10
|
-
export * from './blockchain/index.js';
|
|
11
10
|
export * from './blockchain/block.js';
|
|
12
11
|
export * from './blockchain/block-builder.js';
|
|
13
|
-
export * from './blockchain/txpool.js';
|
|
14
|
-
export * from './blockchain/storage-layer.js';
|
|
15
12
|
export * from './blockchain/head-state.js';
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './utils/index.js';
|
|
18
|
-
export * from './wasm-executor/index.js';
|
|
19
|
-
export * from './schema/index.js';
|
|
20
|
-
export * from './xcm/index.js';
|
|
21
|
-
export * from './setup.js';
|
|
22
|
-
export * from './database.js';
|
|
13
|
+
export * from './blockchain/index.js';
|
|
23
14
|
export * from './blockchain/inherent/index.js';
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
15
|
+
export * from './blockchain/storage-layer.js';
|
|
16
|
+
export * from './blockchain/txpool.js';
|
|
26
17
|
export * from './chopsticks-provider.js';
|
|
18
|
+
export * from './database.js';
|
|
19
|
+
export * from './env.js';
|
|
27
20
|
export * from './genesis-provider.js';
|
|
21
|
+
export * from './logger.js';
|
|
22
|
+
export * from './offchain.js';
|
|
28
23
|
export * from './rpc/index.js';
|
|
24
|
+
export * from './schema/index.js';
|
|
25
|
+
export * from './setup.js';
|
|
26
|
+
export * from './utils/index.js';
|
|
27
|
+
export * from './wasm-executor/index.js';
|
|
28
|
+
export * from './xcm/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ResponseError, zHex } from '../shared.js';
|
|
3
2
|
import { defaultLogger } from '../../logger.js';
|
|
3
|
+
import { ResponseError, zHex } from '../shared.js';
|
|
4
4
|
const schema = z.object({
|
|
5
5
|
count: z.number().optional(),
|
|
6
6
|
to: z.number().optional(),
|
package/dist/esm/rpc/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import type { Handlers } from './shared.js';
|
|
|
3
3
|
import substrate from './substrate/index.js';
|
|
4
4
|
export declare const allHandlers: Handlers;
|
|
5
5
|
export { substrate, dev };
|
|
6
|
+
export type { Context, Handler, Handlers, SubscriptionManager } from './shared.js';
|
|
6
7
|
export { ResponseError } from './shared.js';
|
|
7
|
-
export type { Context, SubscriptionManager, Handler, Handlers } from './shared.js';
|
|
@@ -2,9 +2,9 @@ import type { StorageKey } from '@polkadot/types';
|
|
|
2
2
|
import type { HexString } from '@polkadot/util/types';
|
|
3
3
|
import type { Block } from '../blockchain/block.js';
|
|
4
4
|
import type { Blockchain } from '../blockchain/index.js';
|
|
5
|
+
export * from './decoder.js';
|
|
5
6
|
export * from './set-storage.js';
|
|
6
7
|
export * from './time-travel.js';
|
|
7
|
-
export * from './decoder.js';
|
|
8
8
|
export type GetKeys = (startKey?: string) => Promise<StorageKey<any>[]>;
|
|
9
9
|
export type ProcessKey = (key: StorageKey<any>) => any;
|
|
10
10
|
export declare function fetchKeys(getKeys: GetKeys, processKey: ProcessKey): Promise<void>;
|
|
@@ -22,7 +22,7 @@ export declare const CHILD_PREFIX_LENGTH: number;
|
|
|
22
22
|
export declare const PREFIX_LENGTH = 66;
|
|
23
23
|
export declare const prefixedChildKey: (prefix: HexString, key: HexString) => HexString;
|
|
24
24
|
export declare const isPrefixedChildKey: (key: HexString) => boolean;
|
|
25
|
-
export declare const splitChildKey: (key: HexString) => [`0x${string}`, `0x${string}`]
|
|
25
|
+
export declare const splitChildKey: (key: HexString) => never[] | [`0x${string}`, `0x${string}`];
|
|
26
26
|
export declare const stripChildPrefix: (key: HexString) => `0x${string}`;
|
|
27
27
|
export declare const getCurrentSlot: (head: Block) => Promise<number>;
|
|
28
28
|
export declare const getCurrentTimestamp: (head: Block) => Promise<bigint>;
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { compactStripLength, u8aToHex } from '@polkadot/util';
|
|
2
2
|
import { hexAddPrefix, hexStripPrefix } from '@polkadot/util/hex';
|
|
3
3
|
import { getAuraSlotDuration } from '../wasm-executor/index.js';
|
|
4
|
+
export * from './decoder.js';
|
|
4
5
|
export * from './set-storage.js';
|
|
5
6
|
export * from './time-travel.js';
|
|
6
|
-
export * from './decoder.js';
|
|
7
7
|
export async function fetchKeys(getKeys, processKey) {
|
|
8
8
|
const processKeys = async (keys)=>{
|
|
9
9
|
for (const key of keys){
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { JsCallback } from '@acala-network/chopsticks-executor';
|
|
1
2
|
import type { HexString } from '@polkadot/util/types';
|
|
2
3
|
import * as Comlink from 'comlink';
|
|
3
4
|
import _ from 'lodash';
|
|
4
5
|
import type { Block } from '../blockchain/block.js';
|
|
5
|
-
import type { JsCallback } from '@acala-network/chopsticks-executor';
|
|
6
6
|
export type { JsCallback };
|
|
7
7
|
export type RuntimeVersion = {
|
|
8
8
|
specName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { parentPort } from 'node:worker_threads';
|
|
1
2
|
import * as pkg from '@acala-network/chopsticks-executor';
|
|
2
3
|
import * as Comlink from 'comlink';
|
|
3
|
-
import { parentPort } from 'node:worker_threads';
|
|
4
4
|
import nodeEndpoint from 'comlink/dist/umd/node-adapter.js';
|
|
5
5
|
const getRuntimeVersion = async (code)=>{
|
|
6
6
|
return pkg.get_runtime_version(code);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=v22"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"depcheck": "npx depcheck"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@acala-network/chopsticks-executor": "1.
|
|
18
|
-
"@polkadot/rpc-provider": "^16.
|
|
19
|
-
"@polkadot/types": "^16.
|
|
20
|
-
"@polkadot/types-codec": "^16.
|
|
21
|
-
"@polkadot/types-known": "^16.
|
|
22
|
-
"@polkadot/util": "^13.5.
|
|
23
|
-
"@polkadot/util-crypto": "^13.5.
|
|
17
|
+
"@acala-network/chopsticks-executor": "1.2.0",
|
|
18
|
+
"@polkadot/rpc-provider": "^16.4.1",
|
|
19
|
+
"@polkadot/types": "^16.4.1",
|
|
20
|
+
"@polkadot/types-codec": "^16.4.1",
|
|
21
|
+
"@polkadot/types-known": "^16.4.1",
|
|
22
|
+
"@polkadot/util": "^13.5.3",
|
|
23
|
+
"@polkadot/util-crypto": "^13.5.3",
|
|
24
24
|
"comlink": "^4.4.2",
|
|
25
25
|
"eventemitter3": "^5.0.1",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"pino": "^9.7.0",
|
|
29
29
|
"pino-pretty": "^13.0.0",
|
|
30
30
|
"rxjs": "^7.8.2",
|
|
31
|
-
"zod": "^3.25.
|
|
31
|
+
"zod": "^3.25.76"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@swc/cli": "0.7.
|
|
35
|
-
"@swc/core": "^1.12.
|
|
36
|
-
"@types/lodash": "^4.17.
|
|
34
|
+
"@swc/cli": "0.7.8",
|
|
35
|
+
"@swc/core": "^1.12.11",
|
|
36
|
+
"@types/lodash": "^4.17.20",
|
|
37
37
|
"typescript": "^5.8.3",
|
|
38
|
-
"vitest": "^3.2.
|
|
38
|
+
"vitest": "^3.2.4"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"dist/esm/**",
|