@acala-network/chopsticks-executor 0.1.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.
@@ -0,0 +1,23 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * @param {string} code
5
+ * @returns {Promise<any>}
6
+ */
7
+ export function get_metadata(code: string): Promise<any>;
8
+ /**
9
+ * @param {string} code
10
+ * @returns {Promise<any>}
11
+ */
12
+ export function get_runtime_version(code: string): Promise<any>;
13
+ /**
14
+ * @param {any} entries
15
+ * @returns {Promise<any>}
16
+ */
17
+ export function calculate_state_root(entries: any): Promise<any>;
18
+ /**
19
+ * @param {number} task_id
20
+ * @param {string} ws_url
21
+ * @returns {Promise<void>}
22
+ */
23
+ export function run_task(task_id: number, ws_url: string): Promise<void>;
@@ -0,0 +1,716 @@
1
+ let imports = {};
2
+ imports['__wbindgen_placeholder__'] = module.exports;
3
+ let wasm;
4
+ const { TextDecoder, TextEncoder } = require(`util`);
5
+
6
+ const heap = new Array(32).fill(undefined);
7
+
8
+ heap.push(undefined, null, true, false);
9
+
10
+ function getObject(idx) { return heap[idx]; }
11
+
12
+ let heap_next = heap.length;
13
+
14
+ function dropObject(idx) {
15
+ if (idx < 36) return;
16
+ heap[idx] = heap_next;
17
+ heap_next = idx;
18
+ }
19
+
20
+ function takeObject(idx) {
21
+ const ret = getObject(idx);
22
+ dropObject(idx);
23
+ return ret;
24
+ }
25
+
26
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
27
+
28
+ cachedTextDecoder.decode();
29
+
30
+ let cachedUint8Memory0 = new Uint8Array();
31
+
32
+ function getUint8Memory0() {
33
+ if (cachedUint8Memory0.byteLength === 0) {
34
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
35
+ }
36
+ return cachedUint8Memory0;
37
+ }
38
+
39
+ function getStringFromWasm0(ptr, len) {
40
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
41
+ }
42
+
43
+ function addHeapObject(obj) {
44
+ if (heap_next === heap.length) heap.push(heap.length + 1);
45
+ const idx = heap_next;
46
+ heap_next = heap[idx];
47
+
48
+ heap[idx] = obj;
49
+ return idx;
50
+ }
51
+
52
+ let WASM_VECTOR_LEN = 0;
53
+
54
+ let cachedTextEncoder = new TextEncoder('utf-8');
55
+
56
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
57
+ ? function (arg, view) {
58
+ return cachedTextEncoder.encodeInto(arg, view);
59
+ }
60
+ : function (arg, view) {
61
+ const buf = cachedTextEncoder.encode(arg);
62
+ view.set(buf);
63
+ return {
64
+ read: arg.length,
65
+ written: buf.length
66
+ };
67
+ });
68
+
69
+ function passStringToWasm0(arg, malloc, realloc) {
70
+
71
+ if (realloc === undefined) {
72
+ const buf = cachedTextEncoder.encode(arg);
73
+ const ptr = malloc(buf.length);
74
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
75
+ WASM_VECTOR_LEN = buf.length;
76
+ return ptr;
77
+ }
78
+
79
+ let len = arg.length;
80
+ let ptr = malloc(len);
81
+
82
+ const mem = getUint8Memory0();
83
+
84
+ let offset = 0;
85
+
86
+ for (; offset < len; offset++) {
87
+ const code = arg.charCodeAt(offset);
88
+ if (code > 0x7F) break;
89
+ mem[ptr + offset] = code;
90
+ }
91
+
92
+ if (offset !== len) {
93
+ if (offset !== 0) {
94
+ arg = arg.slice(offset);
95
+ }
96
+ ptr = realloc(ptr, len, len = offset + arg.length * 3);
97
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
98
+ const ret = encodeString(arg, view);
99
+
100
+ offset += ret.written;
101
+ }
102
+
103
+ WASM_VECTOR_LEN = offset;
104
+ return ptr;
105
+ }
106
+
107
+ function isLikeNone(x) {
108
+ return x === undefined || x === null;
109
+ }
110
+
111
+ let cachedInt32Memory0 = new Int32Array();
112
+
113
+ function getInt32Memory0() {
114
+ if (cachedInt32Memory0.byteLength === 0) {
115
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
116
+ }
117
+ return cachedInt32Memory0;
118
+ }
119
+
120
+ let cachedFloat64Memory0 = new Float64Array();
121
+
122
+ function getFloat64Memory0() {
123
+ if (cachedFloat64Memory0.byteLength === 0) {
124
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
125
+ }
126
+ return cachedFloat64Memory0;
127
+ }
128
+
129
+ function debugString(val) {
130
+ // primitive types
131
+ const type = typeof val;
132
+ if (type == 'number' || type == 'boolean' || val == null) {
133
+ return `${val}`;
134
+ }
135
+ if (type == 'string') {
136
+ return `"${val}"`;
137
+ }
138
+ if (type == 'symbol') {
139
+ const description = val.description;
140
+ if (description == null) {
141
+ return 'Symbol';
142
+ } else {
143
+ return `Symbol(${description})`;
144
+ }
145
+ }
146
+ if (type == 'function') {
147
+ const name = val.name;
148
+ if (typeof name == 'string' && name.length > 0) {
149
+ return `Function(${name})`;
150
+ } else {
151
+ return 'Function';
152
+ }
153
+ }
154
+ // objects
155
+ if (Array.isArray(val)) {
156
+ const length = val.length;
157
+ let debug = '[';
158
+ if (length > 0) {
159
+ debug += debugString(val[0]);
160
+ }
161
+ for(let i = 1; i < length; i++) {
162
+ debug += ', ' + debugString(val[i]);
163
+ }
164
+ debug += ']';
165
+ return debug;
166
+ }
167
+ // Test for built-in
168
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
169
+ let className;
170
+ if (builtInMatches.length > 1) {
171
+ className = builtInMatches[1];
172
+ } else {
173
+ // Failed to match the standard '[object ClassName]'
174
+ return toString.call(val);
175
+ }
176
+ if (className == 'Object') {
177
+ // we're a user defined class or Object
178
+ // JSON.stringify avoids problems with cycles, and is generally much
179
+ // easier than looping through ownProperties of `val`.
180
+ try {
181
+ return 'Object(' + JSON.stringify(val) + ')';
182
+ } catch (_) {
183
+ return 'Object';
184
+ }
185
+ }
186
+ // errors
187
+ if (val instanceof Error) {
188
+ return `${val.name}: ${val.message}\n${val.stack}`;
189
+ }
190
+ // TODO we could test for more things here, like `Set`s and `Map`s.
191
+ return className;
192
+ }
193
+
194
+ function makeMutClosure(arg0, arg1, dtor, f) {
195
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
196
+ const real = (...args) => {
197
+ // First up with a closure we increment the internal reference
198
+ // count. This ensures that the Rust closure environment won't
199
+ // be deallocated while we're invoking it.
200
+ state.cnt++;
201
+ const a = state.a;
202
+ state.a = 0;
203
+ try {
204
+ return f(a, state.b, ...args);
205
+ } finally {
206
+ if (--state.cnt === 0) {
207
+ wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
208
+
209
+ } else {
210
+ state.a = a;
211
+ }
212
+ }
213
+ };
214
+ real.original = state;
215
+
216
+ return real;
217
+ }
218
+ function __wbg_adapter_34(arg0, arg1) {
219
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h02966536ada1e2ec(arg0, arg1);
220
+ }
221
+
222
+ function __wbg_adapter_37(arg0, arg1, arg2) {
223
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1b2bf9b4d4c4f277(arg0, arg1, addHeapObject(arg2));
224
+ }
225
+
226
+ function __wbg_adapter_42(arg0, arg1) {
227
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h15a3bc2c3aeadda0(arg0, arg1);
228
+ }
229
+
230
+ function __wbg_adapter_47(arg0, arg1, arg2) {
231
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1e5424bf877a2067(arg0, arg1, addHeapObject(arg2));
232
+ }
233
+
234
+ function __wbg_adapter_50(arg0, arg1) {
235
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h57a3c36e486a0747(arg0, arg1);
236
+ }
237
+
238
+ /**
239
+ * @param {string} code
240
+ * @returns {Promise<any>}
241
+ */
242
+ module.exports.get_metadata = function(code) {
243
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
244
+ const len0 = WASM_VECTOR_LEN;
245
+ const ret = wasm.get_metadata(ptr0, len0);
246
+ return takeObject(ret);
247
+ };
248
+
249
+ /**
250
+ * @param {string} code
251
+ * @returns {Promise<any>}
252
+ */
253
+ module.exports.get_runtime_version = function(code) {
254
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
255
+ const len0 = WASM_VECTOR_LEN;
256
+ const ret = wasm.get_runtime_version(ptr0, len0);
257
+ return takeObject(ret);
258
+ };
259
+
260
+ /**
261
+ * @param {any} entries
262
+ * @returns {Promise<any>}
263
+ */
264
+ module.exports.calculate_state_root = function(entries) {
265
+ const ret = wasm.calculate_state_root(addHeapObject(entries));
266
+ return takeObject(ret);
267
+ };
268
+
269
+ /**
270
+ * @param {number} task_id
271
+ * @param {string} ws_url
272
+ * @returns {Promise<void>}
273
+ */
274
+ module.exports.run_task = function(task_id, ws_url) {
275
+ const ptr0 = passStringToWasm0(ws_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
276
+ const len0 = WASM_VECTOR_LEN;
277
+ const ret = wasm.run_task(task_id, ptr0, len0);
278
+ return takeObject(ret);
279
+ };
280
+
281
+ function handleError(f, args) {
282
+ try {
283
+ return f.apply(this, args);
284
+ } catch (e) {
285
+ wasm.__wbindgen_exn_store(addHeapObject(e));
286
+ }
287
+ }
288
+
289
+ function getArrayU8FromWasm0(ptr, len) {
290
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
291
+ }
292
+
293
+ function notDefined(what) { return () => { throw new Error(`${what} is not defined`); }; }
294
+ function __wbg_adapter_135(arg0, arg1, arg2, arg3) {
295
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h2c31df8f56a307dc(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
296
+ }
297
+
298
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
299
+ takeObject(arg0);
300
+ };
301
+
302
+ module.exports.__wbindgen_cb_drop = function(arg0) {
303
+ const obj = takeObject(arg0).original;
304
+ if (obj.cnt-- == 1) {
305
+ obj.a = 0;
306
+ return true;
307
+ }
308
+ const ret = false;
309
+ return ret;
310
+ };
311
+
312
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
313
+ const ret = getStringFromWasm0(arg0, arg1);
314
+ return addHeapObject(ret);
315
+ };
316
+
317
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
318
+ const obj = getObject(arg1);
319
+ const ret = typeof(obj) === 'string' ? obj : undefined;
320
+ var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
321
+ var len0 = WASM_VECTOR_LEN;
322
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
323
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
324
+ };
325
+
326
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
327
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
328
+ return addHeapObject(ret);
329
+ };
330
+
331
+ module.exports.__wbindgen_number_new = function(arg0) {
332
+ const ret = arg0;
333
+ return addHeapObject(ret);
334
+ };
335
+
336
+ module.exports.__wbindgen_object_clone_ref = function(arg0) {
337
+ const ret = getObject(arg0);
338
+ return addHeapObject(ret);
339
+ };
340
+
341
+ module.exports.__wbindgen_is_object = function(arg0) {
342
+ const val = getObject(arg0);
343
+ const ret = typeof(val) === 'object' && val !== null;
344
+ return ret;
345
+ };
346
+
347
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
348
+ const ret = getObject(arg0) == getObject(arg1);
349
+ return ret;
350
+ };
351
+
352
+ module.exports.__wbindgen_boolean_get = function(arg0) {
353
+ const v = getObject(arg0);
354
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
355
+ return ret;
356
+ };
357
+
358
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
359
+ const obj = getObject(arg1);
360
+ const ret = typeof(obj) === 'number' ? obj : undefined;
361
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
362
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
363
+ };
364
+
365
+ module.exports.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
366
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
367
+ };
368
+
369
+ module.exports.__wbindgen_is_string = function(arg0) {
370
+ const ret = typeof(getObject(arg0)) === 'string';
371
+ return ret;
372
+ };
373
+
374
+ module.exports.__wbg_data_7b1f01f4e6a64fbe = function(arg0) {
375
+ const ret = getObject(arg0).data;
376
+ return addHeapObject(ret);
377
+ };
378
+
379
+ module.exports.__wbg_wasClean_2af04e6cf2076497 = function(arg0) {
380
+ const ret = getObject(arg0).wasClean;
381
+ return ret;
382
+ };
383
+
384
+ module.exports.__wbg_code_24e161f043adce8a = function(arg0) {
385
+ const ret = getObject(arg0).code;
386
+ return ret;
387
+ };
388
+
389
+ module.exports.__wbg_reason_40159cc3d2fc655d = function(arg0, arg1) {
390
+ const ret = getObject(arg1).reason;
391
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
392
+ const len0 = WASM_VECTOR_LEN;
393
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
394
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
395
+ };
396
+
397
+ module.exports.__wbg_debug_f15cb542ea509609 = function(arg0) {
398
+ console.debug(getObject(arg0));
399
+ };
400
+
401
+ module.exports.__wbg_error_ef9a0be47931175f = function(arg0) {
402
+ console.error(getObject(arg0));
403
+ };
404
+
405
+ module.exports.__wbg_info_2874fdd5393f35ce = function(arg0) {
406
+ console.info(getObject(arg0));
407
+ };
408
+
409
+ module.exports.__wbg_log_4b5638ad60bdc54a = function(arg0) {
410
+ console.log(getObject(arg0));
411
+ };
412
+
413
+ module.exports.__wbg_warn_58110c4a199df084 = function(arg0) {
414
+ console.warn(getObject(arg0));
415
+ };
416
+
417
+ module.exports.__wbg_readyState_9c0f66433e329c9e = function(arg0) {
418
+ const ret = getObject(arg0).readyState;
419
+ return ret;
420
+ };
421
+
422
+ module.exports.__wbg_setonopen_9ce48dce57e549b5 = function(arg0, arg1) {
423
+ getObject(arg0).onopen = getObject(arg1);
424
+ };
425
+
426
+ module.exports.__wbg_setonerror_02393260b3e29972 = function(arg0, arg1) {
427
+ getObject(arg0).onerror = getObject(arg1);
428
+ };
429
+
430
+ module.exports.__wbg_setonclose_4ce49fd8fd7783fb = function(arg0, arg1) {
431
+ getObject(arg0).onclose = getObject(arg1);
432
+ };
433
+
434
+ module.exports.__wbg_setonmessage_c5a806b62a0c5607 = function(arg0, arg1) {
435
+ getObject(arg0).onmessage = getObject(arg1);
436
+ };
437
+
438
+ module.exports.__wbg_setbinaryType_ee55743ddf4beb37 = function(arg0, arg1) {
439
+ getObject(arg0).binaryType = takeObject(arg1);
440
+ };
441
+
442
+ module.exports.__wbg_new_d29e507f6606de91 = function() { return handleError(function (arg0, arg1) {
443
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
444
+ return addHeapObject(ret);
445
+ }, arguments) };
446
+
447
+ module.exports.__wbg_close_45d053bea59e7746 = function() { return handleError(function (arg0) {
448
+ getObject(arg0).close();
449
+ }, arguments) };
450
+
451
+ module.exports.__wbg_send_80b256d87a6779e5 = function() { return handleError(function (arg0, arg1, arg2) {
452
+ getObject(arg0).send(getStringFromWasm0(arg1, arg2));
453
+ }, arguments) };
454
+
455
+ module.exports.__wbg_send_640853f8eb0f0385 = function() { return handleError(function (arg0, arg1, arg2) {
456
+ getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
457
+ }, arguments) };
458
+
459
+ module.exports.__wbg_clearTimeout_5b4145302d77e5f3 = typeof clearTimeout == 'function' ? clearTimeout : notDefined('clearTimeout');
460
+
461
+ module.exports.__wbg_setTimeout_02c3975efb677088 = function() { return handleError(function (arg0, arg1) {
462
+ const ret = setTimeout(getObject(arg0), arg1);
463
+ return ret;
464
+ }, arguments) };
465
+
466
+ module.exports.__wbg_get_57245cc7d7c7619d = function(arg0, arg1) {
467
+ const ret = getObject(arg0)[arg1 >>> 0];
468
+ return addHeapObject(ret);
469
+ };
470
+
471
+ module.exports.__wbg_length_6e3bbe7c8bd4dbd8 = function(arg0) {
472
+ const ret = getObject(arg0).length;
473
+ return ret;
474
+ };
475
+
476
+ module.exports.__wbg_new_1d9a920c6bfc44a8 = function() {
477
+ const ret = new Array();
478
+ return addHeapObject(ret);
479
+ };
480
+
481
+ module.exports.__wbindgen_is_function = function(arg0) {
482
+ const ret = typeof(getObject(arg0)) === 'function';
483
+ return ret;
484
+ };
485
+
486
+ module.exports.__wbg_next_579e583d33566a86 = function(arg0) {
487
+ const ret = getObject(arg0).next;
488
+ return addHeapObject(ret);
489
+ };
490
+
491
+ module.exports.__wbg_next_aaef7c8aa5e212ac = function() { return handleError(function (arg0) {
492
+ const ret = getObject(arg0).next();
493
+ return addHeapObject(ret);
494
+ }, arguments) };
495
+
496
+ module.exports.__wbg_done_1b73b0672e15f234 = function(arg0) {
497
+ const ret = getObject(arg0).done;
498
+ return ret;
499
+ };
500
+
501
+ module.exports.__wbg_value_1ccc36bc03462d71 = function(arg0) {
502
+ const ret = getObject(arg0).value;
503
+ return addHeapObject(ret);
504
+ };
505
+
506
+ module.exports.__wbg_iterator_6f9d4f28845f426c = function() {
507
+ const ret = Symbol.iterator;
508
+ return addHeapObject(ret);
509
+ };
510
+
511
+ module.exports.__wbg_get_765201544a2b6869 = function() { return handleError(function (arg0, arg1) {
512
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
513
+ return addHeapObject(ret);
514
+ }, arguments) };
515
+
516
+ module.exports.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
517
+ const ret = getObject(arg0).call(getObject(arg1));
518
+ return addHeapObject(ret);
519
+ }, arguments) };
520
+
521
+ module.exports.__wbg_new_0b9bfdd97583284e = function() {
522
+ const ret = new Object();
523
+ return addHeapObject(ret);
524
+ };
525
+
526
+ module.exports.__wbg_set_a68214f35c417fa9 = function(arg0, arg1, arg2) {
527
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
528
+ };
529
+
530
+ module.exports.__wbg_isArray_27c46c67f498e15d = function(arg0) {
531
+ const ret = Array.isArray(getObject(arg0));
532
+ return ret;
533
+ };
534
+
535
+ module.exports.__wbg_instanceof_ArrayBuffer_e5e48f4762c5610b = function(arg0) {
536
+ let result;
537
+ try {
538
+ result = getObject(arg0) instanceof ArrayBuffer;
539
+ } catch {
540
+ result = false;
541
+ }
542
+ const ret = result;
543
+ return ret;
544
+ };
545
+
546
+ module.exports.__wbg_instanceof_Error_56b496a10a56de66 = function(arg0) {
547
+ let result;
548
+ try {
549
+ result = getObject(arg0) instanceof Error;
550
+ } catch {
551
+ result = false;
552
+ }
553
+ const ret = result;
554
+ return ret;
555
+ };
556
+
557
+ module.exports.__wbg_message_fe2af63ccc8985bc = function(arg0) {
558
+ const ret = getObject(arg0).message;
559
+ return addHeapObject(ret);
560
+ };
561
+
562
+ module.exports.__wbg_name_48eda3ae6aa697ca = function(arg0) {
563
+ const ret = getObject(arg0).name;
564
+ return addHeapObject(ret);
565
+ };
566
+
567
+ module.exports.__wbg_toString_73c9b562dccf34bd = function(arg0) {
568
+ const ret = getObject(arg0).toString();
569
+ return addHeapObject(ret);
570
+ };
571
+
572
+ module.exports.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
573
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
574
+ return addHeapObject(ret);
575
+ }, arguments) };
576
+
577
+ module.exports.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
578
+ try {
579
+ var state0 = {a: arg0, b: arg1};
580
+ var cb0 = (arg0, arg1) => {
581
+ const a = state0.a;
582
+ state0.a = 0;
583
+ try {
584
+ return __wbg_adapter_135(a, state0.b, arg0, arg1);
585
+ } finally {
586
+ state0.a = a;
587
+ }
588
+ };
589
+ const ret = new Promise(cb0);
590
+ return addHeapObject(ret);
591
+ } finally {
592
+ state0.a = state0.b = 0;
593
+ }
594
+ };
595
+
596
+ module.exports.__wbg_resolve_99fe17964f31ffc0 = function(arg0) {
597
+ const ret = Promise.resolve(getObject(arg0));
598
+ return addHeapObject(ret);
599
+ };
600
+
601
+ module.exports.__wbg_then_11f7a54d67b4bfad = function(arg0, arg1) {
602
+ const ret = getObject(arg0).then(getObject(arg1));
603
+ return addHeapObject(ret);
604
+ };
605
+
606
+ module.exports.__wbg_buffer_3f3d764d4747d564 = function(arg0) {
607
+ const ret = getObject(arg0).buffer;
608
+ return addHeapObject(ret);
609
+ };
610
+
611
+ module.exports.__wbg_new_8c3f0052272a457a = function(arg0) {
612
+ const ret = new Uint8Array(getObject(arg0));
613
+ return addHeapObject(ret);
614
+ };
615
+
616
+ module.exports.__wbg_set_83db9690f9353e79 = function(arg0, arg1, arg2) {
617
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
618
+ };
619
+
620
+ module.exports.__wbg_length_9e1ae1900cb0fbd5 = function(arg0) {
621
+ const ret = getObject(arg0).length;
622
+ return ret;
623
+ };
624
+
625
+ module.exports.__wbg_instanceof_Uint8Array_971eeda69eb75003 = function(arg0) {
626
+ let result;
627
+ try {
628
+ result = getObject(arg0) instanceof Uint8Array;
629
+ } catch {
630
+ result = false;
631
+ }
632
+ const ret = result;
633
+ return ret;
634
+ };
635
+
636
+ module.exports.__wbg_new_abda76e883ba8a5f = function() {
637
+ const ret = new Error();
638
+ return addHeapObject(ret);
639
+ };
640
+
641
+ module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
642
+ const ret = getObject(arg1).stack;
643
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
644
+ const len0 = WASM_VECTOR_LEN;
645
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
646
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
647
+ };
648
+
649
+ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
650
+ try {
651
+ console.error(getStringFromWasm0(arg0, arg1));
652
+ } finally {
653
+ wasm.__wbindgen_free(arg0, arg1);
654
+ }
655
+ };
656
+
657
+ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
658
+ const ret = debugString(getObject(arg1));
659
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
660
+ const len0 = WASM_VECTOR_LEN;
661
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
662
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
663
+ };
664
+
665
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
666
+ throw new Error(getStringFromWasm0(arg0, arg1));
667
+ };
668
+
669
+ module.exports.__wbindgen_memory = function() {
670
+ const ret = wasm.memory;
671
+ return addHeapObject(ret);
672
+ };
673
+
674
+ module.exports.__wbindgen_closure_wrapper186 = function(arg0, arg1, arg2) {
675
+ const ret = makeMutClosure(arg0, arg1, 58, __wbg_adapter_34);
676
+ return addHeapObject(ret);
677
+ };
678
+
679
+ module.exports.__wbindgen_closure_wrapper1795 = function(arg0, arg1, arg2) {
680
+ const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_37);
681
+ return addHeapObject(ret);
682
+ };
683
+
684
+ module.exports.__wbindgen_closure_wrapper1797 = function(arg0, arg1, arg2) {
685
+ const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_37);
686
+ return addHeapObject(ret);
687
+ };
688
+
689
+ module.exports.__wbindgen_closure_wrapper1799 = function(arg0, arg1, arg2) {
690
+ const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_42);
691
+ return addHeapObject(ret);
692
+ };
693
+
694
+ module.exports.__wbindgen_closure_wrapper1801 = function(arg0, arg1, arg2) {
695
+ const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_37);
696
+ return addHeapObject(ret);
697
+ };
698
+
699
+ module.exports.__wbindgen_closure_wrapper2141 = function(arg0, arg1, arg2) {
700
+ const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_47);
701
+ return addHeapObject(ret);
702
+ };
703
+
704
+ module.exports.__wbindgen_closure_wrapper2175 = function(arg0, arg1, arg2) {
705
+ const ret = makeMutClosure(arg0, arg1, 549, __wbg_adapter_50);
706
+ return addHeapObject(ret);
707
+ };
708
+
709
+ const path = require('path').join(__dirname, 'chopsticks_executor_bg.wasm');
710
+ const bytes = require('fs').readFileSync(path);
711
+
712
+ const wasmModule = new WebAssembly.Module(bytes);
713
+ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
714
+ wasm = wasmInstance.exports;
715
+ module.exports.__wasm = wasm;
716
+
Binary file
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@acala-network/chopsticks-executor",
3
+ "version": "0.1.0",
4
+ "files": [
5
+ "chopsticks_executor_bg.wasm",
6
+ "chopsticks_executor.js",
7
+ "chopsticks_executor.d.ts"
8
+ ],
9
+ "main": "chopsticks_executor.js",
10
+ "types": "chopsticks_executor.d.ts"
11
+ }