@ocap/indexdb-memory 1.18.96 → 1.18.98
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/db/base.js +19 -1
- package/package.json +5 -5
package/lib/db/base.js
CHANGED
@@ -24,6 +24,7 @@ class LocalBaseIndexDB extends BaseIndexDB {
|
|
24
24
|
txFilter = {},
|
25
25
|
rollupFilter = {},
|
26
26
|
stakeFilter = {},
|
27
|
+
delegationFilter = {},
|
27
28
|
} = {}) {
|
28
29
|
const query = this.tx.collection.chain();
|
29
30
|
|
@@ -36,12 +37,25 @@ class LocalBaseIndexDB extends BaseIndexDB {
|
|
36
37
|
const { txs = [] } = txFilter;
|
37
38
|
const { rollups = [] } = rollupFilter;
|
38
39
|
const { stakes = [] } = stakeFilter;
|
40
|
+
const { delegations = [] } = delegationFilter;
|
39
41
|
let { startDateTime, endDateTime } = timeFilter;
|
40
42
|
startDateTime = parseDateTime(startDateTime);
|
41
43
|
endDateTime = parseDateTime(endDateTime);
|
42
44
|
|
43
45
|
const pagination = formatPagination({ paging, defaultSortField: 'time' });
|
44
|
-
debug('listTransactions', {
|
46
|
+
debug('listTransactions', {
|
47
|
+
sender,
|
48
|
+
receiver,
|
49
|
+
pagination,
|
50
|
+
types,
|
51
|
+
factories,
|
52
|
+
assets,
|
53
|
+
tokens,
|
54
|
+
accounts,
|
55
|
+
rollups,
|
56
|
+
stakes,
|
57
|
+
delegations,
|
58
|
+
});
|
45
59
|
|
46
60
|
if (sender && receiver) {
|
47
61
|
if (direction === 'MUTUAL') {
|
@@ -118,6 +132,10 @@ class LocalBaseIndexDB extends BaseIndexDB {
|
|
118
132
|
query.where((x) => x.stakes.some((f) => stakes.includes(f)));
|
119
133
|
}
|
120
134
|
|
135
|
+
if (delegations.length) {
|
136
|
+
query.where((x) => x.delegations.some((f) => delegations.includes(f)));
|
137
|
+
}
|
138
|
+
|
121
139
|
const transactions = query
|
122
140
|
.simplesort(pagination.order.field, paging.order.type === 'desc')
|
123
141
|
.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.
|
4
|
+
"version": "1.18.98",
|
5
5
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
6
6
|
"bugs": {
|
7
7
|
"url": "https://github.com/ArcBlock/blockchain/issues",
|
@@ -37,11 +37,11 @@
|
|
37
37
|
"test": "jest --forceExit --detectOpenHandles",
|
38
38
|
"coverage": "npm run test -- --coverage"
|
39
39
|
},
|
40
|
-
"gitHead": "
|
40
|
+
"gitHead": "41138be9ecae27624397a8b5ee270e2101944560",
|
41
41
|
"dependencies": {
|
42
|
-
"@arcblock/did": "1.18.
|
43
|
-
"@ocap/indexdb": "1.18.
|
44
|
-
"@ocap/util": "1.18.
|
42
|
+
"@arcblock/did": "1.18.98",
|
43
|
+
"@ocap/indexdb": "1.18.98",
|
44
|
+
"@ocap/util": "1.18.98",
|
45
45
|
"debug": "^4.3.4",
|
46
46
|
"empty-value": "^1.0.1",
|
47
47
|
"lodash": "^4.17.21",
|