Skip to content

Commit 84cf7e9

Browse files
committed
Show deposit txids in exchange recovery summary
1 parent 5122ccf commit 84cf7e9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

manage_scripts/exchange_recovery_deposit_clear.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ function normalizeBatches(entry) {
6262
blockIds: Array.isArray(batch && batch.blockIds)
6363
? batch.blockIds.map(function normalizeId(blockId) { return Number(blockId); }).filter(Number.isFinite)
6464
: [],
65-
createdAt: Number(batch && batch.createdAt) || 0
65+
createdAt: Number(batch && batch.createdAt) || 0,
66+
txHash: typeof batch?.txHash === "string" ? batch.txHash : ""
6667
};
6768
}).filter(function keepBatch(batch) {
6869
return batch.amount > 0;
@@ -87,6 +88,9 @@ function summarizeEntry(port, entry, blockLookup) {
8788
const totalAmount = batches.reduce(function sum(total, batch) {
8889
return total + batch.amount;
8990
}, 0);
91+
const txHashes = batches.map(function mapTx(batch) {
92+
return batch.txHash;
93+
}).filter(Boolean);
9094
return {
9195
port: String(port),
9296
coin: formatCoin(port),
@@ -96,7 +100,8 @@ function summarizeEntry(port, entry, blockLookup) {
96100
baseline: formatAmount(Number(entry && entry.balanceBaseline) || 0, port),
97101
created_at: firstCreatedAt ? new Date(firstCreatedAt).toISOString() : "unknown",
98102
first_height: heights.length ? heights[0] : null,
99-
last_height: heights.length ? heights[heights.length - 1] : null
103+
last_height: heights.length ? heights[heights.length - 1] : null,
104+
txs: txHashes.join(",")
100105
};
101106
}
102107

@@ -109,6 +114,7 @@ function printSummary(summary) {
109114
" amount=" + summary.amount +
110115
" baseline=" + summary.baseline +
111116
" created_at=" + summary.created_at +
117+
(summary.txs ? " txs=" + summary.txs : "") +
112118
(summary.first_height !== null ? " first_height=" + summary.first_height : "") +
113119
(summary.last_height !== null ? " last_height=" + summary.last_height : "")
114120
);

0 commit comments

Comments
 (0)