diff options
author | Florian Dold <florian@dold.me> | 2022-01-13 22:01:14 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-01-13 22:01:14 +0100 |
commit | 17c3ced6488eb14a01b39f1ad724fcfcd5d0c4e7 (patch) | |
tree | 66c0bc42d33f93cc185a0fd16648fa54c6cf003f /packages/taler-wallet-core/src/operations/deposits.ts | |
parent | cd2473e1ade13ca43d8f6fafaa2e8d3c3675bfd8 (diff) | |
download | wallet-core-17c3ced6488eb14a01b39f1ad724fcfcd5d0c4e7.tar.gz wallet-core-17c3ced6488eb14a01b39f1ad724fcfcd5d0c4e7.tar.bz2 wallet-core-17c3ced6488eb14a01b39f1ad724fcfcd5d0c4e7.zip |
make more use of the denom cache
Diffstat (limited to 'packages/taler-wallet-core/src/operations/deposits.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/deposits.ts | 14 |
1 files changed, 9 insertions, 5 deletions
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"); } |