@acala-network/chopsticks-executor 0.2.3 → 0.3.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.
@@ -26,6 +26,7 @@ export function decode_proof(root_trie_hash: any, keys: any, nodes: any): Promis
26
26
  export function create_proof(root_trie_hash: any, nodes: any, entries: any): Promise<any>;
27
27
  /**
28
28
  * @param {any} task
29
+ * @param {any} js
29
30
  * @returns {Promise<any>}
30
31
  */
31
- export function run_task(task: any): Promise<any>;
32
+ export function run_task(task: any, js: any): Promise<any>;
@@ -9,20 +9,6 @@ heap.push(undefined, null, true, false);
9
9
 
10
10
  function getObject(idx) { return heap[idx]; }
11
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
12
  let WASM_VECTOR_LEN = 0;
27
13
 
28
14
  let cachedUint8Memory0 = new Uint8Array();
@@ -100,6 +86,20 @@ function getInt32Memory0() {
100
86
  return cachedInt32Memory0;
101
87
  }
102
88
 
89
+ let heap_next = heap.length;
90
+
91
+ function dropObject(idx) {
92
+ if (idx < 36) return;
93
+ heap[idx] = heap_next;
94
+ heap_next = idx;
95
+ }
96
+
97
+ function takeObject(idx) {
98
+ const ret = getObject(idx);
99
+ dropObject(idx);
100
+ return ret;
101
+ }
102
+
103
103
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
104
104
 
105
105
  cachedTextDecoder.decode();
@@ -261,10 +261,11 @@ module.exports.create_proof = function(root_trie_hash, nodes, entries) {
261
261
 
262
262
  /**
263
263
  * @param {any} task
264
+ * @param {any} js
264
265
  * @returns {Promise<any>}
265
266
  */
266
- module.exports.run_task = function(task) {
267
- const ret = wasm.run_task(addHeapObject(task));
267
+ module.exports.run_task = function(task, js) {
268
+ const ret = wasm.run_task(addHeapObject(task), addHeapObject(js));
268
269
  return takeObject(ret);
269
270
  };
270
271
 
@@ -279,6 +280,24 @@ function __wbg_adapter_88(arg0, arg1, arg2, arg3) {
279
280
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h0ff20d32b5299564(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
280
281
  }
281
282
 
283
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
284
+ const obj = getObject(arg1);
285
+ const ret = typeof(obj) === 'string' ? obj : undefined;
286
+ var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
287
+ var len0 = WASM_VECTOR_LEN;
288
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
289
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
290
+ };
291
+
292
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
293
+ takeObject(arg0);
294
+ };
295
+
296
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
297
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
298
+ return addHeapObject(ret);
299
+ };
300
+
282
301
  module.exports.__wbg_isArray_27c46c67f498e15d = function(arg0) {
283
302
  const ret = Array.isArray(getObject(arg0));
284
303
  return ret;
@@ -309,24 +328,6 @@ module.exports.__wbg_value_1ccc36bc03462d71 = function(arg0) {
309
328
  return addHeapObject(ret);
310
329
  };
311
330
 
312
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
313
- takeObject(arg0);
314
- };
315
-
316
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
317
- const obj = getObject(arg1);
318
- const ret = typeof(obj) === 'string' ? obj : undefined;
319
- var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
320
- var len0 = WASM_VECTOR_LEN;
321
- getInt32Memory0()[arg0 / 4 + 1] = len0;
322
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
323
- };
324
-
325
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
326
- const ret = new Error(getStringFromWasm0(arg0, arg1));
327
- return addHeapObject(ret);
328
- };
329
-
330
331
  module.exports.__wbindgen_cb_drop = function(arg0) {
331
332
  const obj = takeObject(arg0).original;
332
333
  if (obj.cnt-- == 1) {
@@ -356,19 +357,25 @@ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
356
357
  return ret;
357
358
  };
358
359
 
359
- module.exports.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) {
360
- const ret = String(getObject(arg1));
361
- const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
362
- const len0 = WASM_VECTOR_LEN;
363
- getInt32Memory0()[arg0 / 4 + 1] = len0;
364
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
365
- };
366
-
367
360
  module.exports.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
368
361
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
369
362
  return addHeapObject(ret);
370
363
  }, arguments) };
371
364
 
365
+ module.exports.__wbg_new_0b9bfdd97583284e = function() {
366
+ const ret = new Object();
367
+ return addHeapObject(ret);
368
+ };
369
+
370
+ module.exports.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
371
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
372
+ };
373
+
374
+ module.exports.__wbindgen_number_new = function(arg0) {
375
+ const ret = arg0;
376
+ return addHeapObject(ret);
377
+ };
378
+
372
379
  module.exports.__wbindgen_is_object = function(arg0) {
373
380
  const val = getObject(arg0);
374
381
  const ret = typeof(val) === 'object' && val !== null;
@@ -396,32 +403,18 @@ module.exports.__wbindgen_boolean_get = function(arg0) {
396
403
  return ret;
397
404
  };
398
405
 
399
- module.exports.__wbg_new_0b9bfdd97583284e = function() {
400
- const ret = new Object();
401
- return addHeapObject(ret);
402
- };
403
-
404
- module.exports.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
405
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
406
- };
407
-
408
- module.exports.__wbindgen_number_new = function(arg0) {
409
- const ret = arg0;
410
- return addHeapObject(ret);
411
- };
412
-
413
- module.exports.__wbg_getNextKey_f7f031e8c33aa560 = function(arg0, arg1) {
414
- const ret = _chopsticks_binding_.getNextKey(takeObject(arg0), takeObject(arg1));
406
+ module.exports.__wbg_getNextKey_a5825839e674c793 = function(arg0, arg1) {
407
+ const ret = getObject(arg0).getNextKey(takeObject(arg1));
415
408
  return addHeapObject(ret);
416
409
  };
417
410
 
418
- module.exports.__wbg_getPrefixKeys_03afe954243a179b = function(arg0, arg1) {
419
- const ret = _chopsticks_binding_.getPrefixKeys(takeObject(arg0), takeObject(arg1));
411
+ module.exports.__wbg_getPrefixKeys_3f5b604d16063bb9 = function(arg0, arg1) {
412
+ const ret = getObject(arg0).getPrefixKeys(takeObject(arg1));
420
413
  return addHeapObject(ret);
421
414
  };
422
415
 
423
- module.exports.__wbg_getStorage_bb388aed65975550 = function(arg0, arg1) {
424
- const ret = _chopsticks_binding_.getStorage(takeObject(arg0), takeObject(arg1));
416
+ module.exports.__wbg_getStorage_b169f4e621ba07c4 = function(arg0, arg1) {
417
+ const ret = getObject(arg0).getStorage(takeObject(arg1));
425
418
  return addHeapObject(ret);
426
419
  };
427
420
 
@@ -430,9 +423,12 @@ module.exports.__wbindgen_is_string = function(arg0) {
430
423
  return ret;
431
424
  };
432
425
 
433
- module.exports.__wbindgen_object_clone_ref = function(arg0) {
434
- const ret = getObject(arg0);
435
- return addHeapObject(ret);
426
+ module.exports.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) {
427
+ const ret = String(getObject(arg1));
428
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
429
+ const len0 = WASM_VECTOR_LEN;
430
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
431
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
436
432
  };
437
433
 
438
434
  module.exports.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
@@ -553,6 +549,11 @@ module.exports.__wbg_instanceof_ArrayBuffer_e5e48f4762c5610b = function(arg0) {
553
549
  return ret;
554
550
  };
555
551
 
552
+ module.exports.__wbindgen_object_clone_ref = function(arg0) {
553
+ const ret = getObject(arg0);
554
+ return addHeapObject(ret);
555
+ };
556
+
556
557
  module.exports.__wbindgen_debug_string = function(arg0, arg1) {
557
558
  const ret = debugString(getObject(arg1));
558
559
  const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -580,7 +581,7 @@ module.exports.__wbg_then_11f7a54d67b4bfad = function(arg0, arg1) {
580
581
  return addHeapObject(ret);
581
582
  };
582
583
 
583
- module.exports.__wbindgen_closure_wrapper1229 = function(arg0, arg1, arg2) {
584
+ module.exports.__wbindgen_closure_wrapper1230 = function(arg0, arg1, arg2) {
584
585
  const ret = makeMutClosure(arg0, arg1, 75, __wbg_adapter_38);
585
586
  return addHeapObject(ret);
586
587
  };
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-executor",
3
3
  "description": "Chopsticks executor",
4
- "version": "0.2.3",
4
+ "version": "0.3.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",