aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-06-22 12:18:12 +0200
committerFlorian Dold <florian@dold.me>2021-06-22 12:18:12 +0200
commit7383b89cabbfdb8f2fbd6bb9e7b64d09385f7bea (patch)
tree7700b10f5dad217c0d16b5ac8182cd3af0127abb /packages/taler-wallet-core/src/operations
parentc4f46cb9d2f755d15e84b639bc6f7bb2546874ce (diff)
get rid of cyclic imports
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/exchanges.ts9
-rw-r--r--packages/taler-wallet-core/src/operations/testing.ts11
2 files changed, 11 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts
index 85455cf9c..a04769929 100644
--- a/packages/taler-wallet-core/src/operations/exchanges.ts
+++ b/packages/taler-wallet-core/src/operations/exchanges.ts
@@ -65,7 +65,6 @@ import {
makeErrorDetails,
OperationFailedError,
} from "../errors.js";
-import { createRecoupGroup, processRecoupGroup } from "./recoup.js";
import { InternalWalletState, TrustInfo } from "../common.js";
import {
WALLET_CACHE_BREAKER_CLIENT_VERSION,
@@ -556,7 +555,11 @@ async function updateExchangeFromUrlImpl(
}
if (newlyRevokedCoinPubs.length != 0) {
logger.trace("recouping coins", newlyRevokedCoinPubs);
- recoupGroupId = await createRecoupGroup(ws, tx, newlyRevokedCoinPubs);
+ recoupGroupId = await ws.recoupOps.createRecoupGroup(
+ ws,
+ tx,
+ newlyRevokedCoinPubs,
+ );
}
return {
exchange: r,
@@ -567,7 +570,7 @@ async function updateExchangeFromUrlImpl(
if (recoupGroupId) {
// Asynchronously start recoup. This doesn't need to finish
// for the exchange update to be considered finished.
- processRecoupGroup(ws, recoupGroupId).catch((e) => {
+ ws.recoupOps.processRecoupGroup(ws, recoupGroupId).catch((e) => {
logger.error("error while recouping coins:", e);
});
}
diff --git a/packages/taler-wallet-core/src/operations/testing.ts b/packages/taler-wallet-core/src/operations/testing.ts
index c9786801b..dd7d8c7cb 100644
--- a/packages/taler-wallet-core/src/operations/testing.ts
+++ b/packages/taler-wallet-core/src/operations/testing.ts
@@ -38,7 +38,6 @@ import { createTalerWithdrawReserve } from "./reserves.js";
import { InternalWalletState } from "../common.js";
import { confirmPay, preparePayForUri } from "./pay.js";
import { getBalances } from "./balance.js";
-import { runUntilDone } from "../wallet.js";
import { applyRefund } from "./refund.js";
const logger = new Logger("operations/testing.ts");
@@ -333,7 +332,7 @@ export async function runIntegrationTest(
args.bankBaseUrl,
args.exchangeBaseUrl,
);
- await runUntilDone(ws);
+ await ws.runUntilDone();
logger.info("done withdrawing test balance");
const balance = await getBalances(ws);
@@ -348,7 +347,7 @@ export async function runIntegrationTest(
await makePayment(ws, myMerchant, args.amountToSpend, "hello world");
// Wait until the refresh is done
- await runUntilDone(ws);
+ await ws.runUntilDone();
logger.trace("withdrawing test balance for refund");
const withdrawAmountTwo = Amounts.parseOrThrow(`${currency}:18`);
@@ -364,7 +363,7 @@ export async function runIntegrationTest(
);
// Wait until the withdraw is done
- await runUntilDone(ws);
+ await ws.runUntilDone();
const { orderId: refundOrderId } = await makePayment(
ws,
@@ -388,7 +387,7 @@ export async function runIntegrationTest(
logger.trace("integration test: applied refund");
// Wait until the refund is done
- await runUntilDone(ws);
+ await ws.runUntilDone();
logger.trace("integration test: making payment after refund");
@@ -401,7 +400,7 @@ export async function runIntegrationTest(
logger.trace("integration test: make payment done");
- await runUntilDone(ws);
+ await ws.runUntilDone();
logger.trace("integration test: all done!");
}