From 17c3ced6488eb14a01b39f1ad724fcfcd5d0c4e7 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 13 Jan 2022 22:01:14 +0100 Subject: make more use of the denom cache --- .../taler-wallet-core/src/operations/exchanges.ts | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts') diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts index c14f27656..d73d593e8 100644 --- a/packages/taler-wallet-core/src/operations/exchanges.ts +++ b/packages/taler-wallet-core/src/operations/exchanges.ts @@ -131,7 +131,7 @@ async function handleExchangeUpdateError( exchange.retryInfo.retryCounter++; updateRetryInfoTimeout(exchange.retryInfo); exchange.lastError = err; - await tx.exchanges.put(exchange) + await tx.exchanges.put(exchange); }); if (err) { ws.notify({ type: NotificationType.ExchangeOperationError, error: err }); @@ -527,11 +527,11 @@ async function updateExchangeFromUrlImpl( tosFound !== undefined ? tosFound : await downloadExchangeWithTermsOfService( - baseUrl, - ws.http, - timeout, - "text/plain", - ); + baseUrl, + ws.http, + timeout, + "text/plain", + ); let recoupGroupId: string | undefined = undefined; @@ -589,7 +589,7 @@ async function updateExchangeFromUrlImpl( await tx.exchanges.put(r); await tx.exchangeDetails.put(details); - logger.trace("updating denominations in database"); + logger.info("updating denominations in database"); const currentDenomSet = new Set( keysInfo.currentDenominations.map((x) => x.denomPubHash), ); @@ -750,9 +750,10 @@ export async function getExchangeTrust( if (!exchangeDetails) { throw Error(`exchange ${exchangeInfo.baseUrl} details not available`); } - const exchangeTrustRecord = await tx.exchangesTrustStore.indexes.byExchangeMasterPub.get( - exchangeDetails.masterPublicKey, - ); + const exchangeTrustRecord = + await tx.exchangesTrustStore.indexes.byExchangeMasterPub.get( + exchangeDetails.masterPublicKey, + ); if ( exchangeTrustRecord && exchangeTrustRecord.uids.length > 0 && @@ -762,9 +763,8 @@ export async function getExchangeTrust( } for (const auditor of exchangeDetails.auditors) { - const auditorTrustRecord = await tx.auditorTrust.indexes.byAuditorPub.get( - auditor.auditor_pub, - ); + const auditorTrustRecord = + await tx.auditorTrust.indexes.byAuditorPub.get(auditor.auditor_pub); if (auditorTrustRecord && auditorTrustRecord.uids.length > 0) { isAudited = true; break; -- cgit v1.2.3