diff options
author | Florian Dold <florian@dold.me> | 2021-08-06 16:27:18 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-08-06 16:27:18 +0200 |
commit | 05e52d4e116222728d9bcba3bcbf9e441bb4e4ed (patch) | |
tree | 6ef9da262ea2e88379878db52d2a1dbd022acd59 /packages/taler-wallet-core/src/operations/exchanges.ts | |
parent | 97de6321ac9a4047c36c9000b93989967ad36013 (diff) | |
download | wallet-core-05e52d4e116222728d9bcba3bcbf9e441bb4e4ed.tar.xz |
perf and logging improvements
Diffstat (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/exchanges.ts | 12 |
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, |