From 794a9dc01185ffa5f6d3cf22d1041b4e8f468f48 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 6 Mar 2024 10:23:39 +0100 Subject: -remove deprecated type --- packages/taler-util/src/wallet-types.ts | 27 +++++++++------------------ packages/taler-wallet-core/src/refresh.ts | 16 +++++++++++----- 2 files changed, 20 insertions(+), 23 deletions(-) (limited to 'packages') diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index ef1581af5..1efa6651f 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -630,11 +630,11 @@ export interface CoinDumpJson { withdrawal_reserve_pub: string | undefined; coin_status: CoinStatus; spend_allocation: - | { - id: string; - amount: AmountString; - } - | undefined; + | { + id: string; + amount: AmountString; + } + | undefined; /** * Information about the age restriction */ @@ -1100,15 +1100,6 @@ export interface CoinRefreshRequest { readonly amount: AmountString; } -/** - * Wrapper for refresh group IDs. - * - * @deprecated use types instead - */ -export interface RefreshGroupId { - readonly refreshGroupId: string; -} - /** * Private data required to make a deposit permission. */ @@ -2586,15 +2577,15 @@ export const codecForActiveTask = (): Codec => .property("id", codecForString()) .property("transaction", codecOptional(codecForTransactionIdStr())) .property("counter", codecForNumber()) - .property("firstTry", (codecForAbsoluteTime)) - .property("nextTry", (codecForAbsoluteTime)) + .property("firstTry", codecForAbsoluteTime) + .property("nextTry", codecForAbsoluteTime) .property("lastError", codecForTalerErrorDetail()) - .build("ActiveTask") + .build("ActiveTask"); export const codecForGetActiveTasks = (): Codec => buildCodecForObject() .property("tasks", codecForList(codecForActiveTask())) - .build("GetActiveTasks") + .build("GetActiveTasks"); export interface ImportDbRequest { dump: any; diff --git a/packages/taler-wallet-core/src/refresh.ts b/packages/taler-wallet-core/src/refresh.ts index f67fb5015..c6ece1536 100644 --- a/packages/taler-wallet-core/src/refresh.ts +++ b/packages/taler-wallet-core/src/refresh.ts @@ -44,7 +44,6 @@ import { Logger, makeErrorDetail, NotificationType, - RefreshGroupId, RefreshReason, TalerError, TalerErrorCode, @@ -101,7 +100,6 @@ import { import { EXCHANGE_COINS_LOCK, getDenomInfo, - InternalWalletState, WalletExecutionContext, } from "./wallet.js"; import { getCandidateWithdrawalDenomsTx } from "./withdraw.js"; @@ -1412,14 +1410,18 @@ export function getRefreshesForTransaction( }); } +export interface ForceRefreshResult { + refreshGroupId: string; +} + export async function forceRefresh( wex: WalletExecutionContext, req: ForceRefreshRequest, -): Promise<{ refreshGroupId: RefreshGroupId }> { +): Promise { if (req.coinPubList.length == 0) { throw Error("refusing to create empty refresh group"); } - const refreshGroupId = await wex.db.runReadWriteTx( + const res = await wex.db.runReadWriteTx( ["refreshGroups", "coinAvailability", "denominations", "coins"], async (tx) => { let coinPubs: CoinRefreshRequest[] = []; @@ -1451,7 +1453,11 @@ export async function forceRefresh( }, ); + for (const notif of res.notifications) { + wex.ws.notify(notif); + } + return { - refreshGroupId, + refreshGroupId: res.refreshGroupId, }; } -- cgit v1.2.3