@ocap/indexdb-memory 1.18.19 → 1.18.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/db/base.js +6 -0
  2. package/package.json +5 -5
package/lib/db/base.js CHANGED
@@ -23,6 +23,7 @@ class LocalBaseIndexDB extends BaseIndexDB {
23
23
  validityFilter = {},
24
24
  txFilter = {},
25
25
  rollupFilter = {},
26
+ stakeFilter = {},
26
27
  } = {}) {
27
28
  const query = this.tx.collection.chain();
28
29
 
@@ -34,6 +35,7 @@ class LocalBaseIndexDB extends BaseIndexDB {
34
35
  const { accounts = [] } = accountFilter;
35
36
  const { txs = [] } = txFilter;
36
37
  const { rollups = [] } = rollupFilter;
38
+ const { stakes = [] } = stakeFilter;
37
39
  let { startDateTime, endDateTime } = timeFilter;
38
40
  startDateTime = parseDateTime(startDateTime);
39
41
  endDateTime = parseDateTime(endDateTime);
@@ -112,6 +114,10 @@ class LocalBaseIndexDB extends BaseIndexDB {
112
114
  query.where((x) => x.rollups.some((f) => rollups.includes(f)));
113
115
  }
114
116
 
117
+ if (stakes.length) {
118
+ query.where((x) => x.stakes.some((f) => stakes.includes(f)));
119
+ }
120
+
115
121
  const transactions = query
116
122
  .simplesort(pagination.order.field, paging.order.type === 'desc')
117
123
  .offset(pagination.cursor)
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.18.19",
4
+ "version": "1.18.21",
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,11 +37,11 @@
37
37
  "test": "jest --forceExit --detectOpenHandles",
38
38
  "coverage": "npm run test -- --coverage"
39
39
  },
40
- "gitHead": "d13bcea225809e0c0a926cfc246c7a46bd4185f3",
40
+ "gitHead": "be5df6f70d48c8c5026cd7bb42d53b270ddeb344",
41
41
  "dependencies": {
42
- "@arcblock/did": "1.18.19",
43
- "@ocap/indexdb": "1.18.19",
44
- "@ocap/util": "1.18.19",
42
+ "@arcblock/did": "1.18.21",
43
+ "@ocap/indexdb": "1.18.21",
44
+ "@ocap/util": "1.18.21",
45
45
  "debug": "^4.3.4",
46
46
  "empty-value": "^1.0.1",
47
47
  "lodash": "^4.17.21",