diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-04-02 20:44:12 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-04-02 20:44:12 +0530 |
commit | 95e638f513c6e8e5b4ab32981a1f8900b43700c7 (patch) | |
tree | 6a9a358259815a7de8ded76bad78b934d5f83040 /src/operations | |
parent | 05e43bb259810c305cf69f9323017d6a682c8213 (diff) | |
download | wallet-core-95e638f513c6e8e5b4ab32981a1f8900b43700c7.tar.xz |
cosmetics and comments
Diffstat (limited to 'src/operations')
-rw-r--r-- | src/operations/history.ts | 5 | ||||
-rw-r--r-- | src/operations/reserves.ts | 5 | ||||
-rw-r--r-- | src/operations/tip.ts | 1 | ||||
-rw-r--r-- | src/operations/withdraw.ts | 34 |
4 files changed, 25 insertions, 20 deletions
diff --git a/src/operations/history.ts b/src/operations/history.ts index 848739334..edb4d9f27 100644 --- a/src/operations/history.ts +++ b/src/operations/history.ts @@ -404,7 +404,10 @@ export async function getHistory( type: ReserveType.Manual, }; } - const s = summarizeReserveHistory(reserve.reserveTransactions, reserve.currency); + const s = summarizeReserveHistory( + reserve.reserveTransactions, + reserve.currency, + ); history.push({ type: HistoryEventType.ReserveBalanceUpdated, eventId: makeEventId( diff --git a/src/operations/reserves.ts b/src/operations/reserves.ts index 2ef902ef2..5c299d112 100644 --- a/src/operations/reserves.ts +++ b/src/operations/reserves.ts @@ -492,7 +492,10 @@ async function updateReserve( reserveInfo.history, ); - console.log("reconciled history:", JSON.stringify(reconciled, undefined, 2)); + console.log( + "reconciled history:", + JSON.stringify(reconciled, undefined, 2), + ); const summary = summarizeReserveHistory( reconciled.updatedLocalHistory, diff --git a/src/operations/tip.ts b/src/operations/tip.ts index d3c98d288..7bfbddb6a 100644 --- a/src/operations/tip.ts +++ b/src/operations/tip.ts @@ -247,7 +247,6 @@ async function processTipImpl( const planchets: PlanchetRecord[] = []; - for (let i = 0; i < tipRecord.planchets.length; i++) { const tipPlanchet = tipRecord.planchets[i]; const coinEvHash = await ws.cryptoApi.hashEncoded(tipPlanchet.coinEv); diff --git a/src/operations/withdraw.ts b/src/operations/withdraw.ts index 48d70db20..fcd9d70c9 100644 --- a/src/operations/withdraw.ts +++ b/src/operations/withdraw.ts @@ -52,7 +52,10 @@ import { timestampCmp, timestampSubtractDuraction, } from "../util/time"; -import { summarizeReserveHistory, ReserveHistorySummary } from "../util/reserveHistoryUtil"; +import { + summarizeReserveHistory, + ReserveHistorySummary, +} from "../util/reserveHistoryUtil"; const logger = new Logger("withdraw.ts"); @@ -372,22 +375,19 @@ async function incrementWithdrawalRetry( withdrawalGroupId: string, err: OperationError | undefined, ): Promise<void> { - await ws.db.runWithWriteTransaction( - [Stores.withdrawalGroups], - async (tx) => { - const wsr = await tx.get(Stores.withdrawalGroups, withdrawalGroupId); - if (!wsr) { - return; - } - if (!wsr.retryInfo) { - return; - } - wsr.retryInfo.retryCounter++; - updateRetryInfoTimeout(wsr.retryInfo); - wsr.lastError = err; - await tx.put(Stores.withdrawalGroups, wsr); - }, - ); + await ws.db.runWithWriteTransaction([Stores.withdrawalGroups], async (tx) => { + const wsr = await tx.get(Stores.withdrawalGroups, withdrawalGroupId); + if (!wsr) { + return; + } + if (!wsr.retryInfo) { + return; + } + wsr.retryInfo.retryCounter++; + updateRetryInfoTimeout(wsr.retryInfo); + wsr.lastError = err; + await tx.put(Stores.withdrawalGroups, wsr); + }); ws.notify({ type: NotificationType.WithdrawOperationError }); } |