@acala-network/chopsticks-executor 0.9.4-3 → 0.9.4-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.
- package/dist/cjs/chopsticks_executor.js +73 -73
- package/dist/cjs/index.d.ts +5 -6
- package/dist/cjs/index.js +3 -3
- package/dist/esm/chopsticks_executor.js +76 -77
- package/dist/esm/index.d.ts +5 -6
- package/dist/esm/index.js +3 -3
- package/package.json +1 -1
|
@@ -200,7 +200,52 @@ heap.push(undefined, null, true, false);
|
|
|
200
200
|
function getObject(idx) {
|
|
201
201
|
return heap[idx];
|
|
202
202
|
}
|
|
203
|
-
var
|
|
203
|
+
var heap_next = heap.length;
|
|
204
|
+
function dropObject(idx) {
|
|
205
|
+
if (idx < 132) return;
|
|
206
|
+
heap[idx] = heap_next;
|
|
207
|
+
heap_next = idx;
|
|
208
|
+
}
|
|
209
|
+
function takeObject(idx) {
|
|
210
|
+
var ret = getObject(idx);
|
|
211
|
+
dropObject(idx);
|
|
212
|
+
return ret;
|
|
213
|
+
}
|
|
214
|
+
function addHeapObject(obj) {
|
|
215
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
216
|
+
var idx = heap_next;
|
|
217
|
+
heap_next = heap[idx];
|
|
218
|
+
heap[idx] = obj;
|
|
219
|
+
return idx;
|
|
220
|
+
}
|
|
221
|
+
function isLikeNone(x) {
|
|
222
|
+
return x === undefined || x === null;
|
|
223
|
+
}
|
|
224
|
+
var cachedFloat64Memory0 = null;
|
|
225
|
+
function getFloat64Memory0() {
|
|
226
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
227
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
228
|
+
}
|
|
229
|
+
return cachedFloat64Memory0;
|
|
230
|
+
}
|
|
231
|
+
var cachedInt32Memory0 = null;
|
|
232
|
+
function getInt32Memory0() {
|
|
233
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
234
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
235
|
+
}
|
|
236
|
+
return cachedInt32Memory0;
|
|
237
|
+
}
|
|
238
|
+
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", {
|
|
239
|
+
ignoreBOM: true,
|
|
240
|
+
fatal: true
|
|
241
|
+
}) : {
|
|
242
|
+
decode: function() {
|
|
243
|
+
throw Error("TextDecoder not available");
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
if (typeof TextDecoder !== "undefined") {
|
|
247
|
+
cachedTextDecoder.decode();
|
|
248
|
+
}
|
|
204
249
|
var cachedUint8Memory0 = null;
|
|
205
250
|
function getUint8Memory0() {
|
|
206
251
|
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
@@ -208,6 +253,11 @@ function getUint8Memory0() {
|
|
|
208
253
|
}
|
|
209
254
|
return cachedUint8Memory0;
|
|
210
255
|
}
|
|
256
|
+
function getStringFromWasm0(ptr, len) {
|
|
257
|
+
ptr = ptr >>> 0;
|
|
258
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
259
|
+
}
|
|
260
|
+
var WASM_VECTOR_LEN = 0;
|
|
211
261
|
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : {
|
|
212
262
|
encode: function() {
|
|
213
263
|
throw Error("TextEncoder not available");
|
|
@@ -252,56 +302,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
252
302
|
WASM_VECTOR_LEN = offset;
|
|
253
303
|
return ptr1;
|
|
254
304
|
}
|
|
255
|
-
function isLikeNone(x) {
|
|
256
|
-
return x === undefined || x === null;
|
|
257
|
-
}
|
|
258
|
-
var cachedInt32Memory0 = null;
|
|
259
|
-
function getInt32Memory0() {
|
|
260
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
261
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
262
|
-
}
|
|
263
|
-
return cachedInt32Memory0;
|
|
264
|
-
}
|
|
265
|
-
var heap_next = heap.length;
|
|
266
|
-
function dropObject(idx) {
|
|
267
|
-
if (idx < 132) return;
|
|
268
|
-
heap[idx] = heap_next;
|
|
269
|
-
heap_next = idx;
|
|
270
|
-
}
|
|
271
|
-
function takeObject(idx) {
|
|
272
|
-
var ret = getObject(idx);
|
|
273
|
-
dropObject(idx);
|
|
274
|
-
return ret;
|
|
275
|
-
}
|
|
276
|
-
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", {
|
|
277
|
-
ignoreBOM: true,
|
|
278
|
-
fatal: true
|
|
279
|
-
}) : {
|
|
280
|
-
decode: function() {
|
|
281
|
-
throw Error("TextDecoder not available");
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
if (typeof TextDecoder !== "undefined") {
|
|
285
|
-
cachedTextDecoder.decode();
|
|
286
|
-
}
|
|
287
|
-
function getStringFromWasm0(ptr, len) {
|
|
288
|
-
ptr = ptr >>> 0;
|
|
289
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
290
|
-
}
|
|
291
|
-
function addHeapObject(obj) {
|
|
292
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
293
|
-
var idx = heap_next;
|
|
294
|
-
heap_next = heap[idx];
|
|
295
|
-
heap[idx] = obj;
|
|
296
|
-
return idx;
|
|
297
|
-
}
|
|
298
|
-
var cachedFloat64Memory0 = null;
|
|
299
|
-
function getFloat64Memory0() {
|
|
300
|
-
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
301
|
-
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
302
|
-
}
|
|
303
|
-
return cachedFloat64Memory0;
|
|
304
|
-
}
|
|
305
305
|
var cachedBigInt64Memory0 = null;
|
|
306
306
|
function getBigInt64Memory0() {
|
|
307
307
|
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
|
|
@@ -424,12 +424,12 @@ function calculate_state_root(entries, trie_version) {
|
|
|
424
424
|
var ret = wasm.calculate_state_root(addHeapObject(entries), addHeapObject(trie_version));
|
|
425
425
|
return takeObject(ret);
|
|
426
426
|
}
|
|
427
|
-
function decode_proof(
|
|
428
|
-
var ret = wasm.decode_proof(addHeapObject(
|
|
427
|
+
function decode_proof(trie_root_hash, nodes) {
|
|
428
|
+
var ret = wasm.decode_proof(addHeapObject(trie_root_hash), addHeapObject(nodes));
|
|
429
429
|
return takeObject(ret);
|
|
430
430
|
}
|
|
431
|
-
function create_proof(nodes,
|
|
432
|
-
var ret = wasm.create_proof(addHeapObject(nodes), addHeapObject(
|
|
431
|
+
function create_proof(nodes, updates) {
|
|
432
|
+
var ret = wasm.create_proof(addHeapObject(nodes), addHeapObject(updates));
|
|
433
433
|
return takeObject(ret);
|
|
434
434
|
}
|
|
435
435
|
function run_task(task, js, log_level) {
|
|
@@ -540,33 +540,21 @@ function ___wbg_load() {
|
|
|
540
540
|
function __wbg_get_imports() {
|
|
541
541
|
var imports = {};
|
|
542
542
|
imports.wbg = {};
|
|
543
|
-
imports.wbg.
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
549
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
543
|
+
imports.wbg.__wbg_getStorage_22c97034e37920e0 = function() {
|
|
544
|
+
return handleError(function(arg0, arg1) {
|
|
545
|
+
var ret = getObject(arg0).getStorage(takeObject(arg1));
|
|
546
|
+
return addHeapObject(ret);
|
|
547
|
+
}, arguments);
|
|
550
548
|
};
|
|
551
549
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
552
550
|
takeObject(arg0);
|
|
553
551
|
};
|
|
554
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
555
|
-
var ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
556
|
-
return addHeapObject(ret);
|
|
557
|
-
};
|
|
558
552
|
imports.wbg.__wbg_call_53fc3abd42e24ec8 = function() {
|
|
559
553
|
return handleError(function(arg0, arg1, arg2) {
|
|
560
554
|
var ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
561
555
|
return addHeapObject(ret);
|
|
562
556
|
}, arguments);
|
|
563
557
|
};
|
|
564
|
-
imports.wbg.__wbg_getStorage_22c97034e37920e0 = function() {
|
|
565
|
-
return handleError(function(arg0, arg1) {
|
|
566
|
-
var ret = getObject(arg0).getStorage(takeObject(arg1));
|
|
567
|
-
return addHeapObject(ret);
|
|
568
|
-
}, arguments);
|
|
569
|
-
};
|
|
570
558
|
imports.wbg.__wbg_new_c728d68b8b34487e = function() {
|
|
571
559
|
var ret = new Object();
|
|
572
560
|
return addHeapObject(ret);
|
|
@@ -621,6 +609,18 @@ function __wbg_get_imports() {
|
|
|
621
609
|
var ret = Number.isSafeInteger(getObject(arg0));
|
|
622
610
|
return ret;
|
|
623
611
|
};
|
|
612
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
613
|
+
var ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
614
|
+
return addHeapObject(ret);
|
|
615
|
+
};
|
|
616
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
617
|
+
var obj = getObject(arg1);
|
|
618
|
+
var ret = typeof obj === "string" ? obj : undefined;
|
|
619
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
620
|
+
var len1 = WASM_VECTOR_LEN;
|
|
621
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
622
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
623
|
+
};
|
|
624
624
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
625
625
|
var ret = getStringFromWasm0(arg0, arg1);
|
|
626
626
|
return addHeapObject(ret);
|
|
@@ -907,7 +907,7 @@ function __wbg_get_imports() {
|
|
|
907
907
|
imports.wbg.__wbg_warn_4affe1093892a4ef = function(arg0) {
|
|
908
908
|
console.warn(getObject(arg0));
|
|
909
909
|
};
|
|
910
|
-
imports.wbg.
|
|
910
|
+
imports.wbg.__wbindgen_closure_wrapper1343 = function(arg0, arg1, arg2) {
|
|
911
911
|
var ret = makeMutClosure(arg0, arg1, 122, __wbg_adapter_46);
|
|
912
912
|
return addHeapObject(ret);
|
|
913
913
|
};
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -12,18 +12,17 @@ export function get_runtime_version(code: any): Promise<any>;
|
|
|
12
12
|
*/
|
|
13
13
|
export function calculate_state_root(entries: any, trie_version: any): Promise<any>;
|
|
14
14
|
/**
|
|
15
|
-
* @param {any}
|
|
16
|
-
* @param {any} keys
|
|
15
|
+
* @param {any} trie_root_hash
|
|
17
16
|
* @param {any} nodes
|
|
18
17
|
* @returns {Promise<any>}
|
|
19
18
|
*/
|
|
20
|
-
export function decode_proof(
|
|
19
|
+
export function decode_proof(trie_root_hash: any, nodes: any): Promise<any>;
|
|
21
20
|
/**
|
|
22
21
|
* @param {any} nodes
|
|
23
|
-
* @param {any}
|
|
22
|
+
* @param {any} updates
|
|
24
23
|
* @returns {Promise<any>}
|
|
25
24
|
*/
|
|
26
|
-
export function create_proof(nodes: any,
|
|
25
|
+
export function create_proof(nodes: any, updates: any): Promise<any>;
|
|
27
26
|
/**
|
|
28
27
|
* @param {any} task
|
|
29
28
|
* @param {JsCallback} js
|
|
@@ -57,7 +56,7 @@ export interface InitOutput {
|
|
|
57
56
|
readonly memory: WebAssembly.Memory;
|
|
58
57
|
readonly get_runtime_version: (a: number) => number;
|
|
59
58
|
readonly calculate_state_root: (a: number, b: number) => number;
|
|
60
|
-
readonly decode_proof: (a: number, b: number
|
|
59
|
+
readonly decode_proof: (a: number, b: number) => number;
|
|
61
60
|
readonly create_proof: (a: number, b: number) => number;
|
|
62
61
|
readonly run_task: (a: number, b: number, c: number, d: number) => number;
|
|
63
62
|
readonly testing: (a: number, b: number) => number;
|