@ocap/indexdb-memory 1.13.70 → 1.13.74
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/db/base.js +5 -3
- package/package.json +5 -4
package/lib/db/base.js
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
/* eslint-disable newline-per-chained-call */
|
2
|
-
const lowerCase = require('lodash/lowerCase');
|
3
2
|
const { BN } = require('@ocap/util');
|
4
3
|
const { BaseIndexDB } = require('@ocap/indexdb');
|
5
4
|
const { formatPagination, formatNextPagination } = require('@ocap/indexdb/lib/util');
|
6
5
|
const { parseDateTime } = require('@ocap/indexdb/lib/util');
|
7
6
|
const { DEFAULT_TOKEN_DECIMAL } = require('@ocap/util/lib/constant');
|
7
|
+
const { toChecksumAddress } = require('@arcblock/did/lib/type');
|
8
|
+
|
8
9
|
const debug = require('debug')(require('../../package.json').name);
|
9
10
|
|
10
11
|
const MAX_REQUEST_FACTORY_ADDRESS_SIZE = 100;
|
@@ -340,7 +341,7 @@ class LocalBaseIndexDB extends BaseIndexDB {
|
|
340
341
|
return { stakes, paging: nextPaging };
|
341
342
|
}
|
342
343
|
|
343
|
-
async listRollups({ paging, tokenAddress = '', erc20TokenAddress = '' } = {}) {
|
344
|
+
async listRollups({ paging, tokenAddress = '', erc20TokenAddress = '', foreignTokenAddress = '' } = {}) {
|
344
345
|
const pagination = formatPagination({
|
345
346
|
paging,
|
346
347
|
defaultSortField: 'renaissanceTime',
|
@@ -352,8 +353,9 @@ class LocalBaseIndexDB extends BaseIndexDB {
|
|
352
353
|
query.where((x) => x.tokenAddress === tokenAddress);
|
353
354
|
}
|
354
355
|
|
356
|
+
const foreignTokenAddr = foreignTokenAddress || erc20TokenAddress;
|
355
357
|
if (erc20TokenAddress) {
|
356
|
-
query.where((x) =>
|
358
|
+
query.where((x) => x.foreignToken.contractAddress === toChecksumAddress(foreignTokenAddr));
|
357
359
|
}
|
358
360
|
|
359
361
|
debug('listRollups', { paging, pagination });
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ocap/indexdb-memory",
|
3
3
|
"description": "OCAP indexdb adapter that uses memory as backend, just for test purpose",
|
4
|
-
"version": "1.13.
|
4
|
+
"version": "1.13.74",
|
5
5
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
6
6
|
"bugs": {
|
7
7
|
"url": "https://github.com/ArcBlock/asset-chain/issues",
|
@@ -37,10 +37,11 @@
|
|
37
37
|
"test": "jest --forceExit --detectOpenHandles",
|
38
38
|
"coverage": "npm run test -- --coverage"
|
39
39
|
},
|
40
|
-
"gitHead": "
|
40
|
+
"gitHead": "24531e4142d2dc888d6f6091d82d2f7e5abe22ae",
|
41
41
|
"dependencies": {
|
42
|
-
"@
|
43
|
-
"@ocap/
|
42
|
+
"@arcblock/did": "1.13.74",
|
43
|
+
"@ocap/indexdb": "1.13.74",
|
44
|
+
"@ocap/util": "1.13.74",
|
44
45
|
"debug": "^4.3.2",
|
45
46
|
"empty-value": "^1.0.1",
|
46
47
|
"lodash": "^4.17.21",
|