@ocap/resolver 1.24.0 → 1.24.2

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.
Files changed (2) hide show
  1. package/lib/index.js +5 -3
  2. 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({ ...this.config, address: CHAIN_ADDR }, context);
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(this.config)), this.config) === false) {
862
- const state = chainState.update(info, this.config, context);
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.0",
6
+ "version": "1.24.2",
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.0",
18
- "@ocap/statedb-memory": "1.24.0"
17
+ "@ocap/indexdb-memory": "1.24.2",
18
+ "@ocap/statedb-memory": "1.24.2"
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.0",
25
- "@arcblock/did-ext": "1.24.0",
26
- "@arcblock/did-util": "1.24.0",
27
- "@arcblock/validator": "1.24.0",
28
- "@ocap/config": "1.24.0",
29
- "@ocap/indexdb": "1.24.0",
30
- "@ocap/mcrypto": "1.24.0",
31
- "@ocap/message": "1.24.0",
32
- "@ocap/state": "1.24.0",
33
- "@ocap/tx-protocols": "1.24.0",
34
- "@ocap/util": "1.24.0",
35
- "@ocap/wallet": "1.24.0"
24
+ "@arcblock/did": "1.24.2",
25
+ "@arcblock/did-ext": "1.24.2",
26
+ "@arcblock/did-util": "1.24.2",
27
+ "@arcblock/validator": "1.24.2",
28
+ "@ocap/indexdb": "1.24.2",
29
+ "@ocap/mcrypto": "1.24.2",
30
+ "@ocap/message": "1.24.2",
31
+ "@ocap/state": "1.24.2",
32
+ "@ocap/tx-protocols": "1.24.2",
33
+ "@ocap/config": "1.24.2",
34
+ "@ocap/util": "1.24.2",
35
+ "@ocap/wallet": "1.24.2"
36
36
  },
37
37
  "scripts": {
38
38
  "lint": "eslint tests lib",