@ocap/state 1.18.154 → 1.18.155

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.
@@ -80,6 +80,14 @@ class Blacklist {
80
80
  return false;
81
81
  }
82
82
 
83
+ async getTrustedAccountConfig(address) {
84
+ if (typeof this.getTrustedAccounts === 'function') {
85
+ const trustedAccounts = await this.getTrustedAccounts();
86
+ return trustedAccounts.find((x) => isSameDid(x.address, address));
87
+ }
88
+ return null;
89
+ }
90
+
83
91
  dump() {
84
92
  try {
85
93
  const exported = this.filter.saveAsJSON();
package/lib/states/tx.js CHANGED
@@ -437,12 +437,18 @@ const getMigrateReceipts = (tx, { fromState }) => {
437
437
  if (!fromState?.tokens) return [];
438
438
  if (!tx.itxJson?.address) return [];
439
439
 
440
- return [
441
- {
442
- address: tx.itxJson.address,
443
- changes: fromState.tokens.map((x) => ({ target: x.address, action: 'migrate', value: x.value })),
444
- },
445
- ];
440
+ const changes = fromState.tokens
441
+ .filter((x) => x.value && x.value !== '0')
442
+ .map((x) => ({ target: x.address, action: 'migrate', value: x.value }));
443
+
444
+ return changes.length
445
+ ? [
446
+ {
447
+ address: tx.itxJson.address,
448
+ changes,
449
+ },
450
+ ]
451
+ : [];
446
452
  };
447
453
 
448
454
  const getDeclareReceipts = (tx, { config, time }) => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.18.154",
6
+ "version": "1.18.155",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,13 +18,13 @@
18
18
  "coverage": "start-server-and-test start http://127.0.0.1:4001 test:ci"
19
19
  },
20
20
  "dependencies": {
21
- "@arcblock/did": "1.18.154",
22
- "@arcblock/validator": "1.18.154",
23
- "@ocap/contract": "1.18.154",
24
- "@ocap/mcrypto": "1.18.154",
25
- "@ocap/message": "1.18.154",
26
- "@ocap/util": "1.18.154",
27
- "@ocap/wallet": "1.18.154",
21
+ "@arcblock/did": "1.18.155",
22
+ "@arcblock/validator": "1.18.155",
23
+ "@ocap/contract": "1.18.155",
24
+ "@ocap/mcrypto": "1.18.155",
25
+ "@ocap/message": "1.18.155",
26
+ "@ocap/util": "1.18.155",
27
+ "@ocap/wallet": "1.18.155",
28
28
  "bloom-filters": "^1.3.9",
29
29
  "lodash": "^4.17.21"
30
30
  },
@@ -35,5 +35,5 @@
35
35
  "keywords": [],
36
36
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
37
37
  "license": "MIT",
38
- "gitHead": "414d4207886905fca9529912a12a3b6b8c811886"
38
+ "gitHead": "3d0a23a37564c89d4cf8f374823835efdb6eb24b"
39
39
  }