commit 88226a0b2fbfccd8d91f21b2cda6312deb21e513
parent 0e2d31d6f304a257ecc9e83072eaee806b551eb3
Author: Florian Dold <florian@dold.me>
Date: Wed, 14 Jan 2026 13:24:14 +0100
purge odd .bak file
Diffstat:
1 file changed, 0 insertions(+), 44 deletions(-)
diff --git a/packages/taler-wallet-core/src/deleteDiscount.ts.bak b/packages/taler-wallet-core/src/deleteDiscount.ts.bak
@@ -1,44 +0,0 @@
-
-
-export async function deleteDiscount(
- wex: WalletExecutionContext,
- tokenIssuePubHash: string,
- validityEnd: TalerProtocolTimestamp,
- validityStart?: TalerProtocolTimestamp,
-): Promise<EmptyObject> {
- await wex.db.runReadWriteTx({
- storeNames: ["tokens"],
- }, async (tx) => {
- const tokens = (await tx.tokens.indexes
- .byTokenIssuePubHash
- .getAll(tokenIssuePubHash))
- .filter(t => isTokenValidBetween(t,
- validityStart ?? TalerProtocolTimestamp.now(),
- validityEnd,
- ));
-
- let inUse: boolean = false;
- for (const token of tokens) {
- if (isTokenInUse(token)) {
- inUse = true;
- return;
- }
- }
-
- // FIXME: proper GANA error
- if (inUse) {
- throw Error("One or more tokens in this family are in use");
- }
-
- for (const token of tokens) {
- if (logger.shouldLogTrace()) {
- logger.trace(
- `deleting token in ${token.tokenIssuePubHash} token family`
- );
- }
- await tx.tokens.delete(token.tokenUsePub);
- }
- });
-
- return {};
-}