@acala-network/chopsticks 0.9.7 → 0.9.8-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/plugins/dry-run/dry-run-preimage.js +17 -6
- package/dist/cjs/plugins/dry-run/rpc.d.ts +1 -1
- package/dist/cjs/rpc/index.js +1 -1
- package/dist/cjs/server.js +1 -1
- package/dist/cjs/utils/decoder.d.ts +1 -1
- package/dist/cjs/utils/decoder.js +1 -1
- package/dist/esm/plugins/dry-run/dry-run-preimage.js +18 -7
- package/dist/esm/plugins/dry-run/rpc.d.ts +1 -1
- package/dist/esm/rpc/index.js +1 -1
- package/dist/esm/server.js +1 -1
- package/dist/esm/utils/decoder.d.ts +1 -1
- package/dist/esm/utils/decoder.js +1 -1
- package/package.json +15 -15
|
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "dryRunPreimage", {
|
|
|
10
10
|
});
|
|
11
11
|
const _utilcrypto = require("@polkadot/util-crypto");
|
|
12
12
|
const _util = require("@polkadot/util");
|
|
13
|
+
const _chopstickscore = require("@acala-network/chopsticks-core");
|
|
13
14
|
const _logger = require("../../logger.js");
|
|
14
15
|
const _generatehtmldiff = require("../../utils/generate-html-diff.js");
|
|
15
|
-
const _chopstickscore = require("@acala-network/chopsticks-core");
|
|
16
16
|
const _openhtml = require("../../utils/open-html.js");
|
|
17
17
|
const _context = require("../../context.js");
|
|
18
18
|
const dryRunPreimage = async (argv)=>{
|
|
@@ -33,7 +33,7 @@ const dryRunPreimage = async (argv)=>{
|
|
|
33
33
|
data.byteLength
|
|
34
34
|
]
|
|
35
35
|
],
|
|
36
|
-
|
|
36
|
+
(0, _util.compactAddLength)(data)
|
|
37
37
|
]
|
|
38
38
|
],
|
|
39
39
|
StatusFor: [
|
|
@@ -88,6 +88,12 @@ const dryRunPreimage = async (argv)=>{
|
|
|
88
88
|
]
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
+
const newBlockHash = `0x${Math.round(Math.random() * 100000000).toString(16).padEnd(64, '0')}`;
|
|
92
|
+
const newBlock = new _chopstickscore.Block(block.chain, block.number + 1, newBlockHash, block, {
|
|
93
|
+
header,
|
|
94
|
+
extrinsics: [],
|
|
95
|
+
storage: block.storage
|
|
96
|
+
});
|
|
91
97
|
const calls = [
|
|
92
98
|
[
|
|
93
99
|
'Core_initialize_block',
|
|
@@ -96,12 +102,17 @@ const dryRunPreimage = async (argv)=>{
|
|
|
96
102
|
]
|
|
97
103
|
]
|
|
98
104
|
];
|
|
99
|
-
for (const
|
|
105
|
+
for (const inherentProvider of block.chain.getInherents()){
|
|
106
|
+
const extrinsics = await inherentProvider.createInherents(newBlock, {
|
|
107
|
+
transactions: [],
|
|
108
|
+
downwardMessages: [],
|
|
109
|
+
upwardMessages: [],
|
|
110
|
+
horizontalMessages: {}
|
|
111
|
+
});
|
|
112
|
+
if (extrinsics.length === 0) continue;
|
|
100
113
|
calls.push([
|
|
101
114
|
'BlockBuilder_apply_extrinsic',
|
|
102
|
-
|
|
103
|
-
inherent
|
|
104
|
-
]
|
|
115
|
+
extrinsics
|
|
105
116
|
]);
|
|
106
117
|
}
|
|
107
118
|
calls.push([
|
|
@@ -134,6 +134,6 @@ export interface DryRunParams {
|
|
|
134
134
|
export declare const rpc: (context: Context, [params]: [DryRunParams]) => Promise<string | [`0x${string}`, `0x${string}` | null][] | {
|
|
135
135
|
old: {};
|
|
136
136
|
new: {};
|
|
137
|
-
delta: import("jsondiffpatch").Delta
|
|
137
|
+
delta: import("jsondiffpatch").Delta;
|
|
138
138
|
}>;
|
|
139
139
|
export {};
|
package/dist/cjs/rpc/index.js
CHANGED
|
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "handler", {
|
|
|
11
11
|
const _chopstickscore = require("@acala-network/chopsticks-core");
|
|
12
12
|
const _index = require("../plugins/index.js");
|
|
13
13
|
const rpcLogger = _chopstickscore.defaultLogger.child({
|
|
14
|
-
|
|
14
|
+
name: 'rpc'
|
|
15
15
|
});
|
|
16
16
|
const allHandlers = {
|
|
17
17
|
..._chopstickscore.substrate,
|
package/dist/cjs/server.js
CHANGED
|
@@ -121,7 +121,7 @@ const createServer = async (handler, port)=>{
|
|
|
121
121
|
result: resp ?? null
|
|
122
122
|
};
|
|
123
123
|
} catch (e) {
|
|
124
|
-
logger.info('Error handling request: %
|
|
124
|
+
logger.info('Error handling request: %o', e.stack);
|
|
125
125
|
return {
|
|
126
126
|
id: req.id,
|
|
127
127
|
jsonrpc: '2.0',
|
|
@@ -3,5 +3,5 @@ import { HexString } from '@polkadot/util/types';
|
|
|
3
3
|
export declare const decodeStorageDiff: (block: Block, diff: [HexString, HexString | null][]) => Promise<{
|
|
4
4
|
oldState: {};
|
|
5
5
|
newState: {};
|
|
6
|
-
delta: import("jsondiffpatch").Delta
|
|
6
|
+
delta: import("jsondiffpatch").Delta;
|
|
7
7
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { blake2AsHex } from '@polkadot/util-crypto';
|
|
2
|
-
import { hexToU8a } from '@polkadot/util';
|
|
2
|
+
import { compactAddLength, hexToU8a } from '@polkadot/util';
|
|
3
|
+
import { Block, newHeader, runTask, setStorage, taskHandler } from '@acala-network/chopsticks-core';
|
|
3
4
|
import { defaultLogger } from '../../logger.js';
|
|
4
5
|
import { generateHtmlDiffPreviewFile } from '../../utils/generate-html-diff.js';
|
|
5
|
-
import { newHeader, runTask, setStorage, taskHandler } from '@acala-network/chopsticks-core';
|
|
6
6
|
import { openHtml } from '../../utils/open-html.js';
|
|
7
7
|
import { setupContext } from '../../context.js';
|
|
8
8
|
export const dryRunPreimage = async (argv)=>{
|
|
@@ -23,7 +23,7 @@ export const dryRunPreimage = async (argv)=>{
|
|
|
23
23
|
data.byteLength
|
|
24
24
|
]
|
|
25
25
|
],
|
|
26
|
-
|
|
26
|
+
compactAddLength(data)
|
|
27
27
|
]
|
|
28
28
|
],
|
|
29
29
|
StatusFor: [
|
|
@@ -78,6 +78,12 @@ export const dryRunPreimage = async (argv)=>{
|
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
+
const newBlockHash = `0x${Math.round(Math.random() * 100000000).toString(16).padEnd(64, '0')}`;
|
|
82
|
+
const newBlock = new Block(block.chain, block.number + 1, newBlockHash, block, {
|
|
83
|
+
header,
|
|
84
|
+
extrinsics: [],
|
|
85
|
+
storage: block.storage
|
|
86
|
+
});
|
|
81
87
|
const calls = [
|
|
82
88
|
[
|
|
83
89
|
'Core_initialize_block',
|
|
@@ -86,12 +92,17 @@ export const dryRunPreimage = async (argv)=>{
|
|
|
86
92
|
]
|
|
87
93
|
]
|
|
88
94
|
];
|
|
89
|
-
for (const
|
|
95
|
+
for (const inherentProvider of block.chain.getInherents()){
|
|
96
|
+
const extrinsics = await inherentProvider.createInherents(newBlock, {
|
|
97
|
+
transactions: [],
|
|
98
|
+
downwardMessages: [],
|
|
99
|
+
upwardMessages: [],
|
|
100
|
+
horizontalMessages: {}
|
|
101
|
+
});
|
|
102
|
+
if (extrinsics.length === 0) continue;
|
|
90
103
|
calls.push([
|
|
91
104
|
'BlockBuilder_apply_extrinsic',
|
|
92
|
-
|
|
93
|
-
inherent
|
|
94
|
-
]
|
|
105
|
+
extrinsics
|
|
95
106
|
]);
|
|
96
107
|
}
|
|
97
108
|
calls.push([
|
|
@@ -134,6 +134,6 @@ export interface DryRunParams {
|
|
|
134
134
|
export declare const rpc: (context: Context, [params]: [DryRunParams]) => Promise<string | [`0x${string}`, `0x${string}` | null][] | {
|
|
135
135
|
old: {};
|
|
136
136
|
new: {};
|
|
137
|
-
delta: import("jsondiffpatch").Delta
|
|
137
|
+
delta: import("jsondiffpatch").Delta;
|
|
138
138
|
}>;
|
|
139
139
|
export {};
|
package/dist/esm/rpc/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResponseError, defaultLogger, substrate } from '@acala-network/chopsticks-core';
|
|
2
2
|
import { loadRpcPlugin, rpcPluginMethods } from '../plugins/index.js';
|
|
3
3
|
const rpcLogger = defaultLogger.child({
|
|
4
|
-
|
|
4
|
+
name: 'rpc'
|
|
5
5
|
});
|
|
6
6
|
const allHandlers = {
|
|
7
7
|
...substrate,
|
package/dist/esm/server.js
CHANGED
|
@@ -111,7 +111,7 @@ export const createServer = async (handler, port)=>{
|
|
|
111
111
|
result: resp ?? null
|
|
112
112
|
};
|
|
113
113
|
} catch (e) {
|
|
114
|
-
logger.info('Error handling request: %
|
|
114
|
+
logger.info('Error handling request: %o', e.stack);
|
|
115
115
|
return {
|
|
116
116
|
id: req.id,
|
|
117
117
|
jsonrpc: '2.0',
|
|
@@ -3,5 +3,5 @@ import { HexString } from '@polkadot/util/types';
|
|
|
3
3
|
export declare const decodeStorageDiff: (block: Block, diff: [HexString, HexString | null][]) => Promise<{
|
|
4
4
|
oldState: {};
|
|
5
5
|
newState: {};
|
|
6
|
-
delta: import("jsondiffpatch").Delta
|
|
6
|
+
delta: import("jsondiffpatch").Delta;
|
|
7
7
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8-2",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": "./chopsticks.cjs",
|
|
@@ -13,34 +13,34 @@
|
|
|
13
13
|
"docs:prep": "typedoc"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@acala-network/chopsticks-core": "0.9.
|
|
17
|
-
"@acala-network/chopsticks-db": "0.9.
|
|
16
|
+
"@acala-network/chopsticks-core": "0.9.8-2",
|
|
17
|
+
"@acala-network/chopsticks-db": "0.9.8-2",
|
|
18
18
|
"@pnpm/npm-conf": "^2.2.2",
|
|
19
|
-
"@polkadot/api-augment": "^10.
|
|
20
|
-
"@polkadot/types": "^10.
|
|
21
|
-
"@polkadot/util": "^12.
|
|
22
|
-
"@polkadot/util-crypto": "^12.
|
|
23
|
-
"axios": "^1.6.
|
|
24
|
-
"dotenv": "^16.
|
|
19
|
+
"@polkadot/api-augment": "^10.11.2",
|
|
20
|
+
"@polkadot/types": "^10.11.2",
|
|
21
|
+
"@polkadot/util": "^12.6.2",
|
|
22
|
+
"@polkadot/util-crypto": "^12.6.2",
|
|
23
|
+
"axios": "^1.6.5",
|
|
24
|
+
"dotenv": "^16.4.0",
|
|
25
25
|
"global-agent": "^3.0.0",
|
|
26
26
|
"js-yaml": "^4.1.0",
|
|
27
|
-
"jsondiffpatch": "^0.
|
|
27
|
+
"jsondiffpatch": "^0.6.0",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
|
-
"ws": "^8.
|
|
29
|
+
"ws": "^8.16.0",
|
|
30
30
|
"yargs": "^17.7.2",
|
|
31
31
|
"zod": "^3.22.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@swc/cli": "0.1.
|
|
35
|
-
"@swc/core": "^1.3.
|
|
34
|
+
"@swc/cli": "0.1.65",
|
|
35
|
+
"@swc/core": "^1.3.105",
|
|
36
36
|
"@types/global-agent": "^2.1.3",
|
|
37
37
|
"@types/js-yaml": "^4.0.9",
|
|
38
38
|
"@types/lodash": "^4.14.202",
|
|
39
|
-
"@types/node": "^20.
|
|
39
|
+
"@types/node": "^20.11.5",
|
|
40
40
|
"@types/ws": "^8.5.10",
|
|
41
41
|
"@types/yargs": "^17.0.32",
|
|
42
42
|
"typescript": "^5.3.3",
|
|
43
|
-
"vitest": "^1.
|
|
43
|
+
"vitest": "^1.2.1"
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"dist/esm/**",
|