@ocap/resolver 1.25.4 → 1.25.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/lib/hooks.js CHANGED
@@ -306,7 +306,7 @@ const onCreateTx = async (tx, ctx, resolver) => {
306
306
  try {
307
307
  await resolver.tokenDistribution.updateByTx(tx, ctx);
308
308
  } catch (e) {
309
- resolver.logger.error('Failed to update token distribution', e);
309
+ resolver.logger.error('Failed to update token distribution', { error: e, tx, ctx });
310
310
  }
311
311
 
312
312
  if (tx.code !== 'OK') {
package/lib/index.js CHANGED
@@ -1213,12 +1213,16 @@ module.exports = class OCAPResolver {
1213
1213
  );
1214
1214
  } else if (typeUrl === 'ClaimStakeTx') {
1215
1215
  const revokeTx = await this.indexdb.tx.get(tx.tx.itxJson.evidence.hash);
1216
- tokens.push(
1217
- ...uniqBy(
1218
- revokeTx.tx.itxJson.outputs.reduce((acc, x) => acc.concat(x.tokens), []),
1219
- 'address'
1220
- ).filter((x) => x.address)
1221
- );
1216
+ if (revokeTx) {
1217
+ tokens.push(
1218
+ ...uniqBy(
1219
+ revokeTx.tx.itxJson.outputs.reduce((acc, x) => acc.concat(x.tokens), []),
1220
+ 'address'
1221
+ ).filter((x) => x.address)
1222
+ );
1223
+ } else {
1224
+ this.logger.warn('Revoke stake tx not found', { tx });
1225
+ }
1222
1226
  } else if (rollupTxs.includes(typeUrl)) {
1223
1227
  const rollup = await this.indexdb.rollup.get(tx.tx.itxJson.rollup);
1224
1228
  tokens.push({ address: rollup.tokenAddress, value: '0' });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.25.4",
6
+ "version": "1.25.5",
7
7
  "description": "GraphQL resolver built upon ocap statedb and GQL layer",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -14,8 +14,8 @@
14
14
  "license": "MIT",
15
15
  "devDependencies": {
16
16
  "jest": "^29.7.0",
17
- "@ocap/indexdb-memory": "1.25.4",
18
- "@ocap/statedb-memory": "1.25.4"
17
+ "@ocap/indexdb-memory": "1.25.5",
18
+ "@ocap/statedb-memory": "1.25.5"
19
19
  },
20
20
  "dependencies": {
21
21
  "@arcblock/nft-display": "^3.1.41",
@@ -23,18 +23,18 @@
23
23
  "express": "^4.19.2",
24
24
  "lodash": "^4.17.21",
25
25
  "queue": "^6",
26
- "@arcblock/did": "1.25.4",
27
- "@arcblock/did-ext": "1.25.4",
28
- "@arcblock/did-util": "1.25.4",
29
- "@arcblock/validator": "1.25.4",
30
- "@ocap/config": "1.25.4",
31
- "@ocap/indexdb": "1.25.4",
32
- "@ocap/mcrypto": "1.25.4",
33
- "@ocap/state": "1.25.4",
34
- "@ocap/tx-protocols": "1.25.4",
35
- "@ocap/message": "1.25.4",
36
- "@ocap/util": "1.25.4",
37
- "@ocap/wallet": "1.25.4"
26
+ "@arcblock/did": "1.25.5",
27
+ "@arcblock/did-ext": "1.25.5",
28
+ "@arcblock/did-util": "1.25.5",
29
+ "@arcblock/validator": "1.25.5",
30
+ "@ocap/config": "1.25.5",
31
+ "@ocap/mcrypto": "1.25.5",
32
+ "@ocap/message": "1.25.5",
33
+ "@ocap/state": "1.25.5",
34
+ "@ocap/tx-protocols": "1.25.5",
35
+ "@ocap/indexdb": "1.25.5",
36
+ "@ocap/util": "1.25.5",
37
+ "@ocap/wallet": "1.25.5"
38
38
  },
39
39
  "scripts": {
40
40
  "lint": "eslint tests lib",