diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-05-15 16:03:52 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-05-15 16:03:52 +0530 |
commit | 3eb88574bcf327672c34120becfb511eac4e06cd (patch) | |
tree | 9d54748adef52dc9a21c8ea97c7d034cd773277a /src/operations/withdraw.ts | |
parent | 35c83414f9e0af11012c1a2e00672d2a7c1856ae (diff) | |
download | wallet-core-3eb88574bcf327672c34120becfb511eac4e06cd.tar.xz |
address first batch of transaction list issues
Diffstat (limited to 'src/operations/withdraw.ts')
-rw-r--r-- | src/operations/withdraw.ts | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/operations/withdraw.ts b/src/operations/withdraw.ts index 21c30d7af..14071be79 100644 --- a/src/operations/withdraw.ts +++ b/src/operations/withdraw.ts @@ -1,6 +1,6 @@ /* This file is part of GNU Taler - (C) 2019-2029 Taler Systems SA + (C) 2019-2020 Taler Systems SA GNU Taler is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -27,6 +27,7 @@ import { DenominationSelectionInfo, PlanchetRecord, WithdrawalSourceType, + DenomSelectionState, } from "../types/dbTypes"; import { BankWithdrawDetails, @@ -419,6 +420,19 @@ async function processPlanchet( } } +export function denomSelectionInfoToState(dsi: DenominationSelectionInfo): DenomSelectionState { + return { + selectedDenoms: dsi.selectedDenoms.map((x) => { + return { + count: x.count, + denomPubHash: x.denom.denomPubHash + }; + }), + totalCoinValue: dsi.totalCoinValue, + totalWithdrawCost: dsi.totalWithdrawCost, + } +} + /** * Get a list of denominations to withdraw from the given exchange for the * given amount, making sure that all denominations' signatures are verified. @@ -426,7 +440,7 @@ async function processPlanchet( * Writes to the DB in order to record the result from verifying * denominations. */ -export async function getVerifiedWithdrawDenomList( +export async function selectWithdrawalDenoms( ws: InternalWalletState, exchangeBaseUrl: string, amount: AmountJson, @@ -603,7 +617,7 @@ export async function getExchangeWithdrawalInfo( throw Error(`exchange ${exchangeInfo.baseUrl} wire details not available`); } - const selectedDenoms = await getVerifiedWithdrawDenomList( + const selectedDenoms = await selectWithdrawalDenoms( ws, baseUrl, amount, |