summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/refund.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-09-08 21:03:10 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-09-08 21:03:10 +0530
commitaae06c680f7d31d0a2f2a2059b57a8d7c575d3c7 (patch)
tree25653034f74b5e043edd58702a24cad9acdc6fdd /packages/taler-wallet-core/src/operations/refund.ts
parentddbb09b1403214cff3e5a598dc51bdf37df72971 (diff)
downloadwallet-core-aae06c680f7d31d0a2f2a2059b57a8d7c575d3c7.tar.gz
wallet-core-aae06c680f7d31d0a2f2a2059b57a8d7c575d3c7.tar.bz2
wallet-core-aae06c680f7d31d0a2f2a2059b57a8d7c575d3c7.zip
DB tweaks
Diffstat (limited to 'packages/taler-wallet-core/src/operations/refund.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/refund.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/packages/taler-wallet-core/src/operations/refund.ts b/packages/taler-wallet-core/src/operations/refund.ts
index 097e20863..e15a27b3a 100644
--- a/packages/taler-wallet-core/src/operations/refund.ts
+++ b/packages/taler-wallet-core/src/operations/refund.ts
@@ -104,10 +104,10 @@ async function applySuccessfulRefund(
console.warn("coin not found, can't apply refund");
return;
}
- const denom = await tx.getIndexed(
- Stores.denominations.denomPubHashIndex,
+ const denom = await tx.get(Stores.denominations, [
+ coin.exchangeBaseUrl,
coin.denomPubHash,
- );
+ ]);
if (!denom) {
throw Error("inconsistent database");
}
@@ -161,10 +161,10 @@ async function storePendingRefund(
console.warn("coin not found, can't apply refund");
return;
}
- const denom = await tx.getIndexed(
- Stores.denominations.denomPubHashIndex,
+ const denom = await tx.get(Stores.denominations, [
+ coin.exchangeBaseUrl,
coin.denomPubHash,
- );
+ ]);
if (!denom) {
throw Error("inconsistent database");
@@ -211,10 +211,10 @@ async function storeFailedRefund(
console.warn("coin not found, can't apply refund");
return;
}
- const denom = await tx.getIndexed(
- Stores.denominations.denomPubHashIndex,
+ const denom = await tx.get(Stores.denominations, [
+ coin.exchangeBaseUrl,
coin.denomPubHash,
- );
+ ]);
if (!denom) {
throw Error("inconsistent database");
@@ -294,7 +294,8 @@ async function acceptRefunds(
// Still pending.
if (
- refundStatus.type === "failure" && !isPermanentFailure &&
+ refundStatus.type === "failure" &&
+ !isPermanentFailure &&
existingRefundInfo?.type === RefundState.Pending
) {
continue;