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 --- packages/taler-wallet-core/src/operations/deposits.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/deposits.ts') diff --git a/packages/taler-wallet-core/src/operations/deposits.ts b/packages/taler-wallet-core/src/operations/deposits.ts index afe8e6f30..40a0af310 100644 --- a/packages/taler-wallet-core/src/operations/deposits.ts +++ b/packages/taler-wallet-core/src/operations/deposits.ts @@ -26,7 +26,6 @@ import { ContractTerms, CreateDepositGroupRequest, CreateDepositGroupResponse, - decodeCrock, DenomKeyType, durationFromSpec, GetFeeForDepositRequest, @@ -250,6 +249,7 @@ async function processDepositGroupImpl( }; } const url = new URL(`coins/${perm.coin_pub}/deposit`, perm.exchange_url); + logger.info(`depositing to ${url}`); const httpResp = await ws.http.postJson(url.href, requestBody); await readSuccessResponseJsonOrThrow(httpResp, codecForDepositSuccess()); await ws.db @@ -616,10 +616,12 @@ export async function getEffectiveDepositAmount( if (!coin) { throw Error("can't calculate deposit amount, coin not found"); } - const denom = await tx.denominations.get([ + const denom = await ws.getDenomInfo( + ws, + tx, coin.exchangeBaseUrl, coin.denomPubHash, - ]); + ); if (!denom) { throw Error("can't find denomination to calculate deposit amount"); } @@ -688,10 +690,12 @@ export async function getTotalFeeForDepositAmount( if (!coin) { throw Error("can't calculate deposit amount, coin not found"); } - const denom = await tx.denominations.get([ + const denom = await ws.getDenomInfo( + ws, + tx, coin.exchangeBaseUrl, coin.denomPubHash, - ]); + ); if (!denom) { throw Error("can't find denomination to calculate deposit amount"); } -- cgit v1.2.3