summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-03-06 10:23:39 +0100
committerFlorian Dold <florian@dold.me>2024-03-06 10:23:39 +0100
commit794a9dc01185ffa5f6d3cf22d1041b4e8f468f48 (patch)
tree0aee84bf4a03bac888a867479ec496b6dcadcf9c /packages
parent5c18e924ed8bc5ccc37d226cfdc04e26c76e020b (diff)
downloadwallet-core-794a9dc01185ffa5f6d3cf22d1041b4e8f468f48.tar.gz
wallet-core-794a9dc01185ffa5f6d3cf22d1041b4e8f468f48.tar.bz2
wallet-core-794a9dc01185ffa5f6d3cf22d1041b4e8f468f48.zip
-remove deprecated type
Diffstat (limited to 'packages')
-rw-r--r--packages/taler-util/src/wallet-types.ts27
-rw-r--r--packages/taler-wallet-core/src/refresh.ts16
2 files changed, 20 insertions, 23 deletions
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
*/
@@ -1101,15 +1101,6 @@ export interface CoinRefreshRequest {
}
/**
- * Wrapper for refresh group IDs.
- *
- * @deprecated use types instead
- */
-export interface RefreshGroupId {
- readonly refreshGroupId: string;
-}
-
-/**
* Private data required to make a deposit permission.
*/
export interface DepositInfo {
@@ -2586,15 +2577,15 @@ export const codecForActiveTask = (): Codec<ActiveTask> =>
.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<GetActiveTasks> =>
buildCodecForObject<GetActiveTasks>()
.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<ForceRefreshResult> {
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,
};
}