aboutsummaryrefslogtreecommitdiff
path: root/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-04-06 23:32:01 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-04-06 23:32:01 +0530
commit47787c0b0b846d5f4a057661efdd05d8786032f1 (patch)
tree3a3d58a5ebad8af584de6a6cd882c2019f71dffa /src/operations
parentf36bb7a04eabe0330cb166bf9ce5021c92f38dc8 (diff)
downloadwallet-core-47787c0b0b846d5f4a057661efdd05d8786032f1.tar.xz
make linter less grumpy
Diffstat (limited to 'src/operations')
-rw-r--r--src/operations/pay.ts10
-rw-r--r--src/operations/refund.ts16
2 files changed, 13 insertions, 13 deletions
diff --git a/src/operations/pay.ts b/src/operations/pay.ts
index 3a629e9c2..337068b55 100644
--- a/src/operations/pay.ts
+++ b/src/operations/pay.ts
@@ -620,7 +620,7 @@ export async function processDownloadProposal(
proposalId: string,
forceNow = false,
): Promise<void> {
- const onOpErr = (err: OperationError) =>
+ const onOpErr = (err: OperationError): Promise<void> =>
incrementProposalRetry(ws, proposalId, err);
await guardOperationException(
() => processDownloadProposalImpl(ws, proposalId, forceNow),
@@ -631,7 +631,7 @@ export async function processDownloadProposal(
async function resetDownloadProposalRetry(
ws: InternalWalletState,
proposalId: string,
-) {
+): Promise<void> {
await ws.db.mutate(Stores.proposals, proposalId, (x) => {
if (x.retryInfo.active) {
x.retryInfo = initRetryInfo();
@@ -1108,7 +1108,7 @@ export async function processPurchasePay(
proposalId: string,
forceNow = false,
): Promise<void> {
- const onOpErr = (e: OperationError) =>
+ const onOpErr = (e: OperationError): Promise<void> =>
incrementPurchasePayRetry(ws, proposalId, e);
await guardOperationException(
() => processPurchasePayImpl(ws, proposalId, forceNow),
@@ -1119,7 +1119,7 @@ export async function processPurchasePay(
async function resetPurchasePayRetry(
ws: InternalWalletState,
proposalId: string,
-) {
+): Promise<void> {
await ws.db.mutate(Stores.purchases, proposalId, (x) => {
if (x.payRetryInfo.active) {
x.payRetryInfo = initRetryInfo();
@@ -1150,7 +1150,7 @@ async function processPurchasePayImpl(
export async function refuseProposal(
ws: InternalWalletState,
proposalId: string,
-) {
+): Promise<void> {
const success = await ws.db.runWithWriteTransaction(
[Stores.proposals],
async (tx) => {
diff --git a/src/operations/refund.ts b/src/operations/refund.ts
index 74d4b848e..af9a48895 100644
--- a/src/operations/refund.ts
+++ b/src/operations/refund.ts
@@ -302,7 +302,7 @@ export async function processPurchaseQueryRefund(
proposalId: string,
forceNow = false,
): Promise<void> {
- const onOpErr = (e: OperationError) =>
+ const onOpErr = (e: OperationError): Promise<void> =>
incrementPurchaseQueryRefundRetry(ws, proposalId, e);
await guardOperationException(
() => processPurchaseQueryRefundImpl(ws, proposalId, forceNow),
@@ -313,7 +313,7 @@ export async function processPurchaseQueryRefund(
async function resetPurchaseQueryRefundRetry(
ws: InternalWalletState,
proposalId: string,
-) {
+): Promise<void> {
await ws.db.mutate(Stores.purchases, proposalId, (x) => {
if (x.refundStatusRetryInfo.active) {
x.refundStatusRetryInfo = initRetryInfo();
@@ -368,7 +368,7 @@ export async function processPurchaseApplyRefund(
proposalId: string,
forceNow = false,
): Promise<void> {
- const onOpErr = (e: OperationError) =>
+ const onOpErr = (e: OperationError): Promise<void> =>
incrementPurchaseApplyRefundRetry(ws, proposalId, e);
await guardOperationException(
() => processPurchaseApplyRefundImpl(ws, proposalId, forceNow),
@@ -379,7 +379,7 @@ export async function processPurchaseApplyRefund(
async function resetPurchaseApplyRefundRetry(
ws: InternalWalletState,
proposalId: string,
-) {
+): Promise<void> {
await ws.db.mutate(Stores.purchases, proposalId, (x) => {
if (x.refundApplyRetryInfo.active) {
x.refundApplyRetryInfo = initRetryInfo();
@@ -435,11 +435,10 @@ async function processPurchaseApplyRefundImpl(
// We're too late, refund is expired.
newRefundsFailed[pk] = info;
break;
- default:
+ default: {
let body: string | null = null;
- try {
- body = await resp.json();
- } catch {}
+ // FIXME: error handling!
+ body = await resp.json();
const m = "refund request (at exchange) failed";
throw new OperationFailedError({
message: m,
@@ -448,6 +447,7 @@ async function processPurchaseApplyRefundImpl(
body,
},
});
+ }
}
}
let allRefundsProcessed = false;