@acala-network/chopsticks 1.5.2 → 1.6.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/bridge.js +1 -0
- package/dist/cjs/context.js +8 -19
- package/dist/cjs/plugins/dry-run/cli.js +7 -21
- package/dist/cjs/plugins/dry-run/index.d.ts +21 -227
- package/dist/cjs/plugins/dry-run/index.js +7 -21
- package/dist/cjs/plugins/dry-run/rpc.d.ts +12 -64
- package/dist/cjs/plugins/index.js +8 -19
- package/dist/cjs/plugins/run-block/cli.js +3 -9
- package/dist/cjs/plugins/run-block/rpc.d.ts +4 -28
- package/dist/cjs/plugins/trace-transaction/index.js +5 -15
- package/dist/cjs/plugins/try-runtime/index.js +3 -9
- package/dist/cjs/schema/index.d.ts +25 -217
- package/dist/cjs/schema/index.js +80 -72
- package/dist/cjs/types.js +8 -19
- package/dist/cjs/utils/fetch-storages-worker.js +8 -19
- package/dist/cjs/utils/override.js +32 -2
- package/dist/esm/bridge.js +1 -0
- package/dist/esm/plugins/dry-run/cli.js +7 -21
- package/dist/esm/plugins/dry-run/index.d.ts +21 -227
- package/dist/esm/plugins/dry-run/index.js +7 -21
- package/dist/esm/plugins/dry-run/rpc.d.ts +12 -64
- package/dist/esm/plugins/run-block/cli.js +3 -9
- package/dist/esm/plugins/run-block/rpc.d.ts +4 -28
- package/dist/esm/plugins/trace-transaction/index.js +5 -15
- package/dist/esm/plugins/try-runtime/index.js +3 -9
- package/dist/esm/schema/index.d.ts +25 -217
- package/dist/esm/schema/index.js +50 -72
- package/dist/esm/utils/override.js +1 -1
- package/package.json +82 -78
|
@@ -4,27 +4,13 @@ import { dryRunExtrinsic } from './dry-run-extrinsic.js';
|
|
|
4
4
|
import { dryRunPreimage } from './dry-run-preimage.js';
|
|
5
5
|
const schema = z.object({
|
|
6
6
|
...configSchema.shape,
|
|
7
|
-
extrinsic: z.string(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
description: 'Preimage to dry run'
|
|
15
|
-
}).optional(),
|
|
16
|
-
at: z.string({
|
|
17
|
-
description: 'Block hash to dry run'
|
|
18
|
-
}).optional(),
|
|
19
|
-
'output-path': z.string({
|
|
20
|
-
description: 'File path to print output'
|
|
21
|
-
}).optional(),
|
|
22
|
-
html: z.boolean({
|
|
23
|
-
description: 'Generate html with storage diff'
|
|
24
|
-
}).optional(),
|
|
25
|
-
open: z.boolean({
|
|
26
|
-
description: 'Open generated html'
|
|
27
|
-
}).optional()
|
|
7
|
+
extrinsic: z.string().describe('Extrinsic or call to dry run. If you pass call here then address is required to fake signature').optional(),
|
|
8
|
+
address: z.string().describe('Address to fake sign extrinsic').optional(),
|
|
9
|
+
preimage: z.string().describe('Preimage to dry run').optional(),
|
|
10
|
+
at: z.string().describe('Block hash to dry run').optional(),
|
|
11
|
+
'output-path': z.string().describe('File path to print output').optional(),
|
|
12
|
+
html: z.boolean().describe('Generate html with storage diff').optional(),
|
|
13
|
+
open: z.boolean().describe('Open generated html').optional()
|
|
28
14
|
});
|
|
29
15
|
export const cli = (y)=>{
|
|
30
16
|
y.command('dry-run', 'Dry run an extrinsic', (yargs)=>yargs.options(getYargsOptions(schema.shape)), async (argv)=>{
|
|
@@ -7,12 +7,12 @@ export declare const dryRunSchema: z.ZodObject<{
|
|
|
7
7
|
'output-path': z.ZodOptional<z.ZodString>;
|
|
8
8
|
html: z.ZodOptional<z.ZodBoolean>;
|
|
9
9
|
open: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
-
addr: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"localhost">, z.
|
|
11
|
-
host: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"localhost">, z.
|
|
10
|
+
addr: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"localhost">, z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6]>]>>;
|
|
11
|
+
host: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"localhost">, z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6]>]>>;
|
|
12
12
|
port: z.ZodDefault<z.ZodNumber>;
|
|
13
|
-
endpoint: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString
|
|
14
|
-
block: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNull]>>;
|
|
15
|
-
'build-block-mode': z.ZodDefault<z.
|
|
13
|
+
endpoint: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
14
|
+
block: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>;
|
|
15
|
+
'build-block-mode': z.ZodDefault<z.ZodEnum<typeof import("@acala-network/chopsticks-core").BuildBlockMode>>;
|
|
16
16
|
'import-storage': z.ZodOptional<z.ZodAny>;
|
|
17
17
|
'allow-unresolved-imports': z.ZodOptional<z.ZodBoolean>;
|
|
18
18
|
'mock-signature-host': z.ZodOptional<z.ZodBoolean>;
|
|
@@ -20,249 +20,43 @@ export declare const dryRunSchema: z.ZodObject<{
|
|
|
20
20
|
db: z.ZodOptional<z.ZodString>;
|
|
21
21
|
'save-blocks': z.ZodOptional<z.ZodBoolean>;
|
|
22
22
|
'wasm-override': z.ZodOptional<z.ZodString>;
|
|
23
|
-
genesis: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
23
|
+
genesis: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
24
24
|
id: z.ZodString;
|
|
25
25
|
name: z.ZodString;
|
|
26
26
|
properties: z.ZodObject<{
|
|
27
27
|
ss58Format: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
tokenDecimals: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodNumber
|
|
29
|
-
tokenSymbol: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString
|
|
30
|
-
},
|
|
31
|
-
ss58Format?: number | undefined;
|
|
32
|
-
tokenDecimals?: number | number[] | undefined;
|
|
33
|
-
tokenSymbol?: string | string[] | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
ss58Format?: number | undefined;
|
|
36
|
-
tokenDecimals?: number | number[] | undefined;
|
|
37
|
-
tokenSymbol?: string | string[] | undefined;
|
|
38
|
-
}>;
|
|
28
|
+
tokenDecimals: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
|
|
29
|
+
tokenSymbol: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
39
31
|
genesis: z.ZodObject<{
|
|
40
32
|
raw: z.ZodObject<{
|
|
41
33
|
top: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}>;
|
|
47
|
-
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
raw: {
|
|
49
|
-
top: Record<string, string>;
|
|
50
|
-
};
|
|
51
|
-
}, {
|
|
52
|
-
raw: {
|
|
53
|
-
top: Record<string, string>;
|
|
54
|
-
};
|
|
55
|
-
}>;
|
|
56
|
-
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
name: string;
|
|
58
|
-
id: string;
|
|
59
|
-
properties: {
|
|
60
|
-
ss58Format?: number | undefined;
|
|
61
|
-
tokenDecimals?: number | number[] | undefined;
|
|
62
|
-
tokenSymbol?: string | string[] | undefined;
|
|
63
|
-
};
|
|
64
|
-
genesis: {
|
|
65
|
-
raw: {
|
|
66
|
-
top: Record<string, string>;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
}, {
|
|
70
|
-
name: string;
|
|
71
|
-
id: string;
|
|
72
|
-
properties: {
|
|
73
|
-
ss58Format?: number | undefined;
|
|
74
|
-
tokenDecimals?: number | number[] | undefined;
|
|
75
|
-
tokenSymbol?: string | string[] | undefined;
|
|
76
|
-
};
|
|
77
|
-
genesis: {
|
|
78
|
-
raw: {
|
|
79
|
-
top: Record<string, string>;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
}>]>>;
|
|
83
|
-
'chain-spec': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
}, z.core.$strip>]>>;
|
|
37
|
+
'chain-spec': z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
84
38
|
id: z.ZodString;
|
|
85
39
|
name: z.ZodString;
|
|
86
40
|
properties: z.ZodObject<{
|
|
87
41
|
ss58Format: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
tokenDecimals: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodNumber
|
|
89
|
-
tokenSymbol: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString
|
|
90
|
-
},
|
|
91
|
-
ss58Format?: number | undefined;
|
|
92
|
-
tokenDecimals?: number | number[] | undefined;
|
|
93
|
-
tokenSymbol?: string | string[] | undefined;
|
|
94
|
-
}, {
|
|
95
|
-
ss58Format?: number | undefined;
|
|
96
|
-
tokenDecimals?: number | number[] | undefined;
|
|
97
|
-
tokenSymbol?: string | string[] | undefined;
|
|
98
|
-
}>;
|
|
42
|
+
tokenDecimals: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
|
|
43
|
+
tokenSymbol: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
99
45
|
genesis: z.ZodObject<{
|
|
100
46
|
raw: z.ZodObject<{
|
|
101
47
|
top: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
top: Record<string, string>;
|
|
106
|
-
}>;
|
|
107
|
-
}, "strip", z.ZodTypeAny, {
|
|
108
|
-
raw: {
|
|
109
|
-
top: Record<string, string>;
|
|
110
|
-
};
|
|
111
|
-
}, {
|
|
112
|
-
raw: {
|
|
113
|
-
top: Record<string, string>;
|
|
114
|
-
};
|
|
115
|
-
}>;
|
|
116
|
-
}, "strip", z.ZodTypeAny, {
|
|
117
|
-
name: string;
|
|
118
|
-
id: string;
|
|
119
|
-
properties: {
|
|
120
|
-
ss58Format?: number | undefined;
|
|
121
|
-
tokenDecimals?: number | number[] | undefined;
|
|
122
|
-
tokenSymbol?: string | string[] | undefined;
|
|
123
|
-
};
|
|
124
|
-
genesis: {
|
|
125
|
-
raw: {
|
|
126
|
-
top: Record<string, string>;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
}, {
|
|
130
|
-
name: string;
|
|
131
|
-
id: string;
|
|
132
|
-
properties: {
|
|
133
|
-
ss58Format?: number | undefined;
|
|
134
|
-
tokenDecimals?: number | number[] | undefined;
|
|
135
|
-
tokenSymbol?: string | string[] | undefined;
|
|
136
|
-
};
|
|
137
|
-
genesis: {
|
|
138
|
-
raw: {
|
|
139
|
-
top: Record<string, string>;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
}>]>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
}, z.core.$strip>]>>;
|
|
143
51
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
144
52
|
'registered-types': z.ZodOptional<z.ZodAny>;
|
|
145
53
|
'runtime-log-level': z.ZodOptional<z.ZodNumber>;
|
|
146
54
|
'offchain-worker': z.ZodOptional<z.ZodBoolean>;
|
|
147
|
-
resume: z.ZodOptional<z.ZodUnion<[z.ZodIntersection<z.ZodString, z.
|
|
55
|
+
resume: z.ZodOptional<z.ZodUnion<readonly [z.ZodIntersection<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>, z.ZodNumber, z.ZodBoolean]>>;
|
|
148
56
|
'process-queued-messages': z.ZodOptional<z.ZodBoolean>;
|
|
149
57
|
'prefetch-storages': z.ZodOptional<z.ZodAny>;
|
|
150
58
|
'rpc-timeout': z.ZodOptional<z.ZodNumber>;
|
|
151
|
-
},
|
|
152
|
-
port: number;
|
|
153
|
-
'build-block-mode': import("@acala-network/chopsticks-core").BuildBlockMode;
|
|
154
|
-
at?: string | undefined;
|
|
155
|
-
addr?: string | undefined;
|
|
156
|
-
host?: string | undefined;
|
|
157
|
-
endpoint?: string | string[] | undefined;
|
|
158
|
-
block?: string | number | null | undefined;
|
|
159
|
-
'import-storage'?: any;
|
|
160
|
-
'allow-unresolved-imports'?: boolean | undefined;
|
|
161
|
-
'mock-signature-host'?: boolean | undefined;
|
|
162
|
-
'max-memory-block-count'?: number | undefined;
|
|
163
|
-
db?: string | undefined;
|
|
164
|
-
'save-blocks'?: boolean | undefined;
|
|
165
|
-
'wasm-override'?: string | undefined;
|
|
166
|
-
genesis?: string | {
|
|
167
|
-
name: string;
|
|
168
|
-
id: string;
|
|
169
|
-
properties: {
|
|
170
|
-
ss58Format?: number | undefined;
|
|
171
|
-
tokenDecimals?: number | number[] | undefined;
|
|
172
|
-
tokenSymbol?: string | string[] | undefined;
|
|
173
|
-
};
|
|
174
|
-
genesis: {
|
|
175
|
-
raw: {
|
|
176
|
-
top: Record<string, string>;
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
} | undefined;
|
|
180
|
-
'chain-spec'?: string | {
|
|
181
|
-
name: string;
|
|
182
|
-
id: string;
|
|
183
|
-
properties: {
|
|
184
|
-
ss58Format?: number | undefined;
|
|
185
|
-
tokenDecimals?: number | number[] | undefined;
|
|
186
|
-
tokenSymbol?: string | string[] | undefined;
|
|
187
|
-
};
|
|
188
|
-
genesis: {
|
|
189
|
-
raw: {
|
|
190
|
-
top: Record<string, string>;
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
} | undefined;
|
|
194
|
-
timestamp?: number | undefined;
|
|
195
|
-
'registered-types'?: any;
|
|
196
|
-
'runtime-log-level'?: number | undefined;
|
|
197
|
-
'offchain-worker'?: boolean | undefined;
|
|
198
|
-
resume?: number | boolean | `0x${string}` | undefined;
|
|
199
|
-
'process-queued-messages'?: boolean | undefined;
|
|
200
|
-
'prefetch-storages'?: any;
|
|
201
|
-
'rpc-timeout'?: number | undefined;
|
|
202
|
-
open?: boolean | undefined;
|
|
203
|
-
extrinsic?: string | undefined;
|
|
204
|
-
address?: string | undefined;
|
|
205
|
-
preimage?: string | undefined;
|
|
206
|
-
'output-path'?: string | undefined;
|
|
207
|
-
html?: boolean | undefined;
|
|
208
|
-
}, {
|
|
209
|
-
at?: string | undefined;
|
|
210
|
-
addr?: string | undefined;
|
|
211
|
-
host?: string | undefined;
|
|
212
|
-
port?: number | undefined;
|
|
213
|
-
endpoint?: string | string[] | undefined;
|
|
214
|
-
block?: string | number | null | undefined;
|
|
215
|
-
'build-block-mode'?: import("@acala-network/chopsticks-core").BuildBlockMode | undefined;
|
|
216
|
-
'import-storage'?: any;
|
|
217
|
-
'allow-unresolved-imports'?: boolean | undefined;
|
|
218
|
-
'mock-signature-host'?: boolean | undefined;
|
|
219
|
-
'max-memory-block-count'?: number | undefined;
|
|
220
|
-
db?: string | undefined;
|
|
221
|
-
'save-blocks'?: boolean | undefined;
|
|
222
|
-
'wasm-override'?: string | undefined;
|
|
223
|
-
genesis?: string | {
|
|
224
|
-
name: string;
|
|
225
|
-
id: string;
|
|
226
|
-
properties: {
|
|
227
|
-
ss58Format?: number | undefined;
|
|
228
|
-
tokenDecimals?: number | number[] | undefined;
|
|
229
|
-
tokenSymbol?: string | string[] | undefined;
|
|
230
|
-
};
|
|
231
|
-
genesis: {
|
|
232
|
-
raw: {
|
|
233
|
-
top: Record<string, string>;
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
} | undefined;
|
|
237
|
-
'chain-spec'?: string | {
|
|
238
|
-
name: string;
|
|
239
|
-
id: string;
|
|
240
|
-
properties: {
|
|
241
|
-
ss58Format?: number | undefined;
|
|
242
|
-
tokenDecimals?: number | number[] | undefined;
|
|
243
|
-
tokenSymbol?: string | string[] | undefined;
|
|
244
|
-
};
|
|
245
|
-
genesis: {
|
|
246
|
-
raw: {
|
|
247
|
-
top: Record<string, string>;
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
} | undefined;
|
|
251
|
-
timestamp?: number | undefined;
|
|
252
|
-
'registered-types'?: any;
|
|
253
|
-
'runtime-log-level'?: number | undefined;
|
|
254
|
-
'offchain-worker'?: boolean | undefined;
|
|
255
|
-
resume?: number | boolean | `0x${string}` | undefined;
|
|
256
|
-
'process-queued-messages'?: boolean | undefined;
|
|
257
|
-
'prefetch-storages'?: any;
|
|
258
|
-
'rpc-timeout'?: number | undefined;
|
|
259
|
-
open?: boolean | undefined;
|
|
260
|
-
extrinsic?: string | undefined;
|
|
261
|
-
address?: string | undefined;
|
|
262
|
-
preimage?: string | undefined;
|
|
263
|
-
'output-path'?: string | undefined;
|
|
264
|
-
html?: boolean | undefined;
|
|
265
|
-
}>;
|
|
59
|
+
}, z.core.$strip>;
|
|
266
60
|
export type DryRunSchemaType = z.infer<typeof dryRunSchema>;
|
|
267
61
|
export * from './cli.js';
|
|
268
62
|
export * from './rpc.js';
|
|
@@ -2,27 +2,13 @@ import { z } from 'zod';
|
|
|
2
2
|
import { configSchema } from '../../schema/index.js';
|
|
3
3
|
export const dryRunSchema = z.object({
|
|
4
4
|
...configSchema.shape,
|
|
5
|
-
extrinsic: z.string(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
description: 'Preimage to dry run'
|
|
13
|
-
}).optional(),
|
|
14
|
-
at: z.string({
|
|
15
|
-
description: 'Block hash to dry run'
|
|
16
|
-
}).optional(),
|
|
17
|
-
'output-path': z.string({
|
|
18
|
-
description: 'File path to print output'
|
|
19
|
-
}).optional(),
|
|
20
|
-
html: z.boolean({
|
|
21
|
-
description: 'Generate html with storage diff'
|
|
22
|
-
}).optional(),
|
|
23
|
-
open: z.boolean({
|
|
24
|
-
description: 'Open generated html'
|
|
25
|
-
}).optional()
|
|
5
|
+
extrinsic: z.string().describe('Extrinsic or call to dry run. If you pass call here then address is required to fake signature').optional(),
|
|
6
|
+
address: z.string().describe('Address to fake sign extrinsic').optional(),
|
|
7
|
+
preimage: z.string().describe('Preimage to dry run').optional(),
|
|
8
|
+
at: z.string().describe('Block hash to dry run').optional(),
|
|
9
|
+
'output-path': z.string().describe('File path to print output').optional(),
|
|
10
|
+
html: z.boolean().describe('Generate html with storage diff').optional(),
|
|
11
|
+
open: z.boolean().describe('Open generated html').optional()
|
|
26
12
|
});
|
|
27
13
|
export * from './cli.js';
|
|
28
14
|
export * from './rpc.js';
|
|
@@ -3,73 +3,21 @@ import { z } from 'zod';
|
|
|
3
3
|
declare const schema: z.ZodObject<{
|
|
4
4
|
raw: z.ZodOptional<z.ZodBoolean>;
|
|
5
5
|
html: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
-
extrinsic: z.ZodOptional<z.ZodUnion<[z.
|
|
7
|
-
call: z.
|
|
8
|
-
address: z.
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
address: `0x${string}`;
|
|
12
|
-
}, {
|
|
13
|
-
call: `0x${string}`;
|
|
14
|
-
address: `0x${string}`;
|
|
15
|
-
}>]>>;
|
|
16
|
-
hrmp: z.ZodOptional<z.ZodRecord<z.ZodEffects<z.ZodString, number, string>, z.ZodArray<z.ZodObject<{
|
|
6
|
+
extrinsic: z.ZodOptional<z.ZodUnion<[z.ZodCustom<`0x${string}`, `0x${string}`>, z.ZodObject<{
|
|
7
|
+
call: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
8
|
+
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
9
|
+
}, z.core.$strip>]>>;
|
|
10
|
+
hrmp: z.ZodOptional<z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>, z.ZodArray<z.ZodObject<{
|
|
17
11
|
sentAt: z.ZodNumber;
|
|
18
|
-
data: z.
|
|
19
|
-
},
|
|
20
|
-
data: `0x${string}`;
|
|
21
|
-
sentAt: number;
|
|
22
|
-
}, {
|
|
23
|
-
data: `0x${string}`;
|
|
24
|
-
sentAt: number;
|
|
25
|
-
}>, "many">>>;
|
|
12
|
+
data: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
13
|
+
}, z.core.$strip>>>>;
|
|
26
14
|
dmp: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
27
15
|
sentAt: z.ZodNumber;
|
|
28
|
-
msg: z.
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
sentAt: number;
|
|
34
|
-
msg: `0x${string}`;
|
|
35
|
-
}>, "many">>;
|
|
36
|
-
ump: z.ZodOptional<z.ZodRecord<z.ZodEffects<z.ZodString, number, string>, z.ZodArray<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, "many">>>;
|
|
37
|
-
at: z.ZodOptional<z.ZodIntersection<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>>;
|
|
38
|
-
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
at?: `0x${string}` | undefined;
|
|
40
|
-
extrinsic?: `0x${string}` | {
|
|
41
|
-
call: `0x${string}`;
|
|
42
|
-
address: `0x${string}`;
|
|
43
|
-
} | undefined;
|
|
44
|
-
html?: boolean | undefined;
|
|
45
|
-
raw?: boolean | undefined;
|
|
46
|
-
hrmp?: Record<number, {
|
|
47
|
-
data: `0x${string}`;
|
|
48
|
-
sentAt: number;
|
|
49
|
-
}[]> | undefined;
|
|
50
|
-
dmp?: {
|
|
51
|
-
sentAt: number;
|
|
52
|
-
msg: `0x${string}`;
|
|
53
|
-
}[] | undefined;
|
|
54
|
-
ump?: Record<number, `0x${string}`[]> | undefined;
|
|
55
|
-
}, {
|
|
56
|
-
at?: `0x${string}` | undefined;
|
|
57
|
-
extrinsic?: `0x${string}` | {
|
|
58
|
-
call: `0x${string}`;
|
|
59
|
-
address: `0x${string}`;
|
|
60
|
-
} | undefined;
|
|
61
|
-
html?: boolean | undefined;
|
|
62
|
-
raw?: boolean | undefined;
|
|
63
|
-
hrmp?: Record<string, {
|
|
64
|
-
data: `0x${string}`;
|
|
65
|
-
sentAt: number;
|
|
66
|
-
}[]> | undefined;
|
|
67
|
-
dmp?: {
|
|
68
|
-
sentAt: number;
|
|
69
|
-
msg: `0x${string}`;
|
|
70
|
-
}[] | undefined;
|
|
71
|
-
ump?: Record<string, `0x${string}`[]> | undefined;
|
|
72
|
-
}>;
|
|
16
|
+
msg: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
17
|
+
}, z.core.$strip>>>;
|
|
18
|
+
ump: z.ZodOptional<z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>, z.ZodArray<z.ZodCustom<`0x${string}`, `0x${string}`>>>>;
|
|
19
|
+
at: z.ZodOptional<z.ZodIntersection<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
73
21
|
type Params = z.infer<typeof schema>;
|
|
74
22
|
export interface DryRunParams {
|
|
75
23
|
/**
|
|
@@ -7,15 +7,9 @@ import { generateHtmlDiffPreviewFile } from '../../utils/generate-html-diff.js';
|
|
|
7
7
|
import { openHtml } from '../../utils/open-html.js';
|
|
8
8
|
const schema = z.object({
|
|
9
9
|
...configSchema.shape,
|
|
10
|
-
'output-path': z.string(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
html: z.boolean({
|
|
14
|
-
description: 'Generate html with storage diff'
|
|
15
|
-
}).optional(),
|
|
16
|
-
open: z.boolean({
|
|
17
|
-
description: 'Open generated html'
|
|
18
|
-
}).optional()
|
|
10
|
+
'output-path': z.string().describe('File path to print output').optional(),
|
|
11
|
+
html: z.boolean().describe('Generate html with storage diff').optional(),
|
|
12
|
+
open: z.boolean().describe('Open generated html').optional()
|
|
19
13
|
});
|
|
20
14
|
export const cli = (y)=>{
|
|
21
15
|
y.command('run-block', 'Replay a block', (yargs)=>yargs.options(getYargsOptions(schema.shape)), async (argv)=>{
|
|
@@ -5,36 +5,12 @@ declare const schema: z.ZodObject<{
|
|
|
5
5
|
includeRaw: z.ZodOptional<z.ZodBoolean>;
|
|
6
6
|
includeParsed: z.ZodOptional<z.ZodBoolean>;
|
|
7
7
|
includeBlockDetails: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
-
parent: z.ZodOptional<z.ZodIntersection<z.ZodString, z.
|
|
8
|
+
parent: z.ZodOptional<z.ZodIntersection<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>>;
|
|
9
9
|
block: z.ZodObject<{
|
|
10
10
|
header: z.ZodAny;
|
|
11
|
-
extrinsics: z.ZodArray<z.
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
header?: any;
|
|
15
|
-
}, {
|
|
16
|
-
extrinsics: `0x${string}`[];
|
|
17
|
-
header?: any;
|
|
18
|
-
}>;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
block: {
|
|
21
|
-
extrinsics: `0x${string}`[];
|
|
22
|
-
header?: any;
|
|
23
|
-
};
|
|
24
|
-
includeRaw?: boolean | undefined;
|
|
25
|
-
includeParsed?: boolean | undefined;
|
|
26
|
-
includeBlockDetails?: boolean | undefined;
|
|
27
|
-
parent?: `0x${string}` | undefined;
|
|
28
|
-
}, {
|
|
29
|
-
block: {
|
|
30
|
-
extrinsics: `0x${string}`[];
|
|
31
|
-
header?: any;
|
|
32
|
-
};
|
|
33
|
-
includeRaw?: boolean | undefined;
|
|
34
|
-
includeParsed?: boolean | undefined;
|
|
35
|
-
includeBlockDetails?: boolean | undefined;
|
|
36
|
-
parent?: `0x${string}` | undefined;
|
|
37
|
-
}>;
|
|
11
|
+
extrinsics: z.ZodArray<z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
}, z.core.$strip>;
|
|
38
14
|
type Params = z.infer<typeof schema>;
|
|
39
15
|
export interface RunBlockParams {
|
|
40
16
|
/**
|
|
@@ -5,21 +5,11 @@ import { setupContext } from '../../context.js';
|
|
|
5
5
|
import { configSchema, getYargsOptions } from '../../schema/index.js';
|
|
6
6
|
import { fetchEVMTransaction, prepareBlock, traceCalls, traceVM } from './utils.js';
|
|
7
7
|
const schema = configSchema.extend({
|
|
8
|
-
vm: z.boolean(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
|
|
13
|
-
}).optional(),
|
|
14
|
-
'disable-stack': z.boolean({
|
|
15
|
-
description: 'Disable stack trace'
|
|
16
|
-
}).optional(),
|
|
17
|
-
'page-size': z.number({
|
|
18
|
-
description: 'Default 50000. Reduce this if you get memory limit error.'
|
|
19
|
-
}).optional(),
|
|
20
|
-
output: z.string({
|
|
21
|
-
description: 'Output file'
|
|
22
|
-
})
|
|
8
|
+
vm: z.boolean().describe('Trace VM opcode').optional(),
|
|
9
|
+
'enable-memory': z.boolean().describe('Enable memory trace').optional(),
|
|
10
|
+
'disable-stack': z.boolean().describe('Disable stack trace').optional(),
|
|
11
|
+
'page-size': z.number().describe('Default 50000. Reduce this if you get memory limit error.').optional(),
|
|
12
|
+
output: z.string().describe('Output file')
|
|
23
13
|
});
|
|
24
14
|
export const cli = (y)=>{
|
|
25
15
|
y.command('trace-transaction <tx-hash>', 'EVM+ trace transaction. Only Acala and Karura are supported', (yargs)=>yargs.options(getYargsOptions(schema.shape)).positional('tx-hash', {
|
|
@@ -9,9 +9,7 @@ const schema = z.object({
|
|
|
9
9
|
block: configSchema.shape.block,
|
|
10
10
|
db: configSchema.shape.db,
|
|
11
11
|
'runtime-log-level': configSchema.shape['runtime-log-level'].default(5),
|
|
12
|
-
runtime: z.string(
|
|
13
|
-
description: 'Path to WASM built with feature `try-runtime` enabled'
|
|
14
|
-
}),
|
|
12
|
+
runtime: z.string().describe('Path to WASM built with feature `try-runtime` enabled'),
|
|
15
13
|
'import-storage': configSchema.shape['import-storage'],
|
|
16
14
|
checks: z.enum([
|
|
17
15
|
'None',
|
|
@@ -19,12 +17,8 @@ const schema = z.object({
|
|
|
19
17
|
'PreAndPost',
|
|
20
18
|
'TryState'
|
|
21
19
|
]),
|
|
22
|
-
'disable-spec-check': z.boolean(
|
|
23
|
-
|
|
24
|
-
}).optional(),
|
|
25
|
-
'output-path': z.string({
|
|
26
|
-
description: 'File path to print output'
|
|
27
|
-
}).optional()
|
|
20
|
+
'disable-spec-check': z.boolean().describe('Disable spec name/version check').optional(),
|
|
21
|
+
'output-path': z.string().describe('File path to print output').optional()
|
|
28
22
|
});
|
|
29
23
|
export const cli = (y)=>{
|
|
30
24
|
y.command('try-runtime', '🚧 EXPERIMENTAL: Check upgrade migrations 🚧', (yargs)=>yargs.options(getYargsOptions(schema.shape)), async (argv)=>{
|