@acala-network/chopsticks-executor 0.9.1-3 → 0.9.1-5

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.
@@ -32,7 +32,7 @@ export function create_proof(nodes: any, entries: any): Promise<any>;
32
32
  */
33
33
  export function run_task(task: any, js: JsCallback, log_level?: string): Promise<any>;
34
34
 
35
- import { HexString } from '@polkadot/util/types';
35
+ type HexString = `0x${string}`;
36
36
  export interface JsCallback {
37
37
  getStorage: (key: HexString) => Promise<string | undefined>
38
38
  getStateRoot: () => Promise<string>
@@ -7,20 +7,15 @@ const heap = new Array(128).fill(undefined);
7
7
 
8
8
  heap.push(undefined, null, true, false);
9
9
 
10
- function getObject(idx) { return heap[idx]; }
11
-
12
10
  let heap_next = heap.length;
13
11
 
14
- function dropObject(idx) {
15
- if (idx < 132) return;
16
- heap[idx] = heap_next;
17
- heap_next = idx;
18
- }
12
+ function addHeapObject(obj) {
13
+ if (heap_next === heap.length) heap.push(heap.length + 1);
14
+ const idx = heap_next;
15
+ heap_next = heap[idx];
19
16
 
20
- function takeObject(idx) {
21
- const ret = getObject(idx);
22
- dropObject(idx);
23
- return ret;
17
+ heap[idx] = obj;
18
+ return idx;
24
19
  }
25
20
 
26
21
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
@@ -41,13 +36,18 @@ function getStringFromWasm0(ptr, len) {
41
36
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
42
37
  }
43
38
 
44
- function addHeapObject(obj) {
45
- if (heap_next === heap.length) heap.push(heap.length + 1);
46
- const idx = heap_next;
47
- heap_next = heap[idx];
39
+ function getObject(idx) { return heap[idx]; }
48
40
 
49
- heap[idx] = obj;
50
- return idx;
41
+ function dropObject(idx) {
42
+ if (idx < 132) return;
43
+ heap[idx] = heap_next;
44
+ heap_next = idx;
45
+ }
46
+
47
+ function takeObject(idx) {
48
+ const ret = getObject(idx);
49
+ dropObject(idx);
50
+ return ret;
51
51
  }
52
52
 
53
53
  function isLikeNone(x) {
@@ -293,6 +293,64 @@ function __wbg_adapter_108(arg0, arg1, arg2, arg3) {
293
293
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h59e4ab6c95dba127(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
294
294
  }
295
295
 
296
+ module.exports.__wbg_new_c728d68b8b34487e = function() {
297
+ const ret = new Object();
298
+ return addHeapObject(ret);
299
+ };
300
+
301
+ module.exports.__wbg_set_841ac57cff3d672b = function(arg0, arg1, arg2) {
302
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
303
+ };
304
+
305
+ module.exports.__wbindgen_number_new = function(arg0) {
306
+ const ret = arg0;
307
+ return addHeapObject(ret);
308
+ };
309
+
310
+ module.exports.__wbg_new_08236689f0afb357 = function() {
311
+ const ret = new Array();
312
+ return addHeapObject(ret);
313
+ };
314
+
315
+ module.exports.__wbg_set_0ac78a2bc07da03c = function(arg0, arg1, arg2) {
316
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
317
+ };
318
+
319
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
320
+ const ret = getStringFromWasm0(arg0, arg1);
321
+ return addHeapObject(ret);
322
+ };
323
+
324
+ module.exports.__wbg_call_53fc3abd42e24ec8 = function() { return handleError(function (arg0, arg1, arg2) {
325
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
326
+ return addHeapObject(ret);
327
+ }, arguments) };
328
+
329
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
330
+ takeObject(arg0);
331
+ };
332
+
333
+ module.exports.__wbindgen_is_object = function(arg0) {
334
+ const val = getObject(arg0);
335
+ const ret = typeof(val) === 'object' && val !== null;
336
+ return ret;
337
+ };
338
+
339
+ module.exports.__wbg_getwithrefkey_5e6d9547403deab8 = function(arg0, arg1) {
340
+ const ret = getObject(arg0)[getObject(arg1)];
341
+ return addHeapObject(ret);
342
+ };
343
+
344
+ module.exports.__wbindgen_is_undefined = function(arg0) {
345
+ const ret = getObject(arg0) === undefined;
346
+ return ret;
347
+ };
348
+
349
+ module.exports.__wbindgen_in = function(arg0, arg1) {
350
+ const ret = getObject(arg0) in getObject(arg1);
351
+ return ret;
352
+ };
353
+
296
354
  module.exports.__wbg_isArray_38525be7442aa21e = function(arg0) {
297
355
  const ret = Array.isArray(getObject(arg0));
298
356
  return ret;
@@ -323,29 +381,12 @@ module.exports.__wbg_value_0570714ff7d75f35 = function(arg0) {
323
381
  return addHeapObject(ret);
324
382
  };
325
383
 
326
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
327
- takeObject(arg0);
328
- };
329
-
330
- module.exports.__wbg_new_08236689f0afb357 = function() {
331
- const ret = new Array();
332
- return addHeapObject(ret);
333
- };
334
-
335
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
336
- const ret = getStringFromWasm0(arg0, arg1);
337
- return addHeapObject(ret);
338
- };
339
-
340
- module.exports.__wbg_set_0ac78a2bc07da03c = function(arg0, arg1, arg2) {
341
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
384
+ module.exports.__wbindgen_boolean_get = function(arg0) {
385
+ const v = getObject(arg0);
386
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
387
+ return ret;
342
388
  };
343
389
 
344
- module.exports.__wbg_call_53fc3abd42e24ec8 = function() { return handleError(function (arg0, arg1, arg2) {
345
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
346
- return addHeapObject(ret);
347
- }, arguments) };
348
-
349
390
  module.exports.__wbindgen_number_get = function(arg0, arg1) {
350
391
  const obj = getObject(arg1);
351
392
  const ret = typeof(obj) === 'number' ? obj : undefined;
@@ -358,20 +399,6 @@ module.exports.__wbg_isSafeInteger_c38b0a16d0c7cef7 = function(arg0) {
358
399
  return ret;
359
400
  };
360
401
 
361
- module.exports.__wbg_new_c728d68b8b34487e = function() {
362
- const ret = new Object();
363
- return addHeapObject(ret);
364
- };
365
-
366
- module.exports.__wbg_set_841ac57cff3d672b = function(arg0, arg1, arg2) {
367
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
368
- };
369
-
370
- module.exports.__wbindgen_number_new = function(arg0) {
371
- const ret = arg0;
372
- return addHeapObject(ret);
373
- };
374
-
375
402
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
376
403
  const obj = getObject(arg1);
377
404
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -386,33 +413,6 @@ module.exports.__wbindgen_error_new = function(arg0, arg1) {
386
413
  return addHeapObject(ret);
387
414
  };
388
415
 
389
- module.exports.__wbindgen_is_object = function(arg0) {
390
- const val = getObject(arg0);
391
- const ret = typeof(val) === 'object' && val !== null;
392
- return ret;
393
- };
394
-
395
- module.exports.__wbg_getwithrefkey_5e6d9547403deab8 = function(arg0, arg1) {
396
- const ret = getObject(arg0)[getObject(arg1)];
397
- return addHeapObject(ret);
398
- };
399
-
400
- module.exports.__wbindgen_is_undefined = function(arg0) {
401
- const ret = getObject(arg0) === undefined;
402
- return ret;
403
- };
404
-
405
- module.exports.__wbindgen_in = function(arg0, arg1) {
406
- const ret = getObject(arg0) in getObject(arg1);
407
- return ret;
408
- };
409
-
410
- module.exports.__wbindgen_boolean_get = function(arg0) {
411
- const v = getObject(arg0);
412
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
413
- return ret;
414
- };
415
-
416
416
  module.exports.__wbindgen_cb_drop = function(arg0) {
417
417
  const obj = takeObject(arg0).original;
418
418
  if (obj.cnt-- == 1) {
@@ -441,37 +441,37 @@ module.exports.__wbg_String_88810dfeb4021902 = function(arg0, arg1) {
441
441
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
442
442
  };
443
443
 
444
- module.exports.__wbg_getStorage_e93aec15781aae67 = function(arg0, arg1) {
444
+ module.exports.__wbg_getStorage_96697e11c56b79c4 = function(arg0, arg1) {
445
445
  const ret = getObject(arg0).getStorage(takeObject(arg1));
446
446
  return addHeapObject(ret);
447
447
  };
448
448
 
449
- module.exports.__wbg_getStateRoot_906065f4887b553b = function(arg0) {
449
+ module.exports.__wbg_getStateRoot_d9cce7707839676f = function(arg0) {
450
450
  const ret = getObject(arg0).getStateRoot();
451
451
  return addHeapObject(ret);
452
452
  };
453
453
 
454
- module.exports.__wbg_getNextKey_7702ad41d1e6d93d = function(arg0, arg1, arg2) {
454
+ module.exports.__wbg_getNextKey_ebb14ba19e806c29 = function(arg0, arg1, arg2) {
455
455
  const ret = getObject(arg0).getNextKey(takeObject(arg1), takeObject(arg2));
456
456
  return addHeapObject(ret);
457
457
  };
458
458
 
459
- module.exports.__wbg_offchainGetStorage_3a008237e87386b5 = function(arg0, arg1) {
459
+ module.exports.__wbg_offchainGetStorage_9008dade145767af = function(arg0, arg1) {
460
460
  const ret = getObject(arg0).offchainGetStorage(takeObject(arg1));
461
461
  return addHeapObject(ret);
462
462
  };
463
463
 
464
- module.exports.__wbg_offchainTimestamp_ab157c9521924fa8 = function(arg0) {
464
+ module.exports.__wbg_offchainTimestamp_5ee9ae90800cd2f7 = function(arg0) {
465
465
  const ret = getObject(arg0).offchainTimestamp();
466
466
  return addHeapObject(ret);
467
467
  };
468
468
 
469
- module.exports.__wbg_offchainRandomSeed_b4a48d46480348aa = function(arg0) {
469
+ module.exports.__wbg_offchainRandomSeed_be8daaa3095ab839 = function(arg0) {
470
470
  const ret = getObject(arg0).offchainRandomSeed();
471
471
  return addHeapObject(ret);
472
472
  };
473
473
 
474
- module.exports.__wbg_offchainSubmitTransaction_2e85d9c73a3f6d2e = function(arg0, arg1) {
474
+ module.exports.__wbg_offchainSubmitTransaction_c50602f39032740b = function(arg0, arg1) {
475
475
  const ret = getObject(arg0).offchainSubmitTransaction(takeObject(arg1));
476
476
  return addHeapObject(ret);
477
477
  };
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.9.1-3",
4
+ "version": "0.9.1-5",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",