@ocap/resolver 1.13.64 → 1.13.68
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 +10 -20
- package/package.json +12 -11
package/lib/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const isEqual = require('lodash/isEqual');
|
|
|
9
9
|
const uniqBy = require('lodash/unionBy');
|
|
10
10
|
const Config = require('@ocap/config');
|
|
11
11
|
const states = require('@ocap/state');
|
|
12
|
+
const Joi = require('@ocap/validator');
|
|
12
13
|
const md5 = require('@ocap/util/lib/md5');
|
|
13
14
|
const CustomError = require('@ocap/util/lib/error');
|
|
14
15
|
const { types } = require('@ocap/mcrypto');
|
|
@@ -166,7 +167,7 @@ module.exports = class OCAPResolver {
|
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
getTx({ hash }, ctx) {
|
|
169
|
-
if (
|
|
170
|
+
if (Joi.patterns.txHash.test(hash)) {
|
|
170
171
|
return this._getState({
|
|
171
172
|
table: 'tx',
|
|
172
173
|
id: hash.toUpperCase(),
|
|
@@ -437,8 +438,9 @@ module.exports = class OCAPResolver {
|
|
|
437
438
|
}
|
|
438
439
|
|
|
439
440
|
getForgeState() {
|
|
441
|
+
const { accounts, token, transaction } = this.config;
|
|
440
442
|
return Promise.resolve({
|
|
441
|
-
accountConfig:
|
|
443
|
+
accountConfig: accounts,
|
|
442
444
|
address: 'forge_state',
|
|
443
445
|
consensus: {
|
|
444
446
|
maxBytes: '150000',
|
|
@@ -449,25 +451,13 @@ module.exports = class OCAPResolver {
|
|
|
449
451
|
validatorChanged: false,
|
|
450
452
|
},
|
|
451
453
|
data: null,
|
|
452
|
-
gas: [],
|
|
453
|
-
protocols: [],
|
|
454
|
-
stakeSummary: [],
|
|
455
454
|
tasks: [],
|
|
456
|
-
token
|
|
457
|
-
tokenSwapConfig: {
|
|
458
|
-
commissionHolderAddress: '',
|
|
459
|
-
commissionRate: 0,
|
|
460
|
-
maxCommission: null,
|
|
461
|
-
minCommission: null,
|
|
462
|
-
revokeCommissionRate: 0,
|
|
463
|
-
},
|
|
455
|
+
token,
|
|
464
456
|
txConfig: {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
},
|
|
470
|
-
...this.config.transaction,
|
|
457
|
+
...transaction,
|
|
458
|
+
txFee: Object.keys(transaction.txFee)
|
|
459
|
+
.filter((x) => x !== 'default')
|
|
460
|
+
.map((x) => ({ typeUrl: x, fee: fromTokenToUnit(transaction.txFee[x], token.decimal).toString(10) })),
|
|
471
461
|
},
|
|
472
462
|
upgradeInfo: null,
|
|
473
463
|
});
|
|
@@ -602,7 +592,7 @@ module.exports = class OCAPResolver {
|
|
|
602
592
|
return result ? { type, id: keyword } : null;
|
|
603
593
|
};
|
|
604
594
|
|
|
605
|
-
if (
|
|
595
|
+
if (Joi.patterns.txHash.test(args.keyword)) {
|
|
606
596
|
const results = await Promise.all([
|
|
607
597
|
doSearch('tx', args.keyword.toUpperCase()),
|
|
608
598
|
doSearch('rollupBlock', args.keyword),
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.13.
|
|
6
|
+
"version": "1.13.68",
|
|
7
7
|
"description": "GraphQL resolver built upon ocap statedb and GQL layer",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -22,17 +22,18 @@
|
|
|
22
22
|
"jest": "^27.3.1"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@arcblock/did": "1.13.
|
|
26
|
-
"@arcblock/did-util": "1.13.
|
|
27
|
-
"@ocap/config": "1.13.
|
|
28
|
-
"@ocap/indexdb": "1.13.
|
|
29
|
-
"@ocap/mcrypto": "1.13.
|
|
30
|
-
"@ocap/message": "1.13.
|
|
31
|
-
"@ocap/state": "1.13.
|
|
32
|
-
"@ocap/tx-protocols": "1.13.
|
|
33
|
-
"@ocap/util": "1.13.
|
|
25
|
+
"@arcblock/did": "1.13.68",
|
|
26
|
+
"@arcblock/did-util": "1.13.68",
|
|
27
|
+
"@ocap/config": "1.13.68",
|
|
28
|
+
"@ocap/indexdb": "1.13.68",
|
|
29
|
+
"@ocap/mcrypto": "1.13.68",
|
|
30
|
+
"@ocap/message": "1.13.68",
|
|
31
|
+
"@ocap/state": "1.13.68",
|
|
32
|
+
"@ocap/tx-protocols": "1.13.68",
|
|
33
|
+
"@ocap/util": "1.13.68",
|
|
34
|
+
"@ocap/validator": "1.13.68",
|
|
34
35
|
"debug": "^4.3.2",
|
|
35
36
|
"lodash": "^4.17.21"
|
|
36
37
|
},
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "d84324870fe9dca3619df362ba09219dd420f274"
|
|
38
39
|
}
|