@ocap/resolver 1.19.20 → 1.20.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.
- package/lib/index.js +9 -12
- 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
6
|
+
"version": "1.20.0",
|
|
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.
|
|
26
|
-
"@arcblock/did-util": "1.
|
|
27
|
-
"@arcblock/validator": "1.
|
|
28
|
-
"@ocap/config": "1.
|
|
29
|
-
"@ocap/indexdb": "1.
|
|
30
|
-
"@ocap/mcrypto": "1.
|
|
31
|
-
"@ocap/message": "1.
|
|
32
|
-
"@ocap/state": "1.
|
|
33
|
-
"@ocap/tx-protocols": "1.
|
|
34
|
-
"@ocap/util": "1.
|
|
25
|
+
"@arcblock/did": "1.20.0",
|
|
26
|
+
"@arcblock/did-util": "1.20.0",
|
|
27
|
+
"@arcblock/validator": "1.20.0",
|
|
28
|
+
"@ocap/config": "1.20.0",
|
|
29
|
+
"@ocap/indexdb": "1.20.0",
|
|
30
|
+
"@ocap/mcrypto": "1.20.0",
|
|
31
|
+
"@ocap/message": "1.20.0",
|
|
32
|
+
"@ocap/state": "1.20.0",
|
|
33
|
+
"@ocap/tx-protocols": "1.20.0",
|
|
34
|
+
"@ocap/util": "1.20.0",
|
|
35
35
|
"debug": "^4.3.6",
|
|
36
36
|
"lodash": "^4.17.21",
|
|
37
37
|
"queue": "^6"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "1639c0e496a8a18bd95404d907e5ad58d9d28cc3"
|
|
40
40
|
}
|