From 1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 7 Apr 2020 01:23:29 +0530 Subject: linter / simpler webextension pack --- src/operations/exchanges.ts | 13 ++++++------- src/operations/history.ts | 8 +++----- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'src/operations') 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 { 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 { 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 { 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 { 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 { 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 { - const onOpErr = (e: OperationError) => setExchangeError(ws, baseUrl, e); + const onOpErr = (e: OperationError): Promise => 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 { tx.iter(Stores.proposals).forEachAsync(async (proposal) => { const status = proposal.proposalStatus; switch (status) { -- cgit v1.2.3