aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-06-09 15:26:18 +0200
committerFlorian Dold <florian@dold.me>2021-06-09 15:26:18 +0200
commit3d2b7b2a65787858c9471bc48cc5860c07b7f7dc (patch)
tree4a7477c184de7408104b8bf254a277a5949b19de /packages/taler-wallet-core/src/operations
parent5c26461247040c07c86291babf0c87631df638b5 (diff)
downloadwallet-core-3d2b7b2a65787858c9471bc48cc5860c07b7f7dc.tar.xz
formatting: re-run prettier
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/balance.ts7
-rw-r--r--packages/taler-wallet-core/src/operations/pay.ts8
-rw-r--r--packages/taler-wallet-core/src/operations/pending.ts36
-rw-r--r--packages/taler-wallet-core/src/operations/testing.ts15
4 files changed, 40 insertions, 26 deletions
diff --git a/packages/taler-wallet-core/src/operations/balance.ts b/packages/taler-wallet-core/src/operations/balance.ts
index 7273f0b42..4dba6beb7 100644
--- a/packages/taler-wallet-core/src/operations/balance.ts
+++ b/packages/taler-wallet-core/src/operations/balance.ts
@@ -17,7 +17,12 @@
/**
* Imports.
*/
-import { AmountJson, BalancesResponse, Amounts, Logger } from "@gnu-taler/taler-util";
+import {
+ AmountJson,
+ BalancesResponse,
+ Amounts,
+ Logger,
+} from "@gnu-taler/taler-util";
import { CoinStatus, WalletStoresV1 } from "../db.js";
import { GetReadOnlyAccess } from "../util/query.js";
diff --git a/packages/taler-wallet-core/src/operations/pay.ts b/packages/taler-wallet-core/src/operations/pay.ts
index c57243b59..86b66e6f6 100644
--- a/packages/taler-wallet-core/src/operations/pay.ts
+++ b/packages/taler-wallet-core/src/operations/pay.ts
@@ -1649,8 +1649,9 @@ export async function refuseProposal(
ws: InternalWalletState,
proposalId: string,
): Promise<void> {
- const success = await ws.db.mktx((x) => ({proposals: x.proposals})).runReadWrite(
- async (tx) => {
+ const success = await ws.db
+ .mktx((x) => ({ proposals: x.proposals }))
+ .runReadWrite(async (tx) => {
const proposal = await tx.proposals.get(proposalId);
if (!proposal) {
logger.trace(`proposal ${proposalId} not found, won't refuse proposal`);
@@ -1662,8 +1663,7 @@ export async function refuseProposal(
proposal.proposalStatus = ProposalStatus.REFUSED;
await tx.proposals.put(proposal);
return true;
- },
- );
+ });
if (success) {
ws.notify({
type: NotificationType.ProposalRefused,
diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts
index d3904c426..4eee85278 100644
--- a/packages/taler-wallet-core/src/operations/pending.ts
+++ b/packages/taler-wallet-core/src/operations/pending.ts
@@ -239,7 +239,7 @@ async function gatherRefreshPending(
async function gatherWithdrawalPending(
tx: GetReadOnlyAccess<{
withdrawalGroups: typeof WalletStoresV1.withdrawalGroups;
- planchets: typeof WalletStoresV1.planchets,
+ planchets: typeof WalletStoresV1.planchets;
}>,
now: Timestamp,
resp: PendingOperationsResponse,
@@ -464,21 +464,22 @@ export async function getPendingOperations(
{ onlyDue = false } = {},
): Promise<PendingOperationsResponse> {
const now = getTimestampNow();
- return await ws.db.mktx((x) => ({
- exchanges: x.exchanges,
- exchangeDetails: x.exchangeDetails,
- reserves: x.reserves,
- refreshGroups: x.refreshGroups,
- coins: x.coins,
- withdrawalGroups: x.withdrawalGroups,
- proposals: x.proposals,
- tips: x.tips,
- purchases: x.purchases,
- planchets: x.planchets,
- depositGroups: x.depositGroups,
- recoupGroups: x.recoupGroups,
- })).runReadWrite(
- async (tx) => {
+ return await ws.db
+ .mktx((x) => ({
+ exchanges: x.exchanges,
+ exchangeDetails: x.exchangeDetails,
+ reserves: x.reserves,
+ refreshGroups: x.refreshGroups,
+ coins: x.coins,
+ withdrawalGroups: x.withdrawalGroups,
+ proposals: x.proposals,
+ tips: x.tips,
+ purchases: x.purchases,
+ planchets: x.planchets,
+ depositGroups: x.depositGroups,
+ recoupGroups: x.recoupGroups,
+ }))
+ .runReadWrite(async (tx) => {
const walletBalance = await getBalancesInsideTransaction(ws, tx);
const resp: PendingOperationsResponse = {
nextRetryDelay: { d_ms: Number.MAX_SAFE_INTEGER },
@@ -496,6 +497,5 @@ export async function getPendingOperations(
await gatherRecoupPending(tx, now, resp, onlyDue);
await gatherDepositPending(tx, now, resp, onlyDue);
return resp;
- },
- );
+ });
}
diff --git a/packages/taler-wallet-core/src/operations/testing.ts b/packages/taler-wallet-core/src/operations/testing.ts
index 6875a308f..c9d99bf04 100644
--- a/packages/taler-wallet-core/src/operations/testing.ts
+++ b/packages/taler-wallet-core/src/operations/testing.ts
@@ -23,7 +23,16 @@ import {
readSuccessResponseJsonOrThrow,
checkSuccessResponseOrThrow,
} from "../util/http";
-import { AmountString, codecForAny, CheckPaymentResponse, codecForCheckPaymentResponse, IntegrationTestArgs, Amounts, TestPayArgs, PreparePayResultType } from "@gnu-taler/taler-util";
+import {
+ AmountString,
+ codecForAny,
+ CheckPaymentResponse,
+ codecForCheckPaymentResponse,
+ IntegrationTestArgs,
+ Amounts,
+ TestPayArgs,
+ PreparePayResultType,
+} from "@gnu-taler/taler-util";
import { URL } from "../index.js";
import { Wallet } from "../wallet.js";
import { createTalerWithdrawReserve } from "./reserves.js";
@@ -102,8 +111,8 @@ export async function withdrawTestBalance(
function getMerchantAuthHeader(m: MerchantBackendInfo): Record<string, string> {
if (m.authToken) {
return {
- "Authorization": `Bearer ${m.authToken}`,
- }
+ Authorization: `Bearer ${m.authToken}`,
+ };
}
return {};
}