@clonegod/ttd-sui-common 1.0.47 → 1.0.49
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.
|
@@ -57,7 +57,7 @@ class TransactionResultChecker extends trade_1.AbstractTransactionResultCheck {
|
|
|
57
57
|
}
|
|
58
58
|
on_subscibe_transaction() {
|
|
59
59
|
this.event_emitter.once(`SUI_TX_RESULT_${this.txid}`, (response) => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
var _a, _b, _c, _d
|
|
60
|
+
var _a, _b, _c, _d;
|
|
61
61
|
(0, dist_1.log_info)(`receive tx result notification, txid=${this.txid}`);
|
|
62
62
|
if (response.transaction) {
|
|
63
63
|
this.processTransactionResult(response, 'grpc');
|
|
@@ -67,16 +67,21 @@ class TransactionResultChecker extends trade_1.AbstractTransactionResultCheck {
|
|
|
67
67
|
(0, dist_1.log_info)(`re-fetch tx result by ledgerService start, i=${i}, txid=${this.txid}`);
|
|
68
68
|
try {
|
|
69
69
|
let txReceipt = yield this.leadgerService.getTransaction(this.txid, ['*']);
|
|
70
|
-
if (!txReceipt) {
|
|
70
|
+
if (!txReceipt || (0, dist_1.isEmpty)(txReceipt)) {
|
|
71
|
+
console.log('txReceipt is empty', txReceipt);
|
|
71
72
|
continue;
|
|
72
73
|
}
|
|
73
74
|
const success = (_c = (_b = (_a = txReceipt.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;
|
|
74
|
-
const balance_changes = (
|
|
75
|
-
const isValidResult = !success || (success && balance_changes.length > 0);
|
|
75
|
+
const balance_changes = (_d = txReceipt.transaction) === null || _d === void 0 ? void 0 : _d.balance_changes;
|
|
76
|
+
const isValidResult = !success || (success && balance_changes && balance_changes.length > 0);
|
|
76
77
|
if (isValidResult) {
|
|
77
78
|
this.processTransactionResult(txReceipt, 'grpc2');
|
|
78
79
|
break;
|
|
79
80
|
}
|
|
81
|
+
else {
|
|
82
|
+
(0, dist_1.log_warn)(`re-fetch tx result by ledgerService failed, i=${i}, txid=${this.txid}, retry soon...`);
|
|
83
|
+
console.dir(txReceipt, { depth: 4 });
|
|
84
|
+
}
|
|
80
85
|
}
|
|
81
86
|
catch (error) {
|
|
82
87
|
(0, dist_1.log_warn)(`re-fetch tx result by ledgerService failed, i=${i}, txid=${this.txid}, error=${error.message}`);
|