summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-08-06 00:30:36 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-08-06 00:30:36 +0530
commit82a2437c0967871d6b942105c98c3382978cad29 (patch)
treeda803c3d4a58d9c691f5908b379791c8ee55cc37 /packages/taler-wallet-core/src/operations
parenta8f03d3dd1ad04abf7f569cb44933b6dce6713e7 (diff)
downloadwallet-core-82a2437c0967871d6b942105c98c3382978cad29.tar.gz
wallet-core-82a2437c0967871d6b942105c98c3382978cad29.tar.bz2
wallet-core-82a2437c0967871d6b942105c98c3382978cad29.zip
towards integration tests with fault injection
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/exchanges.ts10
-rw-r--r--packages/taler-wallet-core/src/operations/pay.ts2
-rw-r--r--packages/taler-wallet-core/src/operations/withdraw.ts2
3 files changed, 13 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts
index ee49fddb5..8967173ca 100644
--- a/packages/taler-wallet-core/src/operations/exchanges.ts
+++ b/packages/taler-wallet-core/src/operations/exchanges.ts
@@ -112,6 +112,8 @@ async function updateExchangeWithKeys(
return;
}
+ logger.info("updating exchange /keys info");
+
const keysUrl = new URL("keys", baseUrl);
keysUrl.searchParams.set("cacheBreaker", WALLET_CACHE_BREAKER_CLIENT_VERSION);
@@ -121,6 +123,8 @@ async function updateExchangeWithKeys(
codecForExchangeKeysJson(),
);
+ logger.info("received /keys response");
+
if (exchangeKeysJson.denoms.length === 0) {
const opErr = makeErrorDetails(
TalerErrorCode.WALLET_EXCHANGE_DENOMINATIONS_INSUFFICIENT,
@@ -152,12 +156,16 @@ async function updateExchangeWithKeys(
const currency = Amounts.parseOrThrow(exchangeKeysJson.denoms[0].value)
.currency;
+ logger.trace("processing denominations");
+
const newDenominations = await Promise.all(
exchangeKeysJson.denoms.map((d) =>
denominationRecordFromKeys(ws, baseUrl, d),
),
);
+ logger.trace("done with processing denominations");
+
const lastUpdateTimestamp = getTimestampNow();
const recoupGroupId: string | undefined = undefined;
@@ -241,6 +249,8 @@ async function updateExchangeWithKeys(
console.log("error while recouping coins:", e);
});
}
+
+ logger.trace("done updating exchange /keys");
}
async function updateExchangeFinalize(
diff --git a/packages/taler-wallet-core/src/operations/pay.ts b/packages/taler-wallet-core/src/operations/pay.ts
index f23e326f8..0fa9e0a61 100644
--- a/packages/taler-wallet-core/src/operations/pay.ts
+++ b/packages/taler-wallet-core/src/operations/pay.ts
@@ -781,7 +781,7 @@ export async function submitPay(
}
const sessionId = purchase.lastSessionId;
- console.log("paying with session ID", sessionId);
+ logger.trace("paying with session ID", sessionId);
const payUrl = new URL(
`orders/${purchase.contractData.orderId}/pay`,
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts
index 3b0aa0095..9719772a7 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -712,7 +712,9 @@ export async function getWithdrawalDetailsForUri(
ws: InternalWalletState,
talerWithdrawUri: string,
): Promise<WithdrawUriInfoResponse> {
+ logger.trace(`getting withdrawal details for URI ${talerWithdrawUri}`);
const info = await getBankWithdrawalInfo(ws, talerWithdrawUri);
+ logger.trace(`got bank info`);
if (info.suggestedExchange) {
// FIXME: right now the exchange gets permanently added,
// we might want to only temporarily add it.