@ocap/resolver 1.18.151 → 1.18.152

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/index.js CHANGED
@@ -190,8 +190,6 @@ module.exports = class OCAPResolver {
190
190
  }
191
191
  }
192
192
 
193
- this.buildMigrationChain();
194
-
195
193
  this.executor = createExecutor({
196
194
  filter,
197
195
  runAsLambda: typeof statedb.runAsLambda === 'function' ? statedb.runAsLambda.bind(statedb) : null,
@@ -978,7 +976,7 @@ module.exports = class OCAPResolver {
978
976
  }
979
977
 
980
978
  // https://github.com/blocklet/abt-wallet/issues/681
981
- if (typeUrl === 'fg:t:deposit_token') {
979
+ if (typeUrl === 'fg:t:deposit_token' || typeUrl === 'fg:t:withdraw_token') {
982
980
  tx.receipts = getTxReceipts(tx, { config: this.config });
983
981
  }
984
982
 
@@ -1172,6 +1170,14 @@ module.exports = class OCAPResolver {
1172
1170
  this.migrationChain = migrationChain;
1173
1171
  }
1174
1172
 
1173
+ async getMigrationChain() {
1174
+ if (!this.migrationChain) {
1175
+ await this.buildMigrationChain();
1176
+ }
1177
+
1178
+ return this.migrationChain;
1179
+ }
1180
+
1175
1181
  /** fix accounts field of legacy approve_withdraw transactions in indexdb */
1176
1182
  async fixApproveWithdrawAccounts() {
1177
1183
  const approveWithdrawTxs = await this._getAllResults('transactions', (paging) =>
package/lib/token-flow.js CHANGED
@@ -127,7 +127,7 @@ const getVaultAccounts = (config) => {
127
127
  };
128
128
 
129
129
  const fixMigrateReceipts = async ({ accountAddress, tx }, resolver) => {
130
- const { migrationChain } = resolver;
130
+ const migrationChain = await resolver.getMigrationChain();
131
131
  const address = migrationChain.findAddressAtTime(accountAddress, new Date(tx.time));
132
132
  const migrations = migrationChain.getMigrationHistory(accountAddress);
133
133
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.18.151",
6
+ "version": "1.18.152",
7
7
  "description": "GraphQL resolver built upon ocap statedb and GQL layer",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -22,18 +22,18 @@
22
22
  "jest": "^29.7.0"
23
23
  },
24
24
  "dependencies": {
25
- "@arcblock/did": "1.18.151",
26
- "@arcblock/did-util": "1.18.151",
27
- "@arcblock/validator": "1.18.151",
28
- "@ocap/config": "1.18.151",
29
- "@ocap/indexdb": "1.18.151",
30
- "@ocap/mcrypto": "1.18.151",
31
- "@ocap/message": "1.18.151",
32
- "@ocap/state": "1.18.151",
33
- "@ocap/tx-protocols": "1.18.151",
34
- "@ocap/util": "1.18.151",
25
+ "@arcblock/did": "1.18.152",
26
+ "@arcblock/did-util": "1.18.152",
27
+ "@arcblock/validator": "1.18.152",
28
+ "@ocap/config": "1.18.152",
29
+ "@ocap/indexdb": "1.18.152",
30
+ "@ocap/mcrypto": "1.18.152",
31
+ "@ocap/message": "1.18.152",
32
+ "@ocap/state": "1.18.152",
33
+ "@ocap/tx-protocols": "1.18.152",
34
+ "@ocap/util": "1.18.152",
35
35
  "debug": "^4.3.6",
36
36
  "lodash": "^4.17.21"
37
37
  },
38
- "gitHead": "ad9f0a1c3913c304a716247de283be2146b7105e"
38
+ "gitHead": "4f31d06aa2a15b57a7d00fdec6241376f10ee873"
39
39
  }