diff options
author | Sebastian <sebasjm@gmail.com> | 2023-05-22 13:13:40 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-05-22 13:13:40 -0300 |
commit | 708cf016e4ab1e749b86151aa2a9cc548675d63c (patch) | |
tree | 54c5bc6de7a62a6088383fafc8e3970979b1603e /packages/taler-wallet-core/src/operations/common.ts | |
parent | 76d2524b8b59ca52477f4b0686ccdcee371ecb9e (diff) | |
download | wallet-core-708cf016e4ab1e749b86151aa2a9cc548675d63c.tar.xz |
nominal typing for taskId, also fixing transactionId reference
Diffstat (limited to 'packages/taler-wallet-core/src/operations/common.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/common.ts | 10 |
1 files changed, 4 insertions, 6 deletions
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<T1, T2>( ws: InternalWalletState, - opId: string, + opId: TaskId, f: () => Promise<OperationAttemptResult<T1, T2>>, ): Promise<OperationAttemptResult<T1, T2>> { 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(":")}`; } |