@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
|
@@ -164,7 +164,53 @@ heap.push(undefined, null, true, false);
|
|
|
164
164
|
function getObject(idx) {
|
|
165
165
|
return heap[idx];
|
|
166
166
|
}
|
|
167
|
-
var
|
|
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}
|
|
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(
|
|
405
|
-
var ret = wasm.decode_proof(addHeapObject(
|
|
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}
|
|
409
|
+
* @param {any} updates
|
|
411
410
|
* @returns {Promise<any>}
|
|
412
|
-
*/ export function create_proof(nodes,
|
|
413
|
-
var ret = wasm.create_proof(addHeapObject(nodes), addHeapObject(
|
|
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.
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
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.
|
|
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
|
};
|
package/dist/esm/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;
|