diff options
author | Florian Dold <florian@dold.me> | 2023-05-24 14:09:25 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-05-24 14:09:25 +0200 |
commit | f14c7e5f2a1495613c16bcf1acf74d08fd91fb48 (patch) | |
tree | b9bf7c35fe54ff6b60341108ef4df187e830c646 /packages/taler-wallet-core/src/operations/common.ts | |
parent | 4627c0781c982421585e4adf9e3320b56f644965 (diff) | |
download | wallet-core-f14c7e5f2a1495613c16bcf1acf74d08fd91fb48.tar.xz |
wallet-core: remove deprecated txid parsing
Diffstat (limited to 'packages/taler-wallet-core/src/operations/common.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/common.ts | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/packages/taler-wallet-core/src/operations/common.ts b/packages/taler-wallet-core/src/operations/common.ts index c3dc622d7..95551010c 100644 --- a/packages/taler-wallet-core/src/operations/common.ts +++ b/packages/taler-wallet-core/src/operations/common.ts @@ -362,42 +362,6 @@ export enum TombstoneTag { DeletePeerPushCredit = "delete-peer-push-credit", } -/** - * Create an event ID from the type and the primary key for the event. - * - * @deprecated use constructTransactionIdentifier instead - */ -export function makeTransactionId( - type: TransactionType, - ...args: string[] -): string { - return `txn:${type}:${args.map((x) => encodeURIComponent(x)).join(":")}`; -} - -export function parseId( - idType: "txn" | "tmb" | "any", - txId: string, -): { - type: TransactionType; - args: string[]; -} { - const txnParts = txId.split(":"); - if (txnParts.length < 3) { - throw Error("id should have al least 3 parts separated by ':'"); - } - const [prefix, typeStr, ...args] = txnParts; - const type = typeStr as TransactionType; - - if (idType != "any" && prefix !== idType) { - throw Error(`id should start with ${idType}`); - } - - if (args.length === 0) { - throw Error("id should have one or more arguments"); - } - - return { type, args }; -} /** * Create an event ID from the type and the primary key for the event. |