@ocap/indexdb-memory 1.13.72 → 1.13.76

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/db/base.js +5 -3
  2. 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) => lowerCase(x.erc20TokenAddress) === lowerCase(erc20TokenAddress));
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.72",
4
+ "version": "1.13.76",
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": "c9fcd79d6e1ea7ac45831d79ea202a983304f69b",
40
+ "gitHead": "8787d19bdde22c3085645a38dcaf16a0f5e8c660",
41
41
  "dependencies": {
42
- "@ocap/indexdb": "1.13.72",
43
- "@ocap/util": "1.13.72",
42
+ "@arcblock/did": "1.13.76",
43
+ "@ocap/indexdb": "1.13.76",
44
+ "@ocap/util": "1.13.76",
44
45
  "debug": "^4.3.2",
45
46
  "empty-value": "^1.0.1",
46
47
  "lodash": "^4.17.21",