@ocap/indexdb 1.18.21 → 1.18.23
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/util.js +3 -17
- package/package.json +4 -4
package/lib/util.js
CHANGED
|
@@ -127,20 +127,6 @@ const createIndexedFactory = (factory, context) => {
|
|
|
127
127
|
};
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
const attachPaidTxGas = (tx) => {
|
|
131
|
-
// determine gasPaid
|
|
132
|
-
let gasChange = null;
|
|
133
|
-
tx.receipts.forEach((r) => {
|
|
134
|
-
const tmp = r.changes.find((c) => c.action === 'gas' && c.value === tx.tx.gasFee);
|
|
135
|
-
if (tmp) {
|
|
136
|
-
gasChange = tmp;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
tx.tx.gasPaid = gasChange ? tx.tx.gasFee : '0';
|
|
140
|
-
|
|
141
|
-
return tx;
|
|
142
|
-
};
|
|
143
|
-
|
|
144
130
|
// These fields are used internally to filter transactions by some entity
|
|
145
131
|
const createIndexedTransaction = async (tx, ctx, indexdb) => {
|
|
146
132
|
tx.accounts = [tx.tx.from, tx.sender, tx.receiver];
|
|
@@ -152,8 +138,6 @@ const createIndexedTransaction = async (tx, ctx, indexdb) => {
|
|
|
152
138
|
|
|
153
139
|
tx.valid = tx.code === 'OK';
|
|
154
140
|
|
|
155
|
-
attachPaidTxGas(tx);
|
|
156
|
-
|
|
157
141
|
// accounts
|
|
158
142
|
if (ctx.senderState) {
|
|
159
143
|
tx.accounts.push(ctx.senderState.address);
|
|
@@ -213,6 +197,9 @@ const createIndexedTransaction = async (tx, ctx, indexdb) => {
|
|
|
213
197
|
// stakes
|
|
214
198
|
if (ctx.stakeState) {
|
|
215
199
|
tx.stakes.push(ctx.stakeState.address);
|
|
200
|
+
if (ctx.txType === 'fg:t:slash_stake') {
|
|
201
|
+
tx.accounts.push(ctx.stakeState.sender);
|
|
202
|
+
}
|
|
216
203
|
}
|
|
217
204
|
if (Array.isArray(ctx.stakeStates)) {
|
|
218
205
|
tx.stakes.push(...ctx.stakeStates.map((x) => x.address));
|
|
@@ -556,5 +543,4 @@ module.exports = {
|
|
|
556
543
|
parseDateTime,
|
|
557
544
|
formatTokenMeta,
|
|
558
545
|
isDefaultTokenChanged,
|
|
559
|
-
attachPaidTxGas,
|
|
560
546
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.18.
|
|
6
|
+
"version": "1.18.23",
|
|
7
7
|
"description": "Defines the basic interface for OCAP IndexDB",
|
|
8
8
|
"main": "lib/main.js",
|
|
9
9
|
"files": [
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"jest": "^27.5.1"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ocap/state": "1.18.
|
|
29
|
-
"@ocap/util": "1.18.
|
|
28
|
+
"@ocap/state": "1.18.23",
|
|
29
|
+
"@ocap/util": "1.18.23",
|
|
30
30
|
"kareem": "^2.4.1",
|
|
31
31
|
"lodash": "^4.17.21"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "bb57afdd756f4a9608e53e40c91060c32b97f2f8"
|
|
34
34
|
}
|