@acala-network/chopsticks-core 0.9.2-6 → 0.9.2

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.
@@ -46,24 +46,19 @@ function _interop_require_wildcard(obj, nodeInterop) {
46
46
  return newObj;
47
47
  }
48
48
  const getRuntimeVersion = async (code)=>{
49
- await _chopsticksexecutor.wasmReady;
50
49
  return _chopsticksexecutor.get_runtime_version(code);
51
50
  };
52
51
  // trie_version: 0 for old trie, 1 for new trie
53
52
  const calculateStateRoot = async (entries, trie_version)=>{
54
- await _chopsticksexecutor.wasmReady;
55
53
  return _chopsticksexecutor.calculate_state_root(entries, trie_version);
56
54
  };
57
55
  const decodeProof = async (trieRootHash, keys, nodes)=>{
58
- await _chopsticksexecutor.wasmReady;
59
56
  return _chopsticksexecutor.decode_proof(trieRootHash, keys, nodes);
60
57
  };
61
58
  const createProof = async (nodes, entries)=>{
62
- await _chopsticksexecutor.wasmReady;
63
59
  return _chopsticksexecutor.create_proof(nodes, entries);
64
60
  };
65
61
  const runTask = async (task, callback)=>{
66
- await _chopsticksexecutor.wasmReady;
67
62
  return _chopsticksexecutor.run_task(task, callback, 'info');
68
63
  };
69
64
  const wasmExecutor = {
@@ -53,24 +53,19 @@ function _interop_require_wildcard(obj, nodeInterop) {
53
53
  return newObj;
54
54
  }
55
55
  const getRuntimeVersion = async (code)=>{
56
- await _chopsticksexecutor.wasmReady;
57
56
  return _chopsticksexecutor.get_runtime_version(code);
58
57
  };
59
58
  // trie_version: 0 for old trie, 1 for new trie
60
59
  const calculateStateRoot = async (entries, trie_version)=>{
61
- await _chopsticksexecutor.wasmReady;
62
60
  return _chopsticksexecutor.calculate_state_root(entries, trie_version);
63
61
  };
64
62
  const decodeProof = async (trieRootHash, keys, nodes)=>{
65
- await _chopsticksexecutor.wasmReady;
66
63
  return _chopsticksexecutor.decode_proof(trieRootHash, keys, nodes);
67
64
  };
68
65
  const createProof = async (nodes, entries)=>{
69
- await _chopsticksexecutor.wasmReady;
70
66
  return _chopsticksexecutor.create_proof(nodes, entries);
71
67
  };
72
68
  const runTask = async (task, callback)=>{
73
- await _chopsticksexecutor.wasmReady;
74
69
  return _chopsticksexecutor.run_task(task, callback, process.env.RUST_LOG);
75
70
  };
76
71
  const wasmExecutor = {
@@ -1,24 +1,19 @@
1
1
  import * as Comlink from 'comlink';
2
2
  import * as pkg from '@acala-network/chopsticks-executor';
3
3
  const getRuntimeVersion = async (code)=>{
4
- await pkg.wasmReady;
5
4
  return pkg.get_runtime_version(code);
6
5
  };
7
6
  // trie_version: 0 for old trie, 1 for new trie
8
7
  const calculateStateRoot = async (entries, trie_version)=>{
9
- await pkg.wasmReady;
10
8
  return pkg.calculate_state_root(entries, trie_version);
11
9
  };
12
10
  const decodeProof = async (trieRootHash, keys, nodes)=>{
13
- await pkg.wasmReady;
14
11
  return pkg.decode_proof(trieRootHash, keys, nodes);
15
12
  };
16
13
  const createProof = async (nodes, entries)=>{
17
- await pkg.wasmReady;
18
14
  return pkg.create_proof(nodes, entries);
19
15
  };
20
16
  const runTask = async (task, callback)=>{
21
- await pkg.wasmReady;
22
17
  return pkg.run_task(task, callback, 'info');
23
18
  };
24
19
  const wasmExecutor = {
@@ -3,24 +3,19 @@ import * as pkg from '@acala-network/chopsticks-executor';
3
3
  import { parentPort } from 'node:worker_threads';
4
4
  import nodeEndpoint from 'comlink/dist/umd/node-adapter.js';
5
5
  const getRuntimeVersion = async (code)=>{
6
- await pkg.wasmReady;
7
6
  return pkg.get_runtime_version(code);
8
7
  };
9
8
  // trie_version: 0 for old trie, 1 for new trie
10
9
  const calculateStateRoot = async (entries, trie_version)=>{
11
- await pkg.wasmReady;
12
10
  return pkg.calculate_state_root(entries, trie_version);
13
11
  };
14
12
  const decodeProof = async (trieRootHash, keys, nodes)=>{
15
- await pkg.wasmReady;
16
13
  return pkg.decode_proof(trieRootHash, keys, nodes);
17
14
  };
18
15
  const createProof = async (nodes, entries)=>{
19
- await pkg.wasmReady;
20
16
  return pkg.create_proof(nodes, entries);
21
17
  };
22
18
  const runTask = async (task, callback)=>{
23
- await pkg.wasmReady;
24
19
  return pkg.run_task(task, callback, process.env.RUST_LOG);
25
20
  };
26
21
  const wasmExecutor = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-core",
3
- "version": "0.9.2-6",
3
+ "version": "0.9.2",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -13,8 +13,13 @@
13
13
  "docs:prep": "typedoc"
14
14
  },
15
15
  "dependencies": {
16
- "@acala-network/chopsticks-executor": "0.9.2-6",
16
+ "@acala-network/chopsticks-executor": "0.9.2",
17
17
  "@polkadot/api": "^10.10.1",
18
+ "@polkadot/rpc-provider": "^10.10.1",
19
+ "@polkadot/types": "^10.10.1",
20
+ "@polkadot/types-codec": "^10.10.1",
21
+ "@polkadot/types-known": "^10.10.1",
22
+ "@polkadot/util": "^12.5.1",
18
23
  "@polkadot/util-crypto": "^12.5.1",
19
24
  "comlink": "^4.4.1",
20
25
  "eventemitter3": "^5.0.1",
@@ -22,13 +27,15 @@
22
27
  "lru-cache": "^10.0.1",
23
28
  "pino": "^8.16.1",
24
29
  "pino-pretty": "^10.2.3",
30
+ "rxjs": "^7.8.1",
25
31
  "zod": "^3.22.4"
26
32
  },
27
33
  "devDependencies": {
28
34
  "@swc/cli": "0.1.62",
29
35
  "@swc/core": "^1.3.96",
30
36
  "@types/lodash": "^4.14.201",
31
- "typescript": "^5.2.2"
37
+ "typescript": "^5.2.2",
38
+ "vitest": "^0.34.6"
32
39
  },
33
40
  "files": [
34
41
  "dist/esm/**",