@abtnode/core 1.7.27 → 1.8.0

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.
@@ -708,7 +708,7 @@ class BlockletManager extends BaseBlockletManager {
708
708
 
709
709
  if (!attachRuntimeInfo) {
710
710
  try {
711
- const blocklet = await this.ensureBlocklet(did);
711
+ const blocklet = await this.ensureBlocklet(did, { throwOnNotExist: false });
712
712
  return blocklet;
713
713
  } catch (e) {
714
714
  logger.error('get blocklet detail error', { error: e.message });
@@ -1230,14 +1230,17 @@ class BlockletManager extends BaseBlockletManager {
1230
1230
  return rootBlocklet;
1231
1231
  }
1232
1232
 
1233
- async ensureBlocklet(did, { e2eMode = false, validateEnv = true } = {}) {
1233
+ async ensureBlocklet(did, { e2eMode = false, validateEnv = true, throwOnNotExist = true } = {}) {
1234
1234
  if (!isValidDid(did)) {
1235
1235
  throw new Error(`Blocklet did is invalid: ${did}`);
1236
1236
  }
1237
1237
 
1238
1238
  const blocklet = await states.blocklet.getBlocklet(did);
1239
1239
  if (!blocklet) {
1240
- throw new Error(`Can not find blocklet in database by did ${did}`);
1240
+ if (throwOnNotExist) {
1241
+ throw new Error(`Can not find blocklet in database by did ${did}`);
1242
+ }
1243
+ return null;
1241
1244
  }
1242
1245
 
1243
1246
  // app settings
@@ -1339,7 +1342,12 @@ class BlockletManager extends BaseBlockletManager {
1339
1342
  }
1340
1343
 
1341
1344
  try {
1342
- let blocklet = await this.ensureBlocklet(did);
1345
+ let blocklet = await this.ensureBlocklet(did, { throwOnNotExist: false });
1346
+
1347
+ if (!blocklet) {
1348
+ return null;
1349
+ }
1350
+
1343
1351
  const fromCache = !!cachedBlocklet;
1344
1352
 
1345
1353
  // if from cached data, only use cache data of runtime info (engine, diskInfo, runtimeInfo...)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.7.27",
6
+ "version": "1.8.0",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,17 +19,17 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@abtnode/certificate-manager": "1.7.27",
23
- "@abtnode/constant": "1.7.27",
24
- "@abtnode/cron": "1.7.27",
25
- "@abtnode/db": "1.7.27",
26
- "@abtnode/logger": "1.7.27",
27
- "@abtnode/queue": "1.7.27",
28
- "@abtnode/rbac": "1.7.27",
29
- "@abtnode/router-provider": "1.7.27",
30
- "@abtnode/static-server": "1.7.27",
31
- "@abtnode/timemachine": "1.7.27",
32
- "@abtnode/util": "1.7.27",
22
+ "@abtnode/certificate-manager": "1.8.0",
23
+ "@abtnode/constant": "1.8.0",
24
+ "@abtnode/cron": "1.8.0",
25
+ "@abtnode/db": "1.8.0",
26
+ "@abtnode/logger": "1.8.0",
27
+ "@abtnode/queue": "1.8.0",
28
+ "@abtnode/rbac": "1.8.0",
29
+ "@abtnode/router-provider": "1.8.0",
30
+ "@abtnode/static-server": "1.8.0",
31
+ "@abtnode/timemachine": "1.8.0",
32
+ "@abtnode/util": "1.8.0",
33
33
  "@arcblock/did": "1.17.0",
34
34
  "@arcblock/did-motif": "^1.1.10",
35
35
  "@arcblock/did-util": "1.17.0",
@@ -37,7 +37,7 @@
37
37
  "@arcblock/jwt": "^1.17.0",
38
38
  "@arcblock/pm2-events": "^0.0.5",
39
39
  "@arcblock/vc": "1.17.0",
40
- "@blocklet/meta": "1.7.27",
40
+ "@blocklet/meta": "1.8.0",
41
41
  "@fidm/x509": "^1.2.1",
42
42
  "@nedb/core": "^1.2.2",
43
43
  "@nedb/multi": "^1.2.2",
@@ -81,5 +81,5 @@
81
81
  "express": "^4.17.1",
82
82
  "jest": "^27.4.5"
83
83
  },
84
- "gitHead": "81a5492df66389b0aede13f033d1e493450833bc"
84
+ "gitHead": "6446a85fb33721abc24bb1045d59158e6b96c241"
85
85
  }