@acala-network/chopsticks-core 1.0.4 → 1.0.5-1

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.
@@ -135,20 +135,23 @@ const createProof = async (nodes, updates)=>{
135
135
  nodes: newNodes
136
136
  };
137
137
  };
138
+ let nextTaskId = 0;
138
139
  const runTask = async (task, callback = emptyTaskHandler)=>{
140
+ const taskId = nextTaskId++;
139
141
  const task2 = {
140
142
  ...task,
143
+ id: taskId,
141
144
  storageProofSize: task.storageProofSize ?? 0
142
145
  };
143
146
  const worker = await getWorker();
144
- logger.trace((0, _logger.truncate)(task2), 'taskRun');
147
+ logger.trace((0, _logger.truncate)(task2), `runTask #${taskId}`);
145
148
  const response = await worker.remote.runTask(task2, _comlink.proxy(callback));
146
149
  if ('Call' in response) {
147
- logger.trace((0, _logger.truncate)(response.Call), 'taskResponse');
150
+ logger.trace((0, _logger.truncate)(response.Call), `taskResponse #${taskId}`);
148
151
  } else {
149
152
  logger.trace({
150
153
  response
151
- }, 'taskResponse');
154
+ }, `taskResponse ${taskId}`);
152
155
  }
153
156
  return response;
154
157
  };
@@ -48,20 +48,23 @@ export const createProof = async (nodes, updates)=>{
48
48
  nodes: newNodes
49
49
  };
50
50
  };
51
+ let nextTaskId = 0;
51
52
  export const runTask = async (task, callback = emptyTaskHandler)=>{
53
+ const taskId = nextTaskId++;
52
54
  const task2 = {
53
55
  ...task,
56
+ id: taskId,
54
57
  storageProofSize: task.storageProofSize ?? 0
55
58
  };
56
59
  const worker = await getWorker();
57
- logger.trace(truncate(task2), 'taskRun');
60
+ logger.trace(truncate(task2), `runTask #${taskId}`);
58
61
  const response = await worker.remote.runTask(task2, Comlink.proxy(callback));
59
62
  if ('Call' in response) {
60
- logger.trace(truncate(response.Call), 'taskResponse');
63
+ logger.trace(truncate(response.Call), `taskResponse #${taskId}`);
61
64
  } else {
62
65
  logger.trace({
63
66
  response
64
- }, 'taskResponse');
67
+ }, `taskResponse ${taskId}`);
65
68
  }
66
69
  return response;
67
70
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-core",
3
- "version": "1.0.4",
3
+ "version": "1.0.5-1",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -14,7 +14,7 @@
14
14
  "depcheck": "npx depcheck"
15
15
  },
16
16
  "dependencies": {
17
- "@acala-network/chopsticks-executor": "1.0.4",
17
+ "@acala-network/chopsticks-executor": "1.0.5-1",
18
18
  "@polkadot/rpc-provider": "^15.7.1",
19
19
  "@polkadot/types": "^15.7.1",
20
20
  "@polkadot/types-codec": "^15.7.1",