diff options
Diffstat (limited to 'src/operations')
-rw-r--r-- | src/operations/exchanges.ts | 13 | ||||
-rw-r--r-- | src/operations/history.ts | 8 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/operations/exchanges.ts b/src/operations/exchanges.ts index 53b250a8e..27fed0b6c 100644 --- a/src/operations/exchanges.ts +++ b/src/operations/exchanges.ts @@ -31,7 +31,6 @@ import { WireFee, ExchangeUpdateReason, ExchangeUpdatedEventRecord, - CoinStatus, } from "../types/dbTypes"; import { canonicalizeBaseUrl } from "../util/helpers"; import * as Amounts from "../util/amounts"; @@ -81,7 +80,7 @@ async function setExchangeError( err: OperationError, ): Promise<void> { console.log(`last error for exchange ${baseUrl}:`, err); - const mut = (exchange: ExchangeRecord) => { + const mut = (exchange: ExchangeRecord): ExchangeRecord => { exchange.lastError = err; return exchange; }; @@ -284,7 +283,7 @@ async function updateExchangeWithKeys( async function updateExchangeFinalize( ws: InternalWalletState, exchangeBaseUrl: string, -) { +): Promise<void> { const exchange = await ws.db.get(Stores.exchanges, exchangeBaseUrl); if (!exchange) { return; @@ -316,7 +315,7 @@ async function updateExchangeFinalize( async function updateExchangeWithTermsOfService( ws: InternalWalletState, exchangeBaseUrl: string, -) { +): Promise<void> { const exchange = await ws.db.get(Stores.exchanges, exchangeBaseUrl); if (!exchange) { return; @@ -357,7 +356,7 @@ export async function acceptExchangeTermsOfService( ws: InternalWalletState, exchangeBaseUrl: string, etag: string | undefined, -) { +): Promise<void> { await ws.db.runWithWriteTransaction([Stores.exchanges], async (tx) => { const r = await tx.get(Stores.exchanges, exchangeBaseUrl); if (!r) { @@ -377,7 +376,7 @@ export async function acceptExchangeTermsOfService( async function updateExchangeWithWireInfo( ws: InternalWalletState, exchangeBaseUrl: string, -) { +): Promise<void> { const exchange = await ws.db.get(Stores.exchanges, exchangeBaseUrl); if (!exchange) { return; @@ -461,7 +460,7 @@ export async function updateExchangeFromUrl( baseUrl: string, forceNow = false, ): Promise<ExchangeRecord> { - const onOpErr = (e: OperationError) => setExchangeError(ws, baseUrl, e); + const onOpErr = (e: OperationError): Promise<void> => setExchangeError(ws, baseUrl, e); return await guardOperationException( () => updateExchangeFromUrlImpl(ws, baseUrl, forceNow), onOpErr, diff --git a/src/operations/history.ts b/src/operations/history.ts index b043e4a90..efbfbf377 100644 --- a/src/operations/history.ts +++ b/src/operations/history.ts @@ -20,11 +20,9 @@ import { InternalWalletState } from "./state"; import { Stores, - TipRecord, ProposalStatus, ProposalRecord, PlanchetRecord, - CoinRecord, } from "../types/dbTypes"; import { Amounts } from "../util/amounts"; import { AmountJson } from "../util/amounts"; @@ -40,14 +38,14 @@ import { VerboseRefreshDetails, } from "../types/history"; import { assertUnreachable } from "../util/assertUnreachable"; -import { TransactionHandle, Store } from "../util/query"; +import { TransactionHandle } from "../util/query"; import { timestampCmp } from "../util/time"; import { summarizeReserveHistory } from "../util/reserveHistoryUtil"; /** * Create an event ID from the type and the primary key for the event. */ -function makeEventId(type: HistoryEventType, ...args: string[]) { +function makeEventId(type: HistoryEventType, ...args: string[]): string { return type + ";" + args.map((x) => encodeURIComponent(x)).join(";"); } @@ -72,7 +70,7 @@ async function collectProposalHistory( tx: TransactionHandle, history: HistoryEvent[], historyQuery?: HistoryQuery, -) { +): Promise<void> { tx.iter(Stores.proposals).forEachAsync(async (proposal) => { const status = proposal.proposalStatus; switch (status) { |