aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/exchanges.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/exchanges.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts
index 86a518671..64821a7b1 100644
--- a/packages/taler-wallet-core/src/operations/exchanges.ts
+++ b/packages/taler-wallet-core/src/operations/exchanges.ts
@@ -341,7 +341,6 @@ async function downloadKeysInfo(
);
logger.info("received /keys response");
- logger.trace(j2s(exchangeKeysJson));
if (exchangeKeysJson.denoms.length === 0) {
const opErr = makeErrorDetails(
@@ -442,18 +441,23 @@ async function updateExchangeFromUrlImpl(
const keysInfo = await downloadKeysInfo(baseUrl, ws.http, timeout);
+ logger.info("updating exchange /wire info");
const wireInfoDownload = await downloadExchangeWithWireInfo(
baseUrl,
ws.http,
timeout,
);
+ logger.info("validating exchange /wire info");
+
const wireInfo = await validateWireInfo(
wireInfoDownload,
keysInfo.masterPublicKey,
ws.cryptoApi,
);
+ logger.info("finished validating exchange /wire info");
+
const tosDownload = await downloadExchangeWithTermsOfService(
baseUrl,
ws.http,
@@ -462,6 +466,8 @@ async function updateExchangeFromUrlImpl(
let recoupGroupId: string | undefined = undefined;
+ logger.trace("updating exchange info in database");
+
const updated = await ws.db
.mktx((x) => ({
exchanges: x.exchanges,
@@ -512,6 +518,7 @@ async function updateExchangeFromUrlImpl(
await tx.exchanges.put(r);
await tx.exchangeDetails.put(details);
+ logger.trace("updating denominations in database");
for (const currentDenom of keysInfo.currentDenominations) {
const oldDenom = await tx.denominations.get([
baseUrl,
@@ -523,6 +530,7 @@ async function updateExchangeFromUrlImpl(
await tx.denominations.put(currentDenom);
}
}
+ logger.trace("done updating denominations in database");
// Handle recoup
const recoupDenomList = keysInfo.recoup;
@@ -579,6 +587,8 @@ async function updateExchangeFromUrlImpl(
throw Error("something went wrong with updating the exchange");
}
+ logger.trace("done updating exchange info in database");
+
return {
exchange: updated.exchange,
exchangeDetails: updated.exchangeDetails,