@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.
@@ -197,6 +197,7 @@ const connectBridgeHubs = async (source, destination, config)=>{
197
197
  if (generatedNonce <= delivered) return; // nothing new to deliver
198
198
  const from = delivered + 1n;
199
199
  const lastInChunk = from + MAX_MESSAGES_PER_PROOF - 1n;
200
+ // biome-ignore lint/complexity/useMathMinMax: Math.min does not accept bigint values.
200
201
  const to = lastInChunk < generatedNonce ? lastInChunk : generatedNonce;
201
202
  await deliverRange(laneHex, from, to, sourceHash, sourceNumber);
202
203
  inFlight.set(laneHex, to);
@@ -37,18 +37,12 @@ function _getRequireWildcardCache(nodeInterop) {
37
37
  })(nodeInterop);
38
38
  }
39
39
  function _interop_require_wildcard(obj, nodeInterop) {
40
- if (!nodeInterop && obj && obj.__esModule) {
41
- return obj;
42
- }
43
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
44
- return {
45
- default: obj
46
- };
47
- }
40
+ if (!nodeInterop && obj && obj.__esModule) return obj;
41
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") return {
42
+ default: obj
43
+ };
48
44
  var cache = _getRequireWildcardCache(nodeInterop);
49
- if (cache && cache.has(obj)) {
50
- return cache.get(obj);
51
- }
45
+ if (cache && cache.has(obj)) return cache.get(obj);
52
46
  var newObj = {
53
47
  __proto__: null
54
48
  };
@@ -56,17 +50,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
56
50
  for(var key in obj){
57
51
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
58
52
  var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
59
- if (desc && (desc.get || desc.set)) {
60
- Object.defineProperty(newObj, key, desc);
61
- } else {
62
- newObj[key] = obj[key];
63
- }
53
+ if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
54
+ else newObj[key] = obj[key];
64
55
  }
65
56
  }
66
57
  newObj.default = obj;
67
- if (cache) {
68
- cache.set(obj, newObj);
69
- }
58
+ if (cache) cache.set(obj, newObj);
70
59
  return newObj;
71
60
  }
72
61
  const logger = _chopstickscore.defaultLogger.child({
@@ -14,27 +14,13 @@ const _dryrunextrinsic = require("./dry-run-extrinsic.js");
14
14
  const _dryrunpreimage = require("./dry-run-preimage.js");
15
15
  const schema = _zod.z.object({
16
16
  ..._index.configSchema.shape,
17
- extrinsic: _zod.z.string({
18
- description: 'Extrinsic or call to dry run. If you pass call here then address is required to fake signature'
19
- }).optional(),
20
- address: _zod.z.string({
21
- description: 'Address to fake sign extrinsic'
22
- }).optional(),
23
- preimage: _zod.z.string({
24
- description: 'Preimage to dry run'
25
- }).optional(),
26
- at: _zod.z.string({
27
- description: 'Block hash to dry run'
28
- }).optional(),
29
- 'output-path': _zod.z.string({
30
- description: 'File path to print output'
31
- }).optional(),
32
- html: _zod.z.boolean({
33
- description: 'Generate html with storage diff'
34
- }).optional(),
35
- open: _zod.z.boolean({
36
- description: 'Open generated html'
37
- }).optional()
17
+ extrinsic: _zod.z.string().describe('Extrinsic or call to dry run. If you pass call here then address is required to fake signature').optional(),
18
+ address: _zod.z.string().describe('Address to fake sign extrinsic').optional(),
19
+ preimage: _zod.z.string().describe('Preimage to dry run').optional(),
20
+ at: _zod.z.string().describe('Block hash to dry run').optional(),
21
+ 'output-path': _zod.z.string().describe('File path to print output').optional(),
22
+ html: _zod.z.boolean().describe('Generate html with storage diff').optional(),
23
+ open: _zod.z.boolean().describe('Open generated html').optional()
38
24
  });
39
25
  const cli = (y)=>{
40
26
  y.command('dry-run', 'Dry run an extrinsic', (yargs)=>yargs.options((0, _index.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.ZodString]>>;
11
- host: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"localhost">, z.ZodString]>>;
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, "many">]>>;
14
- block: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNull]>>;
15
- 'build-block-mode': z.ZodDefault<z.ZodNativeEnum<typeof import("@acala-network/chopsticks-core").BuildBlockMode>>;
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, "many">]>>;
29
- tokenSymbol: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
30
- }, "strip", z.ZodTypeAny, {
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
- }, "strip", z.ZodTypeAny, {
43
- top: Record<string, string>;
44
- }, {
45
- top: Record<string, string>;
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, "many">]>>;
89
- tokenSymbol: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
90
- }, "strip", z.ZodTypeAny, {
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
- }, "strip", z.ZodTypeAny, {
103
- top: Record<string, string>;
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.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>, z.ZodNumber, z.ZodBoolean]>>;
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
- }, "strip", z.ZodTypeAny, {
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';
@@ -27,25 +27,11 @@ function _export_star(from, to) {
27
27
  }
28
28
  const dryRunSchema = _zod.z.object({
29
29
  ..._index.configSchema.shape,
30
- extrinsic: _zod.z.string({
31
- description: 'Extrinsic or call to dry run. If you pass call here then address is required to fake signature'
32
- }).optional(),
33
- address: _zod.z.string({
34
- description: 'Address to fake sign extrinsic'
35
- }).optional(),
36
- preimage: _zod.z.string({
37
- description: 'Preimage to dry run'
38
- }).optional(),
39
- at: _zod.z.string({
40
- description: 'Block hash to dry run'
41
- }).optional(),
42
- 'output-path': _zod.z.string({
43
- description: 'File path to print output'
44
- }).optional(),
45
- html: _zod.z.boolean({
46
- description: 'Generate html with storage diff'
47
- }).optional(),
48
- open: _zod.z.boolean({
49
- description: 'Open generated html'
50
- }).optional()
30
+ extrinsic: _zod.z.string().describe('Extrinsic or call to dry run. If you pass call here then address is required to fake signature').optional(),
31
+ address: _zod.z.string().describe('Address to fake sign extrinsic').optional(),
32
+ preimage: _zod.z.string().describe('Preimage to dry run').optional(),
33
+ at: _zod.z.string().describe('Block hash to dry run').optional(),
34
+ 'output-path': _zod.z.string().describe('File path to print output').optional(),
35
+ html: _zod.z.boolean().describe('Generate html with storage diff').optional(),
36
+ open: _zod.z.boolean().describe('Open generated html').optional()
51
37
  });
@@ -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.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodObject<{
7
- call: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
8
- address: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
9
- }, "strip", z.ZodTypeAny, {
10
- call: `0x${string}`;
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.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
19
- }, "strip", z.ZodTypeAny, {
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.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
29
- }, "strip", z.ZodTypeAny, {
30
- sentAt: number;
31
- msg: `0x${string}`;
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
  /**
@@ -47,18 +47,12 @@ function _getRequireWildcardCache(nodeInterop) {
47
47
  })(nodeInterop);
48
48
  }
49
49
  function _interop_require_wildcard(obj, nodeInterop) {
50
- if (!nodeInterop && obj && obj.__esModule) {
51
- return obj;
52
- }
53
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
54
- return {
55
- default: obj
56
- };
57
- }
50
+ if (!nodeInterop && obj && obj.__esModule) return obj;
51
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") return {
52
+ default: obj
53
+ };
58
54
  var cache = _getRequireWildcardCache(nodeInterop);
59
- if (cache && cache.has(obj)) {
60
- return cache.get(obj);
61
- }
55
+ if (cache && cache.has(obj)) return cache.get(obj);
62
56
  var newObj = {
63
57
  __proto__: null
64
58
  };
@@ -66,17 +60,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
66
60
  for(var key in obj){
67
61
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
68
62
  var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
69
- if (desc && (desc.get || desc.set)) {
70
- Object.defineProperty(newObj, key, desc);
71
- } else {
72
- newObj[key] = obj[key];
73
- }
63
+ if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
64
+ else newObj[key] = obj[key];
74
65
  }
75
66
  }
76
67
  newObj.default = obj;
77
- if (cache) {
78
- cache.set(obj, newObj);
79
- }
68
+ if (cache) cache.set(obj, newObj);
80
69
  return newObj;
81
70
  }
82
71
  const logger = _logger.defaultLogger.child({
@@ -17,15 +17,9 @@ const _generatehtmldiff = require("../../utils/generate-html-diff.js");
17
17
  const _openhtml = require("../../utils/open-html.js");
18
18
  const schema = _zod.z.object({
19
19
  ..._index.configSchema.shape,
20
- 'output-path': _zod.z.string({
21
- description: 'File path to print output'
22
- }).optional(),
23
- html: _zod.z.boolean({
24
- description: 'Generate html with storage diff'
25
- }).optional(),
26
- open: _zod.z.boolean({
27
- description: 'Open generated html'
28
- }).optional()
20
+ 'output-path': _zod.z.string().describe('File path to print output').optional(),
21
+ html: _zod.z.boolean().describe('Generate html with storage diff').optional(),
22
+ open: _zod.z.boolean().describe('Open generated html').optional()
29
23
  });
30
24
  const cli = (y)=>{
31
25
  y.command('run-block', 'Replay a block', (yargs)=>yargs.options((0, _index.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.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>>;
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.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, "many">;
12
- }, "strip", z.ZodTypeAny, {
13
- extrinsics: `0x${string}`[];
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
  /**
@@ -15,21 +15,11 @@ const _context = require("../../context.js");
15
15
  const _index = require("../../schema/index.js");
16
16
  const _utils = require("./utils.js");
17
17
  const schema = _index.configSchema.extend({
18
- vm: _zod.z.boolean({
19
- description: 'Trace VM opcode'
20
- }).optional(),
21
- 'enable-memory': _zod.z.boolean({
22
- description: 'Enable memory trace'
23
- }).optional(),
24
- 'disable-stack': _zod.z.boolean({
25
- description: 'Disable stack trace'
26
- }).optional(),
27
- 'page-size': _zod.z.number({
28
- description: 'Default 50000. Reduce this if you get memory limit error.'
29
- }).optional(),
30
- output: _zod.z.string({
31
- description: 'Output file'
32
- })
18
+ vm: _zod.z.boolean().describe('Trace VM opcode').optional(),
19
+ 'enable-memory': _zod.z.boolean().describe('Enable memory trace').optional(),
20
+ 'disable-stack': _zod.z.boolean().describe('Disable stack trace').optional(),
21
+ 'page-size': _zod.z.number().describe('Default 50000. Reduce this if you get memory limit error.').optional(),
22
+ output: _zod.z.string().describe('Output file')
33
23
  });
34
24
  const cli = (y)=>{
35
25
  y.command('trace-transaction <tx-hash>', 'EVM+ trace transaction. Only Acala and Karura are supported', (yargs)=>yargs.options((0, _index.getYargsOptions)(schema.shape)).positional('tx-hash', {
@@ -19,9 +19,7 @@ const schema = _zod.z.object({
19
19
  block: _index.configSchema.shape.block,
20
20
  db: _index.configSchema.shape.db,
21
21
  'runtime-log-level': _index.configSchema.shape['runtime-log-level'].default(5),
22
- runtime: _zod.z.string({
23
- description: 'Path to WASM built with feature `try-runtime` enabled'
24
- }),
22
+ runtime: _zod.z.string().describe('Path to WASM built with feature `try-runtime` enabled'),
25
23
  'import-storage': _index.configSchema.shape['import-storage'],
26
24
  checks: _zod.z.enum([
27
25
  'None',
@@ -29,12 +27,8 @@ const schema = _zod.z.object({
29
27
  'PreAndPost',
30
28
  'TryState'
31
29
  ]),
32
- 'disable-spec-check': _zod.z.boolean({
33
- description: 'Disable spec name/version check'
34
- }).optional(),
35
- 'output-path': _zod.z.string({
36
- description: 'File path to print output'
37
- }).optional()
30
+ 'disable-spec-check': _zod.z.boolean().describe('Disable spec name/version check').optional(),
31
+ 'output-path': _zod.z.string().describe('File path to print output').optional()
38
32
  });
39
33
  const cli = (y)=>{
40
34
  y.command('try-runtime', '🚧 EXPERIMENTAL: Check upgrade migrations 🚧', (yargs)=>yargs.options((0, _index.getYargsOptions)(schema.shape)), async (argv)=>{