From 708cf016e4ab1e749b86151aa2a9cc548675d63c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 22 May 2023 13:13:40 -0300 Subject: nominal typing for taskId, also fixing transactionId reference --- packages/taler-wallet-core/src/operations/common.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/common.ts') diff --git a/packages/taler-wallet-core/src/operations/common.ts b/packages/taler-wallet-core/src/operations/common.ts index 55015f2e0..c3dc622d7 100644 --- a/packages/taler-wallet-core/src/operations/common.ts +++ b/packages/taler-wallet-core/src/operations/common.ts @@ -54,6 +54,7 @@ import { RetryInfo, } from "../util/retries.js"; import { CryptoApiStoppedError } from "../crypto/workers/crypto-dispatcher.js"; +import { TaskId } from "../pending-types.js"; const logger = new Logger("operations/common.ts"); @@ -260,7 +261,7 @@ export async function storeOperationPending( export async function runOperationWithErrorReporting( ws: InternalWalletState, - opId: string, + opId: TaskId, f: () => Promise>, ): Promise> { let maybeError: TalerErrorDetail | undefined; @@ -369,7 +370,7 @@ export enum TombstoneTag { export function makeTransactionId( type: TransactionType, ...args: string[] -): TransactionIdStr { +): string { return `txn:${type}:${args.map((x) => encodeURIComponent(x)).join(":")}`; } @@ -401,10 +402,7 @@ export function parseId( /** * Create an event ID from the type and the primary key for the event. */ -export function makeTombstoneId( - type: TombstoneTag, - ...args: string[] -): TombstoneIdStr { +export function makeTombstoneId(type: TombstoneTag, ...args: string[]): string { return `tmb:${type}:${args.map((x) => encodeURIComponent(x)).join(":")}`; } -- cgit v1.2.3