@ocap/indexdb-memory 1.18.95 → 1.18.97
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 +19 -1
- package/package.json +8 -8
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,10 +1,10 @@
|
|
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.97",
|
5
5
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
6
6
|
"bugs": {
|
7
|
-
"url": "https://github.com/ArcBlock/
|
7
|
+
"url": "https://github.com/ArcBlock/blockchain/issues",
|
8
8
|
"email": "shijun@arcblock.io"
|
9
9
|
},
|
10
10
|
"publishConfig": {
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"devDependencies": {
|
17
17
|
"jest": "^27.5.1"
|
18
18
|
},
|
19
|
-
"homepage": "https://github.com/ArcBlock/
|
19
|
+
"homepage": "https://github.com/ArcBlock/blockchain/tree/master/indexdb/memory",
|
20
20
|
"keywords": [
|
21
21
|
"ocap",
|
22
22
|
"indexdb",
|
@@ -29,7 +29,7 @@
|
|
29
29
|
],
|
30
30
|
"repository": {
|
31
31
|
"type": "git",
|
32
|
-
"url": "https://github.com/ArcBlock/
|
32
|
+
"url": "https://github.com/ArcBlock/blockchain/tree/master/indexdb/memory"
|
33
33
|
},
|
34
34
|
"scripts": {
|
35
35
|
"lint": "eslint tests lib",
|
@@ -37,11 +37,11 @@
|
|
37
37
|
"test": "jest --forceExit --detectOpenHandles",
|
38
38
|
"coverage": "npm run test -- --coverage"
|
39
39
|
},
|
40
|
-
"gitHead": "
|
40
|
+
"gitHead": "691aabefd37f53b6fbcf771ce130f09197f0b268",
|
41
41
|
"dependencies": {
|
42
|
-
"@arcblock/did": "1.18.
|
43
|
-
"@ocap/indexdb": "1.18.
|
44
|
-
"@ocap/util": "1.18.
|
42
|
+
"@arcblock/did": "1.18.97",
|
43
|
+
"@ocap/indexdb": "1.18.97",
|
44
|
+
"@ocap/util": "1.18.97",
|
45
45
|
"debug": "^4.3.4",
|
46
46
|
"empty-value": "^1.0.1",
|
47
47
|
"lodash": "^4.17.21",
|