@acala-network/chopsticks-executor 0.9.4-2 → 0.9.4-4

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.
@@ -164,7 +164,53 @@ heap.push(undefined, null, true, false);
164
164
  function getObject(idx) {
165
165
  return heap[idx];
166
166
  }
167
- var WASM_VECTOR_LEN = 0;
167
+ var heap_next = heap.length;
168
+ function dropObject(idx) {
169
+ if (idx < 132) return;
170
+ heap[idx] = heap_next;
171
+ heap_next = idx;
172
+ }
173
+ function takeObject(idx) {
174
+ var ret = getObject(idx);
175
+ dropObject(idx);
176
+ return ret;
177
+ }
178
+ function addHeapObject(obj) {
179
+ if (heap_next === heap.length) heap.push(heap.length + 1);
180
+ var idx = heap_next;
181
+ heap_next = heap[idx];
182
+ heap[idx] = obj;
183
+ return idx;
184
+ }
185
+ function isLikeNone(x) {
186
+ return x === undefined || x === null;
187
+ }
188
+ var cachedFloat64Memory0 = null;
189
+ function getFloat64Memory0() {
190
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
191
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
192
+ }
193
+ return cachedFloat64Memory0;
194
+ }
195
+ var cachedInt32Memory0 = null;
196
+ function getInt32Memory0() {
197
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
198
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
199
+ }
200
+ return cachedInt32Memory0;
201
+ }
202
+ var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", {
203
+ ignoreBOM: true,
204
+ fatal: true
205
+ }) : {
206
+ decode: function() {
207
+ throw Error("TextDecoder not available");
208
+ }
209
+ };
210
+ if (typeof TextDecoder !== "undefined") {
211
+ cachedTextDecoder.decode();
212
+ }
213
+ ;
168
214
  var cachedUint8Memory0 = null;
169
215
  function getUint8Memory0() {
170
216
  if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
@@ -172,6 +218,11 @@ function getUint8Memory0() {
172
218
  }
173
219
  return cachedUint8Memory0;
174
220
  }
221
+ function getStringFromWasm0(ptr, len) {
222
+ ptr = ptr >>> 0;
223
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
224
+ }
225
+ var WASM_VECTOR_LEN = 0;
175
226
  var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : {
176
227
  encode: function() {
177
228
  throw Error("TextEncoder not available");
@@ -216,57 +267,6 @@ function passStringToWasm0(arg, malloc, realloc) {
216
267
  WASM_VECTOR_LEN = offset;
217
268
  return ptr1;
218
269
  }
219
- function isLikeNone(x) {
220
- return x === undefined || x === null;
221
- }
222
- var cachedInt32Memory0 = null;
223
- function getInt32Memory0() {
224
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
225
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
226
- }
227
- return cachedInt32Memory0;
228
- }
229
- var heap_next = heap.length;
230
- function dropObject(idx) {
231
- if (idx < 132) return;
232
- heap[idx] = heap_next;
233
- heap_next = idx;
234
- }
235
- function takeObject(idx) {
236
- var ret = getObject(idx);
237
- dropObject(idx);
238
- return ret;
239
- }
240
- var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", {
241
- ignoreBOM: true,
242
- fatal: true
243
- }) : {
244
- decode: function() {
245
- throw Error("TextDecoder not available");
246
- }
247
- };
248
- if (typeof TextDecoder !== "undefined") {
249
- cachedTextDecoder.decode();
250
- }
251
- ;
252
- function getStringFromWasm0(ptr, len) {
253
- ptr = ptr >>> 0;
254
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
255
- }
256
- function addHeapObject(obj) {
257
- if (heap_next === heap.length) heap.push(heap.length + 1);
258
- var idx = heap_next;
259
- heap_next = heap[idx];
260
- heap[idx] = obj;
261
- return idx;
262
- }
263
- var cachedFloat64Memory0 = null;
264
- function getFloat64Memory0() {
265
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
266
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
267
- }
268
- return cachedFloat64Memory0;
269
- }
270
270
  var cachedBigInt64Memory0 = null;
271
271
  function getBigInt64Memory0() {
272
272
  if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
@@ -397,20 +397,19 @@ function handleError(f, args) {
397
397
  return takeObject(ret);
398
398
  }
399
399
  /**
400
- * @param {any} root_trie_hash
401
- * @param {any} keys
400
+ * @param {any} trie_root_hash
402
401
  * @param {any} nodes
403
402
  * @returns {Promise<any>}
404
- */ export function decode_proof(root_trie_hash, keys, nodes) {
405
- var ret = wasm.decode_proof(addHeapObject(root_trie_hash), addHeapObject(keys), addHeapObject(nodes));
403
+ */ export function decode_proof(trie_root_hash, nodes) {
404
+ var ret = wasm.decode_proof(addHeapObject(trie_root_hash), addHeapObject(nodes));
406
405
  return takeObject(ret);
407
406
  }
408
407
  /**
409
408
  * @param {any} nodes
410
- * @param {any} entries
409
+ * @param {any} updates
411
410
  * @returns {Promise<any>}
412
- */ export function create_proof(nodes, entries) {
413
- var ret = wasm.create_proof(addHeapObject(nodes), addHeapObject(entries));
411
+ */ export function create_proof(nodes, updates) {
412
+ var ret = wasm.create_proof(addHeapObject(nodes), addHeapObject(updates));
414
413
  return takeObject(ret);
415
414
  }
416
415
  /**
@@ -530,33 +529,21 @@ function ___wbg_load() {
530
529
  function __wbg_get_imports() {
531
530
  var imports = {};
532
531
  imports.wbg = {};
533
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
534
- var obj = getObject(arg1);
535
- var ret = typeof obj === "string" ? obj : undefined;
536
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
537
- var len1 = WASM_VECTOR_LEN;
538
- getInt32Memory0()[arg0 / 4 + 1] = len1;
539
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
532
+ imports.wbg.__wbg_getStorage_22c97034e37920e0 = function() {
533
+ return handleError(function(arg0, arg1) {
534
+ var ret = getObject(arg0).getStorage(takeObject(arg1));
535
+ return addHeapObject(ret);
536
+ }, arguments);
540
537
  };
541
538
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
542
539
  takeObject(arg0);
543
540
  };
544
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
545
- var ret = new Error(getStringFromWasm0(arg0, arg1));
546
- return addHeapObject(ret);
547
- };
548
541
  imports.wbg.__wbg_call_53fc3abd42e24ec8 = function() {
549
542
  return handleError(function(arg0, arg1, arg2) {
550
543
  var ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
551
544
  return addHeapObject(ret);
552
545
  }, arguments);
553
546
  };
554
- imports.wbg.__wbg_getStorage_22c97034e37920e0 = function() {
555
- return handleError(function(arg0, arg1) {
556
- var ret = getObject(arg0).getStorage(takeObject(arg1));
557
- return addHeapObject(ret);
558
- }, arguments);
559
- };
560
547
  imports.wbg.__wbg_new_c728d68b8b34487e = function() {
561
548
  var ret = new Object();
562
549
  return addHeapObject(ret);
@@ -611,6 +598,18 @@ function __wbg_get_imports() {
611
598
  var ret = Number.isSafeInteger(getObject(arg0));
612
599
  return ret;
613
600
  };
601
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
602
+ var ret = new Error(getStringFromWasm0(arg0, arg1));
603
+ return addHeapObject(ret);
604
+ };
605
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
606
+ var obj = getObject(arg1);
607
+ var ret = typeof obj === "string" ? obj : undefined;
608
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
609
+ var len1 = WASM_VECTOR_LEN;
610
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
611
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
612
+ };
614
613
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
615
614
  var ret = getStringFromWasm0(arg0, arg1);
616
615
  return addHeapObject(ret);
@@ -897,7 +896,7 @@ function __wbg_get_imports() {
897
896
  imports.wbg.__wbg_warn_4affe1093892a4ef = function(arg0) {
898
897
  console.warn(getObject(arg0));
899
898
  };
900
- imports.wbg.__wbindgen_closure_wrapper1346 = function(arg0, arg1, arg2) {
899
+ imports.wbg.__wbindgen_closure_wrapper1343 = function(arg0, arg1, arg2) {
901
900
  var ret = makeMutClosure(arg0, arg1, 122, __wbg_adapter_46);
902
901
  return addHeapObject(ret);
903
902
  };
@@ -0,0 +1,91 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * @param {any} code
5
+ * @returns {Promise<any>}
6
+ */
7
+ export function get_runtime_version(code: any): Promise<any>;
8
+ /**
9
+ * @param {any} entries
10
+ * @param {any} trie_version
11
+ * @returns {Promise<any>}
12
+ */
13
+ export function calculate_state_root(entries: any, trie_version: any): Promise<any>;
14
+ /**
15
+ * @param {any} trie_root_hash
16
+ * @param {any} nodes
17
+ * @returns {Promise<any>}
18
+ */
19
+ export function decode_proof(trie_root_hash: any, nodes: any): Promise<any>;
20
+ /**
21
+ * @param {any} nodes
22
+ * @param {any} updates
23
+ * @returns {Promise<any>}
24
+ */
25
+ export function create_proof(nodes: any, updates: any): Promise<any>;
26
+ /**
27
+ * @param {any} task
28
+ * @param {JsCallback} js
29
+ * @param {string | undefined} [log_level]
30
+ * @returns {Promise<any>}
31
+ */
32
+ export function run_task(task: any, js: JsCallback, log_level?: string): Promise<any>;
33
+ /**
34
+ * @param {JsCallback} js
35
+ * @param {any} key
36
+ * @returns {Promise<any>}
37
+ */
38
+ export function testing(js: JsCallback, key: any): Promise<any>;
39
+
40
+ type HexString = `0x${string}`;
41
+ export interface JsCallback {
42
+ getStorage: (key: HexString) => Promise<string | undefined>
43
+ getStateRoot: () => Promise<string>
44
+ getNextKey: (prefix: HexString, key: HexString) => Promise<string | undefined>
45
+ offchainGetStorage: (key: HexString) => Promise<string | undefined>
46
+ offchainTimestamp: () => Promise<number>
47
+ offchainRandomSeed: () => Promise<HexString>
48
+ offchainSubmitTransaction: (tx: HexString) => Promise<boolean>
49
+ }
50
+
51
+
52
+
53
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
54
+
55
+ export interface InitOutput {
56
+ readonly memory: WebAssembly.Memory;
57
+ readonly get_runtime_version: (a: number) => number;
58
+ readonly calculate_state_root: (a: number, b: number) => number;
59
+ readonly decode_proof: (a: number, b: number) => number;
60
+ readonly create_proof: (a: number, b: number) => number;
61
+ readonly run_task: (a: number, b: number, c: number, d: number) => number;
62
+ readonly testing: (a: number, b: number) => number;
63
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
64
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
65
+ readonly __wbindgen_export_2: WebAssembly.Table;
66
+ readonly wasm_bindgen__convert__closures__invoke1_mut__h84425a3baffea565: (a: number, b: number, c: number) => void;
67
+ readonly __wbindgen_exn_store: (a: number) => void;
68
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
69
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h59e4ab6c95dba127: (a: number, b: number, c: number, d: number) => void;
70
+ }
71
+
72
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
73
+ /**
74
+ * Instantiates the given `module`, which can either be bytes or
75
+ * a precompiled `WebAssembly.Module`.
76
+ *
77
+ * @param {SyncInitInput} module
78
+ *
79
+ * @returns {InitOutput}
80
+ */
81
+ export function initSync(module: SyncInitInput): InitOutput;
82
+
83
+ /**
84
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
85
+ * for everything else, calls `WebAssembly.instantiate` directly.
86
+ *
87
+ * @param {InitInput | Promise<InitInput>} module_or_path
88
+ *
89
+ * @returns {Promise<InitOutput>}
90
+ */
91
+ export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;