@clonegod/ttd-sui-common 1.0.31 → 1.0.32
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.
|
@@ -62,20 +62,19 @@ class TransactionResultChecker extends trade_1.AbstractTransactionResultCheck {
|
|
|
62
62
|
this.processTransactionResult(response, 'grpc');
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
(0, dist_1.log_warn)(`re-fetch tx result by ledgerService start, txid=${this.txid}`);
|
|
66
65
|
for (let i = 1; i <= 6; i++) {
|
|
67
|
-
|
|
66
|
+
(0, dist_1.log_info)(`re-fetch tx result by ledgerService start, i=${i}, txid=${this.txid}`);
|
|
68
67
|
try {
|
|
69
|
-
txReceipt = yield this.leadgerService.getTransaction(this.txid, ['*']);
|
|
68
|
+
let txReceipt = yield this.leadgerService.getTransaction(this.txid, ['*']);
|
|
70
69
|
if (txReceipt) {
|
|
71
70
|
this.processTransactionResult(txReceipt, 'grpc2');
|
|
72
71
|
break;
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
catch (error) {
|
|
76
|
-
(0, dist_1.log_warn)(`re-fetch tx result by ledgerService failed
|
|
75
|
+
(0, dist_1.log_warn)(`re-fetch tx result by ledgerService failed, i=${i}, txid=${this.txid}, error=${error.message}`);
|
|
77
76
|
}
|
|
78
|
-
yield (0, dist_1.sleep)(
|
|
77
|
+
yield (0, dist_1.sleep)(1000);
|
|
79
78
|
}
|
|
80
79
|
}));
|
|
81
80
|
}
|
|
@@ -22,14 +22,14 @@ class SuiTransactionParser {
|
|
|
22
22
|
}
|
|
23
23
|
parseTransaction(receipt, poolInfo) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
26
26
|
try {
|
|
27
|
-
if (((_c = (_b = (_a = receipt.transaction) === null || _a === void 0 ? void 0 : _a.effects) === null || _b === void 0 ? void 0 : _b.status) === null || _c === void 0 ? void 0 : _c.success) !== true) {
|
|
27
|
+
if (((_c = (_b = (_a = receipt.transaction) === null || _a === void 0 ? void 0 : _a.effects) === null || _b === void 0 ? void 0 : _b.status) === null || _c === void 0 ? void 0 : _c.success) !== true || ((_e = (_d = receipt.transaction) === null || _d === void 0 ? void 0 : _d.balance_changes) === null || _e === void 0 ? void 0 : _e.length) === 0) {
|
|
28
28
|
console.log('Transaction failed', {
|
|
29
|
-
txid: (
|
|
30
|
-
success: (
|
|
31
|
-
balance_changes: (
|
|
32
|
-
reason: (
|
|
29
|
+
txid: (_f = receipt.transaction) === null || _f === void 0 ? void 0 : _f.digest,
|
|
30
|
+
success: (_j = (_h = (_g = receipt.transaction) === null || _g === void 0 ? void 0 : _g.effects) === null || _h === void 0 ? void 0 : _h.status) === null || _j === void 0 ? void 0 : _j.success,
|
|
31
|
+
balance_changes: (_l = (_k = receipt.transaction) === null || _k === void 0 ? void 0 : _k.balance_changes) === null || _l === void 0 ? void 0 : _l.length,
|
|
32
|
+
reason: (_q = (_p = (_o = (_m = receipt.transaction) === null || _m === void 0 ? void 0 : _m.effects) === null || _o === void 0 ? void 0 : _o.status) === null || _p === void 0 ? void 0 : _p.error) === null || _q === void 0 ? void 0 : _q.kind
|
|
33
33
|
});
|
|
34
34
|
throw new Error('Transaction failed');
|
|
35
35
|
}
|