aboutsummaryrefslogtreecommitdiff
path: root/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-04-07 01:23:29 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-04-07 01:23:29 +0530
commit1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca (patch)
tree32d32d7f33b2ca64cf101006442b1b17bfaf61aa /src/operations
parent47787c0b0b846d5f4a057661efdd05d8786032f1 (diff)
downloadwallet-core-1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca.tar.xz
linter / simpler webextension pack
Diffstat (limited to 'src/operations')
-rw-r--r--src/operations/exchanges.ts13
-rw-r--r--src/operations/history.ts8
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) {