diff options
author | Florian Dold <florian@dold.me> | 2023-09-07 20:35:46 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-08 00:12:52 +0200 |
commit | c660db82c12e08020661828f1d8383baa7ef0e02 (patch) | |
tree | 655b3aa9cf91fae4a4b4052356b97a9b3b119376 /packages/taler-wallet-core/src/operations/common.ts | |
parent | 33f2798004b1235eeb33a66d08bf22243f5ae566 (diff) | |
download | wallet-core-c660db82c12e08020661828f1d8383baa7ef0e02.tar.xz |
wallet-core: address DB FIXMEs, systematic state numbering
Diffstat (limited to 'packages/taler-wallet-core/src/operations/common.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/common.ts | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/packages/taler-wallet-core/src/operations/common.ts b/packages/taler-wallet-core/src/operations/common.ts index e96beb5b2..680874dfa 100644 --- a/packages/taler-wallet-core/src/operations/common.ts +++ b/packages/taler-wallet-core/src/operations/common.ts @@ -52,9 +52,9 @@ import { BackupProviderRecord, DepositGroupRecord, PeerPullPaymentIncomingRecord, - PeerPullPaymentInitiationRecord, + PeerPullCreditRecord, PeerPushPaymentIncomingRecord, - PeerPushPaymentInitiationRecord, + PeerPushDebitRecord, PurchaseRecord, RecoupGroupRecord, RefreshGroupRecord, @@ -271,7 +271,7 @@ function convertTaskToTransactionId( case PendingTaskType.PeerPullDebit: return constructTransactionIdentifier({ tag: TransactionType.PeerPullDebit, - peerPullPaymentIncomingId: parsedTaskId.peerPullPaymentIncomingId, + peerPullDebitId: parsedTaskId.peerPullDebitId, }); // FIXME: This doesn't distinguish internal-withdrawal. // Maybe we should have a different task type for that as well? @@ -284,7 +284,7 @@ function convertTaskToTransactionId( case PendingTaskType.PeerPushCredit: return constructTransactionIdentifier({ tag: TransactionType.PeerPushCredit, - peerPushPaymentIncomingId: parsedTaskId.peerPushPaymentIncomingId, + peerPushCreditId: parsedTaskId.peerPushCreditId, }); case PendingTaskType.Deposit: return constructTransactionIdentifier({ @@ -836,9 +836,9 @@ export type ParsedTaskIdentifier = | { tag: PendingTaskType.Deposit; depositGroupId: string } | { tag: PendingTaskType.ExchangeCheckRefresh; exchangeBaseUrl: string } | { tag: PendingTaskType.ExchangeUpdate; exchangeBaseUrl: string } - | { tag: PendingTaskType.PeerPullDebit; peerPullPaymentIncomingId: string } + | { tag: PendingTaskType.PeerPullDebit; peerPullDebitId: string } | { tag: PendingTaskType.PeerPullCredit; pursePub: string } - | { tag: PendingTaskType.PeerPushCredit; peerPushPaymentIncomingId: string } + | { tag: PendingTaskType.PeerPushCredit; peerPushCreditId: string } | { tag: PendingTaskType.PeerPushDebit; pursePub: string } | { tag: PendingTaskType.Purchase; proposalId: string } | { tag: PendingTaskType.Recoup; recoupGroupId: string } @@ -865,9 +865,9 @@ export function parseTaskIdentifier(x: string): ParsedTaskIdentifier { case PendingTaskType.PeerPullCredit: return { tag: type, pursePub: rest[0] }; case PendingTaskType.PeerPullDebit: - return { tag: type, peerPullPaymentIncomingId: rest[0] }; + return { tag: type, peerPullDebitId: rest[0] }; case PendingTaskType.PeerPushCredit: - return { tag: type, peerPushPaymentIncomingId: rest[0] }; + return { tag: type, peerPushCreditId: rest[0] }; case PendingTaskType.PeerPushDebit: return { tag: type, pursePub: rest[0] }; case PendingTaskType.Purchase: @@ -896,9 +896,9 @@ export function constructTaskIdentifier(p: ParsedTaskIdentifier): TaskId { case PendingTaskType.ExchangeUpdate: return `${p.tag}:${p.exchangeBaseUrl}` as TaskId; case PendingTaskType.PeerPullDebit: - return `${p.tag}:${p.peerPullPaymentIncomingId}` as TaskId; + return `${p.tag}:${p.peerPullDebitId}` as TaskId; case PendingTaskType.PeerPushCredit: - return `${p.tag}:${p.peerPushPaymentIncomingId}` as TaskId; + return `${p.tag}:${p.peerPushCreditId}` as TaskId; case PendingTaskType.PeerPullCredit: return `${p.tag}:${p.pursePub}` as TaskId; case PendingTaskType.PeerPushDebit: @@ -950,23 +950,23 @@ export namespace TaskIdentifiers { return `${PendingTaskType.Backup}:${backupRecord.baseUrl}` as TaskId; } export function forPeerPushPaymentInitiation( - ppi: PeerPushPaymentInitiationRecord, + ppi: PeerPushDebitRecord, ): TaskId { return `${PendingTaskType.PeerPushDebit}:${ppi.pursePub}` as TaskId; } export function forPeerPullPaymentInitiation( - ppi: PeerPullPaymentInitiationRecord, + ppi: PeerPullCreditRecord, ): TaskId { return `${PendingTaskType.PeerPullCredit}:${ppi.pursePub}` as TaskId; } export function forPeerPullPaymentDebit( ppi: PeerPullPaymentIncomingRecord, ): TaskId { - return `${PendingTaskType.PeerPullDebit}:${ppi.peerPullPaymentIncomingId}` as TaskId; + return `${PendingTaskType.PeerPullDebit}:${ppi.peerPullDebitId}` as TaskId; } export function forPeerPushCredit( ppi: PeerPushPaymentIncomingRecord, ): TaskId { - return `${PendingTaskType.PeerPushCredit}:${ppi.peerPushPaymentIncomingId}` as TaskId; + return `${PendingTaskType.PeerPushCredit}:${ppi.peerPushCreditId}` as TaskId; } } |