summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-01-13 00:51:30 +0100
committerFlorian Dold <florian@dold.me>2021-01-13 00:51:30 +0100
commit7de5ceaa74a2d0d99bf3699b0818c470d1202dc7 (patch)
tree5fce09345224adbe859e318befd2779702692fae /packages/taler-wallet-core/src/operations
parent050999a910837f8a5353b1584af2b03bd8dad93d (diff)
downloadwallet-core-7de5ceaa74a2d0d99bf3699b0818c470d1202dc7.tar.gz
wallet-core-7de5ceaa74a2d0d99bf3699b0818c470d1202dc7.tar.bz2
wallet-core-7de5ceaa74a2d0d99bf3699b0818c470d1202dc7.zip
auto format
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/backup.ts29
-rw-r--r--packages/taler-wallet-core/src/operations/refresh.ts5
-rw-r--r--packages/taler-wallet-core/src/operations/refund.ts16
-rw-r--r--packages/taler-wallet-core/src/operations/state.ts2
-rw-r--r--packages/taler-wallet-core/src/operations/tip.ts2
-rw-r--r--packages/taler-wallet-core/src/operations/transactions.ts4
-rw-r--r--packages/taler-wallet-core/src/operations/withdraw.ts2
7 files changed, 36 insertions, 24 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup.ts b/packages/taler-wallet-core/src/operations/backup.ts
index a9f1fc43f..8bc82ce6c 100644
--- a/packages/taler-wallet-core/src/operations/backup.ts
+++ b/packages/taler-wallet-core/src/operations/backup.ts
@@ -1274,7 +1274,9 @@ export async function importBackup(
break;
default:
logger.warn(
- `got backup purchase abort_status ${j2s(backupPurchase.abort_status)}`,
+ `got backup purchase abort_status ${j2s(
+ backupPurchase.abort_status,
+ )}`,
);
throw Error("not reachable");
}
@@ -1338,8 +1340,7 @@ export async function importBackup(
timestampAccept: backupPurchase.timestamp_accept,
timestampFirstSuccessfulPay:
backupPurchase.timestamp_first_successful_pay,
- timestampLastRefundStatus:
- undefined,
+ timestampLastRefundStatus: undefined,
merchantPaySig: backupPurchase.merchant_pay_sig,
lastSessionId: undefined,
abortStatus,
@@ -1567,14 +1568,20 @@ export async function runBackupCycle(ws: InternalWalletState): Promise<void> {
continue;
}
const p = proposalId;
- await ws.db.runWithWriteTransaction([Stores.backupProviders], async (tx) => {
- const provRec = await tx.get(Stores.backupProviders, provider.baseUrl);
- checkDbInvariant(!!provRec);
- const ids = new Set(provRec.paymentProposalIds)
- ids.add(p);
- provRec.paymentProposalIds = Array.from(ids);
- await tx.put(Stores.backupProviders, provRec);
- });
+ await ws.db.runWithWriteTransaction(
+ [Stores.backupProviders],
+ async (tx) => {
+ const provRec = await tx.get(
+ Stores.backupProviders,
+ provider.baseUrl,
+ );
+ checkDbInvariant(!!provRec);
+ const ids = new Set(provRec.paymentProposalIds);
+ ids.add(p);
+ provRec.paymentProposalIds = Array.from(ids);
+ await tx.put(Stores.backupProviders, provRec);
+ },
+ );
const confirmRes = await confirmPay(ws, proposalId);
switch (confirmRes.type) {
case ConfirmPayResultType.Pending:
diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts
index 2d80f0a50..a6c311f45 100644
--- a/packages/taler-wallet-core/src/operations/refresh.ts
+++ b/packages/taler-wallet-core/src/operations/refresh.ts
@@ -150,7 +150,10 @@ async function refreshCreateSession(
oldDenom.feeRefresh,
).amount;
- const newCoinDenoms = selectWithdrawalDenominations(availableAmount, availableDenoms);
+ const newCoinDenoms = selectWithdrawalDenominations(
+ availableAmount,
+ availableDenoms,
+ );
if (newCoinDenoms.selectedDenoms.length === 0) {
logger.trace(
diff --git a/packages/taler-wallet-core/src/operations/refund.ts b/packages/taler-wallet-core/src/operations/refund.ts
index 7ffcdb6d9..13df438e4 100644
--- a/packages/taler-wallet-core/src/operations/refund.ts
+++ b/packages/taler-wallet-core/src/operations/refund.ts
@@ -503,7 +503,9 @@ export async function applyRefund(
let amountRefundGranted = Amounts.getZero(
purchase.download.contractData.amount.currency,
);
- let amountRefundGone = Amounts.getZero(purchase.download.contractData.amount.currency);
+ let amountRefundGone = Amounts.getZero(
+ purchase.download.contractData.amount.currency,
+ );
let pendingAtExchange = false;
@@ -545,7 +547,8 @@ export async function applyRefund(
summary: purchase.download.contractData.summary,
fulfillmentMessage: purchase.download.contractData.fulfillmentMessage,
summary_i18n: purchase.download.contractData.summaryI18n,
- fulfillmentMessage_i18n: purchase.download.contractData.fulfillmentMessageI18n,
+ fulfillmentMessage_i18n:
+ purchase.download.contractData.fulfillmentMessageI18n,
},
};
}
@@ -669,9 +672,12 @@ async function processPurchaseQueryRefundImpl(
purchase.payCoinSelection.coinContributions[i],
),
rtransaction_id: 0,
- execution_time: timestampAddDuration(purchase.download.contractData.timestamp, {
- d_ms: 1000,
- }),
+ execution_time: timestampAddDuration(
+ purchase.download.contractData.timestamp,
+ {
+ d_ms: 1000,
+ },
+ ),
});
}
await acceptRefunds(ws, proposalId, refunds, RefundReason.AbortRefund);
diff --git a/packages/taler-wallet-core/src/operations/state.ts b/packages/taler-wallet-core/src/operations/state.ts
index 60aee4c3f..645ad8ad3 100644
--- a/packages/taler-wallet-core/src/operations/state.ts
+++ b/packages/taler-wallet-core/src/operations/state.ts
@@ -57,7 +57,7 @@ export class InternalWalletState {
constructor(
// FIXME: Make this a getter and make
- // the actual value nullable.
+ // the actual value nullable.
// Check if we are in a DB migration / garbage collection
// and throw an error in that case.
public db: Database<typeof Stores>,
diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts
index 68b5a2ad0..328fe2cfa 100644
--- a/packages/taler-wallet-core/src/operations/tip.ts
+++ b/packages/taler-wallet-core/src/operations/tip.ts
@@ -227,7 +227,7 @@ async function processTipImpl(
planchetIndex: planchets.length,
secretSeed: tipRecord.secretSeed,
};
- logger.trace(`deriving tip planchet: ${j2s(deriveReq)}`)
+ logger.trace(`deriving tip planchet: ${j2s(deriveReq)}`);
const p = await ws.cryptoApi.createTipPlanchet(deriveReq);
logger.trace(`derive result: ${j2s(p)}`);
denomForPlanchet[planchets.length] = denom;
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts
index a862d24ef..c7e6a9c53 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -269,9 +269,7 @@ export async function getTransactions(
);
let r0: WalletRefundItem | undefined;
let amountRaw = Amounts.getZero(contractData.amount.currency);
- let amountEffective = Amounts.getZero(
- contractData.amount.currency,
- );
+ let amountEffective = Amounts.getZero(contractData.amount.currency);
for (const rk of Object.keys(pr.refunds)) {
const refund = pr.refunds[rk];
const myGroupKey = `${refund.executionTime.t_ms}`;
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts
index c2dfcd1c4..d28bea1e1 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -86,7 +86,6 @@ export function isWithdrawableDenom(d: DenominationRecord): boolean {
return started && stillOkay && !d.isRevoked;
}
-
/**
* Get a list of denominations (with repetitions possible)
* whose total value is as close as possible to the available
@@ -562,7 +561,6 @@ export async function updateWithdrawalDenoms(
}
}
-
async function incrementWithdrawalRetry(
ws: InternalWalletState,
withdrawalGroupId: string,