From f9c45391bed222b4ebbedc376a30e44051d2a649 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 5 Mar 2024 17:41:52 +0100 Subject: cleanup --- packages/taler-wallet-core/src/wallet.ts | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'packages/taler-wallet-core/src/wallet.ts') diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 28d54fde3..b9d277cf0 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -71,7 +71,7 @@ import { codecForAbortTransaction, codecForAcceptBankIntegratedWithdrawalRequest, codecForAcceptExchangeTosRequest, - codecForAcceptManualWithdrawalRequet, + codecForAcceptManualWithdrawalRequest, codecForAcceptPeerPullPaymentRequest, codecForAddExchangeRequest, codecForAddGlobalCurrencyAuditorRequest, @@ -848,7 +848,7 @@ async function dispatchRequestInternal( }); } case WalletApiOperation.AcceptManualWithdrawal: { - const req = codecForAcceptManualWithdrawalRequet().decode(payload); + const req = codecForAcceptManualWithdrawalRequest().decode(payload); const res = await createManualWithdrawal(wex, { amount: Amounts.parseOrThrow(req.amount), exchangeBaseUrl: req.exchangeBaseUrl, @@ -869,7 +869,6 @@ async function dispatchRequestInternal( for (const x of wi.selectedDenoms.selectedDenoms) { numCoins += x.count; } - const amt = Amounts.parseOrThrow(req.amount); const resp: WithdrawalDetailsForAmount = { amountRaw: req.amount, amountEffective: Amounts.stringify(wi.selectedDenoms.totalCoinValue), @@ -1802,26 +1801,3 @@ export class InternalWalletState { } } } - -/** - * Take the full object as template, create a new result with all the values. - * Use the override object to change the values in the result - * return result - * @param full - * @param override - * @returns - */ -function deepMerge(full: T, override: object): T { - const keys = Object.keys(full); - const result = { ...full }; - for (const k of keys) { - // @ts-ignore - const newVal = override[k]; - if (newVal === undefined) continue; - // @ts-ignore - result[k] = - // @ts-ignore - typeof newVal === "object" ? deepMerge(full[k], newVal) : newVal; - } - return result; -} -- cgit v1.2.3