diff options
Diffstat (limited to 'packages/taler-wallet-core/src/pay-peer-push-credit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-push-credit.ts | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/pay-peer-push-credit.ts index 281b3ff61..93f1a63a7 100644 --- a/packages/taler-wallet-core/src/pay-peer-push-credit.ts +++ b/packages/taler-wallet-core/src/pay-peer-push-credit.ts @@ -114,7 +114,7 @@ export class PeerPushCreditTransactionContext implements TransactionContext { async deleteTransaction(): Promise<void> { const { wex, peerPushCreditId } = this; await wex.db.runReadWriteTx( - ["withdrawalGroups", "peerPushCredit", "tombstones"], + { storeNames: ["withdrawalGroups", "peerPushCredit", "tombstones"] }, async (tx) => { const pushInc = await tx.peerPushCredit.get(peerPushCreditId); if (!pushInc) { @@ -143,7 +143,7 @@ export class PeerPushCreditTransactionContext implements TransactionContext { async suspendTransaction(): Promise<void> { const { wex, peerPushCreditId, taskId: retryTag, transactionId } = this; const transitionInfo = await wex.db.runReadWriteTx( - ["peerPushCredit"], + { storeNames: ["peerPushCredit"] }, async (tx) => { const pushCreditRec = await tx.peerPushCredit.get(peerPushCreditId); if (!pushCreditRec) { @@ -197,7 +197,7 @@ export class PeerPushCreditTransactionContext implements TransactionContext { async abortTransaction(): Promise<void> { const { wex, peerPushCreditId, taskId: retryTag, transactionId } = this; const transitionInfo = await wex.db.runReadWriteTx( - ["peerPushCredit"], + { storeNames: ["peerPushCredit"] }, async (tx) => { const pushCreditRec = await tx.peerPushCredit.get(peerPushCreditId); if (!pushCreditRec) { @@ -254,7 +254,7 @@ export class PeerPushCreditTransactionContext implements TransactionContext { async resumeTransaction(): Promise<void> { const { wex, peerPushCreditId, taskId: retryTag, transactionId } = this; const transitionInfo = await wex.db.runReadWriteTx( - ["peerPushCredit"], + { storeNames: ["peerPushCredit"] }, async (tx) => { const pushCreditRec = await tx.peerPushCredit.get(peerPushCreditId); if (!pushCreditRec) { @@ -307,7 +307,7 @@ export class PeerPushCreditTransactionContext implements TransactionContext { async failTransaction(): Promise<void> { const { wex, peerPushCreditId, taskId: retryTag, transactionId } = this; const transitionInfo = await wex.db.runReadWriteTx( - ["peerPushCredit"], + { storeNames: ["peerPushCredit"] }, async (tx) => { const pushCreditRec = await tx.peerPushCredit.get(peerPushCreditId); if (!pushCreditRec) { @@ -365,7 +365,7 @@ export async function preparePeerPushCredit( } const existing = await wex.db.runReadOnlyTx( - ["contractTerms", "peerPushCredit"], + { storeNames: ["contractTerms", "peerPushCredit"] }, async (tx) => { const existingPushInc = await tx.peerPushCredit.indexes.byExchangeAndContractPriv.get([ @@ -460,7 +460,7 @@ export async function preparePeerPushCredit( ); const transitionInfo = await wex.db.runReadWriteTx( - ["contractTerms", "peerPushCredit"], + { storeNames: ["contractTerms", "peerPushCredit"] }, async (tx) => { const rec: PeerPushPaymentIncomingRecord = { peerPushCreditId, @@ -545,7 +545,7 @@ async function longpollKycStatus( kycStatusRes.status === HttpStatusCode.NoContent ) { const transitionInfo = await wex.db.runReadWriteTx( - ["peerPushCredit"], + { storeNames: ["peerPushCredit"] }, async (tx) => { const peerInc = await tx.peerPushCredit.get(peerPushCreditId); if (!peerInc) { @@ -606,7 +606,7 @@ async function processPeerPushCreditKycRequired( const kycStatus = await kycStatusRes.json(); logger.info(`kyc status: ${j2s(kycStatus)}`); const { transitionInfo, result } = await wex.db.runReadWriteTx( - ["peerPushCredit"], + { storeNames: ["peerPushCredit"] }, async (tx) => { const peerInc = await tx.peerPushCredit.get(peerPushCreditId); if (!peerInc) { @@ -731,14 +731,16 @@ async function handlePendingMerge( }); const txRes = await wex.db.runReadWriteTx( - [ - "contractTerms", - "peerPushCredit", - "withdrawalGroups", - "reserves", - "exchanges", - "exchangeDetails", - ], + { + storeNames: [ + "contractTerms", + "peerPushCredit", + "withdrawalGroups", + "reserves", + "exchanges", + "exchangeDetails", + ], + }, async (tx) => { const peerInc = await tx.peerPushCredit.get(peerPushCreditId); if (!peerInc) { @@ -798,7 +800,7 @@ async function handlePendingWithdrawing( const wgId = peerInc.withdrawalGroupId; let finished: boolean = false; const transitionInfo = await wex.db.runReadWriteTx( - ["peerPushCredit", "withdrawalGroups"], + { storeNames: ["peerPushCredit", "withdrawalGroups"] }, async (tx) => { const ppi = await tx.peerPushCredit.get(peerInc.peerPushCreditId); if (!ppi) { @@ -846,7 +848,7 @@ export async function processPeerPushCredit( let peerInc: PeerPushPaymentIncomingRecord | undefined; let contractTerms: PeerContractTerms | undefined; await wex.db.runReadWriteTx( - ["contractTerms", "peerPushCredit"], + { storeNames: ["contractTerms", "peerPushCredit"] }, async (tx) => { peerInc = await tx.peerPushCredit.get(peerPushCreditId); if (!peerInc) { @@ -915,7 +917,7 @@ export async function confirmPeerPushCredit( logger.trace(`confirming peer-push-credit ${peerPushCreditId}`); await wex.db.runReadWriteTx( - ["contractTerms", "peerPushCredit"], + { storeNames: ["contractTerms", "peerPushCredit"] }, async (tx) => { peerInc = await tx.peerPushCredit.get(peerPushCreditId); if (!peerInc) { |