@acala-network/chopsticks 1.2.4 → 1.2.7
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/rpc.d.ts +1 -1
- package/dist/cjs/server.js +6 -2
- package/dist/cjs/utils/decoder.d.ts +1 -1
- package/dist/cjs/utils/decoder.js +2 -0
- package/dist/cjs/utils/fetch-storages.d.ts +1 -1
- package/dist/esm/plugins/dry-run/rpc.d.ts +1 -1
- package/dist/esm/server.js +6 -2
- package/dist/esm/utils/decoder.d.ts +1 -1
- package/dist/esm/utils/decoder.js +2 -0
- package/dist/esm/utils/fetch-storages.d.ts +1 -1
- package/package.json +9 -8
|
@@ -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/server.js
CHANGED
|
@@ -158,7 +158,9 @@ const createServer = async (handler, port, host)=>{
|
|
|
158
158
|
continue;
|
|
159
159
|
}
|
|
160
160
|
const preferPort = port ? port + i : undefined;
|
|
161
|
-
wsLogger.debug(
|
|
161
|
+
wsLogger.debug({
|
|
162
|
+
port: preferPort
|
|
163
|
+
}, 'Try starting on port');
|
|
162
164
|
await new Promise((resolve, reject)=>{
|
|
163
165
|
const onError = (e)=>{
|
|
164
166
|
server.close();
|
|
@@ -234,7 +236,9 @@ const createServer = async (handler, port, host)=>{
|
|
|
234
236
|
result: resp ?? null
|
|
235
237
|
};
|
|
236
238
|
} catch (e) {
|
|
237
|
-
wsLogger.error(
|
|
239
|
+
wsLogger.error({
|
|
240
|
+
err: e
|
|
241
|
+
}, 'Error handling request');
|
|
238
242
|
return {
|
|
239
243
|
id: req.id,
|
|
240
244
|
jsonrpc: '2.0',
|
|
@@ -3,5 +3,5 @@ import type { 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
|
}>;
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "decodeStorageDiff", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _chopstickscore = require("@acala-network/chopsticks-core");
|
|
12
|
+
const _diffmatchpatch = require("@dmsnell/diff-match-patch");
|
|
12
13
|
const _jsondiffpatch = require("jsondiffpatch");
|
|
13
14
|
const _lodash = /*#__PURE__*/ _interop_require_default(require("lodash"));
|
|
14
15
|
function _interop_require_default(obj) {
|
|
@@ -21,6 +22,7 @@ const diffPatcher = (0, _jsondiffpatch.create)({
|
|
|
21
22
|
detectMove: false
|
|
22
23
|
},
|
|
23
24
|
textDiff: {
|
|
25
|
+
diffMatchPatch: _diffmatchpatch.diff_match_patch,
|
|
24
26
|
minLength: Number.MAX_VALUE
|
|
25
27
|
}
|
|
26
28
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiPromise } from '@polkadot/api';
|
|
2
2
|
import type { HexString } from '@polkadot/util/types';
|
|
3
|
-
export declare const logger: import("pino").
|
|
3
|
+
export declare const logger: import("pino").Logger<never, boolean>;
|
|
4
4
|
type FetchStorageConfigItem = HexString | string | Record<string, string | Record<string, any[]> | Record<string, any>[] | (string | any)[]>;
|
|
5
5
|
export type FetchStorageConfig = FetchStorageConfigItem[];
|
|
6
6
|
/**
|
|
@@ -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/server.js
CHANGED
|
@@ -143,7 +143,9 @@ export const createServer = async (handler, port, host)=>{
|
|
|
143
143
|
continue;
|
|
144
144
|
}
|
|
145
145
|
const preferPort = port ? port + i : undefined;
|
|
146
|
-
wsLogger.debug(
|
|
146
|
+
wsLogger.debug({
|
|
147
|
+
port: preferPort
|
|
148
|
+
}, 'Try starting on port');
|
|
147
149
|
await new Promise((resolve, reject)=>{
|
|
148
150
|
const onError = (e)=>{
|
|
149
151
|
server.close();
|
|
@@ -219,7 +221,9 @@ export const createServer = async (handler, port, host)=>{
|
|
|
219
221
|
result: resp ?? null
|
|
220
222
|
};
|
|
221
223
|
} catch (e) {
|
|
222
|
-
wsLogger.error(
|
|
224
|
+
wsLogger.error({
|
|
225
|
+
err: e
|
|
226
|
+
}, 'Error handling request');
|
|
223
227
|
return {
|
|
224
228
|
id: req.id,
|
|
225
229
|
jsonrpc: '2.0',
|
|
@@ -3,5 +3,5 @@ import type { 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,4 +1,5 @@
|
|
|
1
1
|
import { decodeBlockStorageDiff } from '@acala-network/chopsticks-core';
|
|
2
|
+
import { diff_match_patch } from '@dmsnell/diff-match-patch';
|
|
2
3
|
import { create } from 'jsondiffpatch';
|
|
3
4
|
import _ from 'lodash';
|
|
4
5
|
const diffPatcher = create({
|
|
@@ -6,6 +7,7 @@ const diffPatcher = create({
|
|
|
6
7
|
detectMove: false
|
|
7
8
|
},
|
|
8
9
|
textDiff: {
|
|
10
|
+
diffMatchPatch: diff_match_patch,
|
|
9
11
|
minLength: Number.MAX_VALUE
|
|
10
12
|
}
|
|
11
13
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiPromise } from '@polkadot/api';
|
|
2
2
|
import type { HexString } from '@polkadot/util/types';
|
|
3
|
-
export declare const logger: import("pino").
|
|
3
|
+
export declare const logger: import("pino").Logger<never, boolean>;
|
|
4
4
|
type FetchStorageConfigItem = HexString | string | Record<string, string | Record<string, any[]> | Record<string, any>[] | (string | any)[]>;
|
|
5
5
|
export type FetchStorageConfig = FetchStorageConfigItem[];
|
|
6
6
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": "./chopsticks.cjs",
|
|
@@ -15,28 +15,29 @@
|
|
|
15
15
|
"depcheck": "npx depcheck --ignore-patterns='*.test.ts'"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@acala-network/chopsticks-core": "1.2.
|
|
19
|
-
"@acala-network/chopsticks-db": "1.2.
|
|
18
|
+
"@acala-network/chopsticks-core": "1.2.7",
|
|
19
|
+
"@acala-network/chopsticks-db": "1.2.7",
|
|
20
|
+
"@dmsnell/diff-match-patch": "^1.1.0",
|
|
20
21
|
"@pnpm/npm-conf": "^3.0.0",
|
|
21
22
|
"@polkadot/api": "^16.4.1",
|
|
22
23
|
"@polkadot/api-augment": "^16.4.1",
|
|
23
24
|
"@polkadot/rpc-provider": "^16.4.1",
|
|
24
25
|
"@polkadot/types": "^16.4.1",
|
|
25
|
-
"@polkadot/util": "^
|
|
26
|
-
"@polkadot/util-crypto": "^
|
|
26
|
+
"@polkadot/util": "^14.0.1",
|
|
27
|
+
"@polkadot/util-crypto": "^14.0.1",
|
|
27
28
|
"axios": "^1.12.0",
|
|
28
29
|
"comlink": "^4.4.2",
|
|
29
30
|
"dotenv": "^16.6.1",
|
|
30
31
|
"global-agent": "^3.0.0",
|
|
31
|
-
"js-yaml": "^4.1.
|
|
32
|
-
"jsondiffpatch": "^0.
|
|
32
|
+
"js-yaml": "^4.1.1",
|
|
33
|
+
"jsondiffpatch": "^0.7.3",
|
|
33
34
|
"lodash": "^4.17.21",
|
|
34
35
|
"ws": "^8.18.3",
|
|
35
36
|
"yargs": "^18.0.0",
|
|
36
37
|
"zod": "^3.25.76"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@swc/cli": "0.7.
|
|
40
|
+
"@swc/cli": "0.7.10",
|
|
40
41
|
"@swc/core": "^1.12.14",
|
|
41
42
|
"@types/global-agent": "^3.0.0",
|
|
42
43
|
"@types/js-yaml": "^4.0.9",
|