@ocap/resolver 1.24.1 → 1.24.3
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 +5 -3
- package/package.json +15 -15
package/lib/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const pick = require('lodash/pick');
|
|
|
8
8
|
const isEmpty = require('lodash/isEmpty');
|
|
9
9
|
const isEqual = require('lodash/isEqual');
|
|
10
10
|
const uniqBy = require('lodash/unionBy');
|
|
11
|
+
const omit = require('lodash/omit');
|
|
11
12
|
const Config = require('@ocap/config');
|
|
12
13
|
const states = require('@ocap/state');
|
|
13
14
|
const { patterns } = require('@arcblock/validator');
|
|
@@ -853,13 +854,14 @@ module.exports = class OCAPResolver {
|
|
|
853
854
|
await this.runAsLambda(
|
|
854
855
|
async (txn) => {
|
|
855
856
|
const info = await this.statedb.chain.get(CHAIN_ADDR, { txn });
|
|
857
|
+
const config = omit(this.config, ['reservedSymbols']);
|
|
856
858
|
|
|
857
859
|
if (!info) {
|
|
858
|
-
const state = chainState.create({ ...
|
|
860
|
+
const state = chainState.create({ ...config, address: CHAIN_ADDR }, context);
|
|
859
861
|
const result = await chainDB.create(CHAIN_ADDR, state, { txn });
|
|
860
862
|
this.logger.debug('create chain state', { result });
|
|
861
|
-
} else if (isEqual(pick(info, Object.keys(
|
|
862
|
-
const state = chainState.update(info,
|
|
863
|
+
} else if (isEqual(pick(info, Object.keys(config)), config) === false) {
|
|
864
|
+
const state = chainState.update(info, config, context);
|
|
863
865
|
const result = await chainDB.update(CHAIN_ADDR, state, { txn });
|
|
864
866
|
this.logger.debug('update chain state', { result });
|
|
865
867
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.24.
|
|
6
|
+
"version": "1.24.3",
|
|
7
7
|
"description": "GraphQL resolver built upon ocap statedb and GQL layer",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"jest": "^29.7.0",
|
|
17
|
-
"@ocap/indexdb-memory": "1.24.
|
|
18
|
-
"@ocap/statedb-memory": "1.24.
|
|
17
|
+
"@ocap/indexdb-memory": "1.24.3",
|
|
18
|
+
"@ocap/statedb-memory": "1.24.3"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"debug": "^4.3.6",
|
|
22
22
|
"lodash": "^4.17.21",
|
|
23
23
|
"queue": "^6",
|
|
24
|
-
"@arcblock/did": "1.24.
|
|
25
|
-
"@arcblock/did-ext": "1.24.
|
|
26
|
-
"@arcblock/
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@ocap/indexdb": "1.24.
|
|
30
|
-
"@ocap/mcrypto": "1.24.
|
|
31
|
-
"@ocap/message": "1.24.
|
|
32
|
-
"@ocap/state": "1.24.
|
|
33
|
-
"@ocap/tx-protocols": "1.24.
|
|
34
|
-
"@ocap/
|
|
35
|
-
"@ocap/
|
|
24
|
+
"@arcblock/did": "1.24.3",
|
|
25
|
+
"@arcblock/did-ext": "1.24.3",
|
|
26
|
+
"@arcblock/did-util": "1.24.3",
|
|
27
|
+
"@arcblock/validator": "1.24.3",
|
|
28
|
+
"@ocap/config": "1.24.3",
|
|
29
|
+
"@ocap/indexdb": "1.24.3",
|
|
30
|
+
"@ocap/mcrypto": "1.24.3",
|
|
31
|
+
"@ocap/message": "1.24.3",
|
|
32
|
+
"@ocap/state": "1.24.3",
|
|
33
|
+
"@ocap/tx-protocols": "1.24.3",
|
|
34
|
+
"@ocap/util": "1.24.3",
|
|
35
|
+
"@ocap/wallet": "1.24.3"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"lint": "eslint tests lib",
|