@ocap/state 1.18.145 → 1.18.147
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/states/tx.js +16 -0
- package/package.json +9 -9
package/lib/states/tx.js
CHANGED
|
@@ -313,6 +313,20 @@ const getRetrieveSwapReceipts = (tx) => [
|
|
|
313
313
|
].filter(Boolean),
|
|
314
314
|
},
|
|
315
315
|
];
|
|
316
|
+
const getRevokeWithdrawReceipts = (tx, { withdrawTx }) => {
|
|
317
|
+
const receipt = withdrawTx?.receipts?.find((x) => x.address === withdrawTx.tx.from);
|
|
318
|
+
const change = receipt?.changes?.find((x) => x.action === 'burn');
|
|
319
|
+
|
|
320
|
+
if (!change) return [];
|
|
321
|
+
if (tx.itxJson?.withdraw_tx_hash !== withdrawTx.hash) return [];
|
|
322
|
+
|
|
323
|
+
return [
|
|
324
|
+
{
|
|
325
|
+
address: withdrawTx.tx.from,
|
|
326
|
+
changes: [{ target: change.target, action: 'mint', value: new BN(change.value).abs().toString() }],
|
|
327
|
+
},
|
|
328
|
+
];
|
|
329
|
+
};
|
|
316
330
|
|
|
317
331
|
const mergeTxReceipts = (receipts) => {
|
|
318
332
|
const merged = [];
|
|
@@ -480,6 +494,8 @@ const getTxReceipts = ({ tx, code }, ctx = {}) => {
|
|
|
480
494
|
receipts = receipts.concat(getClaimStakeReceipts(tx, ctx, 'slash'));
|
|
481
495
|
} else if (['ReturnStakeTx'].includes(typeUrl)) {
|
|
482
496
|
receipts = receipts.concat(getClaimStakeReceipts(tx, ctx, 'stake'));
|
|
497
|
+
} else if (['RevokeWithdrawTx'].includes(typeUrl)) {
|
|
498
|
+
receipts = receipts.concat(getRevokeWithdrawReceipts(tx, ctx));
|
|
483
499
|
}
|
|
484
500
|
|
|
485
501
|
receipts = receipts.concat(getReceiptsFromContext(ctx));
|
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.147",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"coverage": "start-server-and-test start http://127.0.0.1:4001 test:ci"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcblock/did": "1.18.
|
|
22
|
-
"@arcblock/validator": "1.18.
|
|
23
|
-
"@ocap/contract": "1.18.
|
|
24
|
-
"@ocap/mcrypto": "1.18.
|
|
25
|
-
"@ocap/message": "1.18.
|
|
26
|
-
"@ocap/util": "1.18.
|
|
27
|
-
"@ocap/wallet": "1.18.
|
|
21
|
+
"@arcblock/did": "1.18.147",
|
|
22
|
+
"@arcblock/validator": "1.18.147",
|
|
23
|
+
"@ocap/contract": "1.18.147",
|
|
24
|
+
"@ocap/mcrypto": "1.18.147",
|
|
25
|
+
"@ocap/message": "1.18.147",
|
|
26
|
+
"@ocap/util": "1.18.147",
|
|
27
|
+
"@ocap/wallet": "1.18.147",
|
|
28
28
|
"bloom-filters": "^1.3.9",
|
|
29
29
|
"lodash": "^4.17.21"
|
|
30
30
|
},
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"keywords": [],
|
|
36
36
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
37
37
|
"license": "MIT",
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "bd5eff834975d76fdb3fcd1e347f21f47e900154"
|
|
39
39
|
}
|