@ocap/resolver 1.19.19 → 1.19.21

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 +9 -12
  2. package/package.json +12 -12
package/lib/index.js CHANGED
@@ -822,11 +822,11 @@ module.exports = class OCAPResolver {
822
822
  if (!info) {
823
823
  const state = chainState.create({ ...this.config, address: CHAIN_ADDR }, context);
824
824
  const result = await chainDB.create(CHAIN_ADDR, state, { txn });
825
- this.logger.info('create chain state', { result });
825
+ this.logger.debug('create chain state', { result });
826
826
  } else if (isEqual(pick(info, Object.keys(this.config)), this.config) === false) {
827
827
  const state = chainState.update(info, this.config, context);
828
828
  const result = await chainDB.update(CHAIN_ADDR, state, { txn });
829
- this.logger.info('update chain state', { result });
829
+ this.logger.debug('update chain state', { result });
830
830
  }
831
831
  });
832
832
 
@@ -839,7 +839,7 @@ module.exports = class OCAPResolver {
839
839
  const state = tokenState.create(this.tokenItx, context);
840
840
  const result = await tokenDB.create(this.tokenItx.address, state, { txn });
841
841
  tokenDB.emit('create', result, { txn });
842
- this.logger.info('create token state', { address: result?.address });
842
+ this.logger.debug('create token state', { address: result?.address });
843
843
  });
844
844
  }
845
845
 
@@ -857,7 +857,7 @@ module.exports = class OCAPResolver {
857
857
  );
858
858
  const result = await accountDB.create(address, state, { txn });
859
859
  accountDB.emit('create', result, { txn });
860
- this.logger.info('init account done', { address });
860
+ this.logger.debug('create account done', { address });
861
861
  }
862
862
  } catch (err) {
863
863
  this.logger.error('Failed to initialize initial token holders', err);
@@ -878,10 +878,7 @@ module.exports = class OCAPResolver {
878
878
  await hooks.onCreateTx(tx, ctx, this);
879
879
  }
880
880
  } catch (error) {
881
- console.error('create tx index failed', { account: x, error });
882
- } finally {
883
- // eslint-disable-next-line no-console
884
- console.log(x);
881
+ this.logger.error('create tx index failed', { account: x, error });
885
882
  }
886
883
  });
887
884
 
@@ -889,14 +886,14 @@ module.exports = class OCAPResolver {
889
886
  try {
890
887
  await this.indexdb.account.insert(await createIndexedAccount(x, getToken));
891
888
  } catch (error) {
892
- console.error('create account index failed', { account: x, error });
889
+ this.logger.error('create account index failed', { account: x, error });
893
890
  }
894
891
  });
895
892
  this.statedb.account.on('update', async (x) => {
896
893
  try {
897
894
  await this.indexdb.account.update(x.address, await createIndexedAccount(x, getToken));
898
895
  } catch (error) {
899
- console.error('update account index failed', { account: x, error });
896
+ this.logger.error('update account index failed', { account: x, error });
900
897
  }
901
898
  });
902
899
 
@@ -921,7 +918,7 @@ module.exports = class OCAPResolver {
921
918
  await onCreate(doc, ctx, this.indexdb);
922
919
  }
923
920
  } catch (error) {
924
- console.error(`create ${table} index failed`, { [table]: x, error });
921
+ this.logger.error(`create ${table} index failed`, { [table]: x, error });
925
922
  }
926
923
  });
927
924
 
@@ -934,7 +931,7 @@ module.exports = class OCAPResolver {
934
931
  await onUpdate(doc, ctx, this.indexdb);
935
932
  }
936
933
  } catch (error) {
937
- console.error(`update ${table} index failed`, { [table]: x, error });
934
+ this.logger.error(`update ${table} index failed`, { [table]: x, error });
938
935
  }
939
936
  });
940
937
  });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.19.19",
6
+ "version": "1.19.21",
7
7
  "description": "GraphQL resolver built upon ocap statedb and GQL layer",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -22,19 +22,19 @@
22
22
  "jest": "^29.7.0"
23
23
  },
24
24
  "dependencies": {
25
- "@arcblock/did": "1.19.19",
26
- "@arcblock/did-util": "1.19.19",
27
- "@arcblock/validator": "1.19.19",
28
- "@ocap/config": "1.19.19",
29
- "@ocap/indexdb": "1.19.19",
30
- "@ocap/mcrypto": "1.19.19",
31
- "@ocap/message": "1.19.19",
32
- "@ocap/state": "1.19.19",
33
- "@ocap/tx-protocols": "1.19.19",
34
- "@ocap/util": "1.19.19",
25
+ "@arcblock/did": "1.19.21",
26
+ "@arcblock/did-util": "1.19.21",
27
+ "@arcblock/validator": "1.19.21",
28
+ "@ocap/config": "1.19.21",
29
+ "@ocap/indexdb": "1.19.21",
30
+ "@ocap/mcrypto": "1.19.21",
31
+ "@ocap/message": "1.19.21",
32
+ "@ocap/state": "1.19.21",
33
+ "@ocap/tx-protocols": "1.19.21",
34
+ "@ocap/util": "1.19.21",
35
35
  "debug": "^4.3.6",
36
36
  "lodash": "^4.17.21",
37
37
  "queue": "^6"
38
38
  },
39
- "gitHead": "c4c11152b4539443b89acbc0ff79b336e5e1d6be"
39
+ "gitHead": "019c753c8a551a8cd7e8626b3da28d1e2aa5416f"
40
40
  }