aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-03-10 14:47:46 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-03-10 14:47:46 +0530
commit6e2881fabf74a3c1da8e94dcbe3e68fce6080d9e (patch)
treed0f9a5a03260ce0db057c3d962ca35947dffa26d /src
parent26d961ad633027f50ee402b9a7e7fa383c2b33c3 (diff)
cleanup
Diffstat (limited to 'src')
-rw-r--r--src/operations/recoup.ts (renamed from src/operations/payback.ts)2
-rw-r--r--src/wallet.ts6
-rw-r--r--src/webex/messages.ts4
-rw-r--r--src/webex/wxApi.ts7
-rw-r--r--src/webex/wxBackend.ts28
5 files changed, 16 insertions, 31 deletions
diff --git a/src/operations/payback.ts b/src/operations/recoup.ts
index 181527693..2b646a4d8 100644
--- a/src/operations/payback.ts
+++ b/src/operations/recoup.ts
@@ -30,7 +30,7 @@ import { NotificationType } from "../types/notifications";
const logger = new Logger("payback.ts");
-export async function payback(
+export async function recoup(
ws: InternalWalletState,
coinPub: string,
): Promise<void> {
diff --git a/src/wallet.ts b/src/wallet.ts
index 12bc2ccbb..23ac8490b 100644
--- a/src/wallet.ts
+++ b/src/wallet.ts
@@ -95,7 +95,7 @@ import { getHistory } from "./operations/history";
import { getPendingOperations } from "./operations/pending";
import { getBalances } from "./operations/balance";
import { acceptTip, getTipStatus, processTip } from "./operations/tip";
-import { payback } from "./operations/payback";
+import { recoup } from "./operations/recoup";
import { TimerGroup } from "./util/timer";
import { AsyncCondition } from "./util/promiseUtils";
import { AsyncOpMemoSingle } from "./util/asyncMemo";
@@ -577,10 +577,6 @@ export class Wallet {
return await this.db.iter(Stores.coins).toArray();
}
- async payback(coinPub: string): Promise<void> {
- return payback(this.ws, coinPub);
- }
-
async getPaybackReserves(): Promise<ReserveRecord[]> {
return await this.db.iter(Stores.reserves).filter(r => r.hasPayback);
}
diff --git a/src/webex/messages.ts b/src/webex/messages.ts
index 579dd4347..132c8c58d 100644
--- a/src/webex/messages.ts
+++ b/src/webex/messages.ts
@@ -118,10 +118,6 @@ export interface MessageMap {
request: { exchangeBaseUrl: string };
response: dbTypes.DenominationRecord[];
};
- "payback-coin": {
- request: { coinPub: string };
- response: void;
- };
"check-upgrade": {
request: {};
response: UpgradeResponse;
diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts
index bb5222a23..7464b1f74 100644
--- a/src/webex/wxApi.ts
+++ b/src/webex/wxApi.ts
@@ -194,13 +194,6 @@ export function refresh(coinPub: string): Promise<void> {
/**
- * Request payback for a coin. Only works for non-refreshed coins.
- */
-export function payback(coinPub: string): Promise<void> {
- return callBackend("payback-coin", { coinPub });
-}
-
-/**
* Pay for a proposal.
*/
export function confirmPay(proposalId: string, sessionId: string | undefined): Promise<ConfirmPayResult> {
diff --git a/src/webex/wxBackend.ts b/src/webex/wxBackend.ts
index 053b82964..faf917f86 100644
--- a/src/webex/wxBackend.ts
+++ b/src/webex/wxBackend.ts
@@ -24,9 +24,18 @@
* Imports.
*/
import { BrowserCryptoWorkerFactory } from "../crypto/workers/cryptoApi";
-import { deleteTalerDatabase, openTalerDatabase, WALLET_DB_VERSION } from "../db";
-import { ConfirmReserveRequest, CreateReserveRequest, ReturnCoinsRequest, WalletDiagnostics, codecForCreateReserveRequest, codecForConfirmReserveRequest } from "../types/walletTypes";
-import { AmountJson, codecForAmountJson } from "../util/amounts";
+import {
+ deleteTalerDatabase,
+ openTalerDatabase,
+ WALLET_DB_VERSION,
+} from "../db";
+import {
+ ReturnCoinsRequest,
+ WalletDiagnostics,
+ codecForCreateReserveRequest,
+ codecForConfirmReserveRequest,
+} from "../types/walletTypes";
+import { codecForAmountJson } from "../util/amounts";
import { BrowserHttpLib } from "../util/http";
import { OpenedPromise, openPromise } from "../util/promiseUtils";
import { classifyTalerUri, TalerUriType } from "../util/taleruri";
@@ -67,7 +76,7 @@ async function handleMessage(
}
case "dump-db": {
const db = needsWallet().db;
- return db.exportDatabase()
+ return db.exportDatabase();
}
case "import-db": {
const db = needsWallet().db;
@@ -166,12 +175,6 @@ async function handleMessage(
}
return needsWallet().refresh(detail.coinPub);
}
- case "payback-coin": {
- if (typeof detail.coinPub !== "string") {
- return Promise.reject(Error("coinPub missing"));
- }
- return needsWallet().payback(detail.coinPub);
- }
case "get-sender-wire-infos": {
return needsWallet().getSenderWireInfos();
}
@@ -399,10 +402,7 @@ async function reinitWallet() {
setBadgeText({ text: "" });
const badge = new ChromeBadge();
try {
- currentDatabase = await openTalerDatabase(
- indexedDB,
- reinitWallet,
- );
+ currentDatabase = await openTalerDatabase(indexedDB, reinitWallet);
} catch (e) {
console.error("could not open database", e);
walletInit.reject(e);