gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated (050999a9 -> 096d2118)


From: gnunet
Subject: [taler-wallet-core] branch master updated (050999a9 -> 096d2118)
Date: Wed, 13 Jan 2021 00:55:50 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a change to branch master
in repository wallet-core.

    from 050999a9 implement infrastructure for future DB migrations via backup
     new 7de5ceaa auto format
     new 096d2118 typo

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/integrationtests/harness.ts                |  4 ++-
 .../src/integrationtests/test-claim-loop.ts        |  5 +---
 .../src/integrationtests/test-payment-transient.ts |  2 +-
 .../integrationtests/test-timetravel-withdraw.ts   |  4 +--
 .../src/integrationtests/test-tipping.ts           |  6 +----
 packages/taler-wallet-core/src/db.ts               |  2 +-
 .../taler-wallet-core/src/operations/backup.ts     | 29 ++++++++++++++--------
 .../taler-wallet-core/src/operations/refresh.ts    |  5 +++-
 .../taler-wallet-core/src/operations/refund.ts     | 16 ++++++++----
 packages/taler-wallet-core/src/operations/state.ts |  2 +-
 packages/taler-wallet-core/src/operations/tip.ts   |  2 +-
 .../src/operations/transactions.ts                 |  4 +--
 .../taler-wallet-core/src/operations/withdraw.ts   |  2 --
 packages/taler-wallet-core/src/types/dbTypes.ts    |  9 +++----
 .../taler-wallet-core/src/types/notifications.ts   |  1 -
 packages/taler-wallet-core/src/wallet.ts           |  2 +-
 16 files changed, 50 insertions(+), 45 deletions(-)

diff --git a/packages/taler-wallet-cli/src/integrationtests/harness.ts 
b/packages/taler-wallet-cli/src/integrationtests/harness.ts
index 4985c5fc..6d1d4e16 100644
--- a/packages/taler-wallet-cli/src/integrationtests/harness.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/harness.ts
@@ -1457,7 +1457,9 @@ export async function runTestWithState(
 
   const handleSignal = (s: string) => {
     gc.shutdownSync();
-    console.warn("**** received fatal proces event, shutting down test 
harness");
+    console.warn(
+      "**** received fatal proces event, shutting down test harness",
+    );
     status = "fail";
     p.reject(Error("caught signal"));
   };
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-claim-loop.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-claim-loop.ts
index 5a0540e9..4a4cd555 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-claim-loop.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-claim-loop.ts
@@ -17,10 +17,7 @@
 /**
  * Imports.
  */
-import {
-  GlobalTestState,
-  MerchantPrivateApi,
-} from "./harness";
+import { GlobalTestState, MerchantPrivateApi } from "./harness";
 import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers";
 import { URL } from "url";
 
diff --git 
a/packages/taler-wallet-cli/src/integrationtests/test-payment-transient.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-payment-transient.ts
index 73973bdc..67038989 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-payment-transient.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-transient.ts
@@ -169,4 +169,4 @@ export async function runPaymentTransientTest(t: 
GlobalTestState) {
       `expected status 202 (after paying), but got 
${publicOrderStatusResp.status}`,
     );
   }
-}
\ No newline at end of file
+}
diff --git 
a/packages/taler-wallet-cli/src/integrationtests/test-timetravel-withdraw.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-timetravel-withdraw.ts
index b4de50b9..e74a49c9 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-timetravel-withdraw.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-timetravel-withdraw.ts
@@ -28,7 +28,7 @@ import { Duration, TransactionType } from "taler-wallet-core";
 /**
  * Basic time travel test.
  */
-export async function runTimetravelWithdrawTest(t: GlobalTestState){
+export async function runTimetravelWithdrawTest(t: GlobalTestState) {
   // Set up test environment
 
   const {
@@ -87,4 +87,4 @@ export async function runTimetravelWithdrawTest(t: 
GlobalTestState){
   // This doesn't work yet, see https://bugs.taler.net/n/6585
 
   // await wallet.runUntilDone({ maxRetries: 5 });
-}
\ No newline at end of file
+}
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts
index 01ec6c1b..21422c42 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts
@@ -17,11 +17,7 @@
 /**
  * Imports.
  */
-import {
-  GlobalTestState,
-  MerchantPrivateApi,
-  BankApi,
-} from "./harness";
+import { GlobalTestState, MerchantPrivateApi, BankApi } from "./harness";
 import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers";
 
 /**
diff --git a/packages/taler-wallet-core/src/db.ts 
b/packages/taler-wallet-core/src/db.ts
index aed2ce5c..a536f29b 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -143,7 +143,7 @@ export async function openTalerDatabase(
         value: TALER_DB_NAME,
       });
     } else {
-      currentMainVersion = dbVersionRecord.key;
+      currentMainVersion = dbVersionRecord.value;
     }
   });
 
diff --git a/packages/taler-wallet-core/src/operations/backup.ts 
b/packages/taler-wallet-core/src/operations/backup.ts
index a9f1fc43..8bc82ce6 100644
--- a/packages/taler-wallet-core/src/operations/backup.ts
+++ b/packages/taler-wallet-core/src/operations/backup.ts
@@ -1274,7 +1274,9 @@ export async function importBackup(
               break;
             default:
               logger.warn(
-                `got backup purchase abort_status 
${j2s(backupPurchase.abort_status)}`,
+                `got backup purchase abort_status ${j2s(
+                  backupPurchase.abort_status,
+                )}`,
               );
               throw Error("not reachable");
           }
@@ -1338,8 +1340,7 @@ export async function importBackup(
             timestampAccept: backupPurchase.timestamp_accept,
             timestampFirstSuccessfulPay:
               backupPurchase.timestamp_first_successful_pay,
-            timestampLastRefundStatus:
-              undefined,
+            timestampLastRefundStatus: undefined,
             merchantPaySig: backupPurchase.merchant_pay_sig,
             lastSessionId: undefined,
             abortStatus,
@@ -1567,14 +1568,20 @@ export async function runBackupCycle(ws: 
InternalWalletState): Promise<void> {
         continue;
       }
       const p = proposalId;
-      await ws.db.runWithWriteTransaction([Stores.backupProviders], async (tx) 
=> {
-        const provRec = await tx.get(Stores.backupProviders, provider.baseUrl);
-        checkDbInvariant(!!provRec);
-        const ids = new Set(provRec.paymentProposalIds)
-        ids.add(p);
-        provRec.paymentProposalIds = Array.from(ids);
-        await tx.put(Stores.backupProviders, provRec);
-      });
+      await ws.db.runWithWriteTransaction(
+        [Stores.backupProviders],
+        async (tx) => {
+          const provRec = await tx.get(
+            Stores.backupProviders,
+            provider.baseUrl,
+          );
+          checkDbInvariant(!!provRec);
+          const ids = new Set(provRec.paymentProposalIds);
+          ids.add(p);
+          provRec.paymentProposalIds = Array.from(ids);
+          await tx.put(Stores.backupProviders, provRec);
+        },
+      );
       const confirmRes = await confirmPay(ws, proposalId);
       switch (confirmRes.type) {
         case ConfirmPayResultType.Pending:
diff --git a/packages/taler-wallet-core/src/operations/refresh.ts 
b/packages/taler-wallet-core/src/operations/refresh.ts
index 2d80f0a5..a6c311f4 100644
--- a/packages/taler-wallet-core/src/operations/refresh.ts
+++ b/packages/taler-wallet-core/src/operations/refresh.ts
@@ -150,7 +150,10 @@ async function refreshCreateSession(
     oldDenom.feeRefresh,
   ).amount;
 
-  const newCoinDenoms = selectWithdrawalDenominations(availableAmount, 
availableDenoms);
+  const newCoinDenoms = selectWithdrawalDenominations(
+    availableAmount,
+    availableDenoms,
+  );
 
   if (newCoinDenoms.selectedDenoms.length === 0) {
     logger.trace(
diff --git a/packages/taler-wallet-core/src/operations/refund.ts 
b/packages/taler-wallet-core/src/operations/refund.ts
index 7ffcdb6d..13df438e 100644
--- a/packages/taler-wallet-core/src/operations/refund.ts
+++ b/packages/taler-wallet-core/src/operations/refund.ts
@@ -503,7 +503,9 @@ export async function applyRefund(
   let amountRefundGranted = Amounts.getZero(
     purchase.download.contractData.amount.currency,
   );
-  let amountRefundGone = 
Amounts.getZero(purchase.download.contractData.amount.currency);
+  let amountRefundGone = Amounts.getZero(
+    purchase.download.contractData.amount.currency,
+  );
 
   let pendingAtExchange = false;
 
@@ -545,7 +547,8 @@ export async function applyRefund(
       summary: purchase.download.contractData.summary,
       fulfillmentMessage: purchase.download.contractData.fulfillmentMessage,
       summary_i18n: purchase.download.contractData.summaryI18n,
-      fulfillmentMessage_i18n: 
purchase.download.contractData.fulfillmentMessageI18n,
+      fulfillmentMessage_i18n:
+        purchase.download.contractData.fulfillmentMessageI18n,
     },
   };
 }
@@ -669,9 +672,12 @@ async function processPurchaseQueryRefundImpl(
           purchase.payCoinSelection.coinContributions[i],
         ),
         rtransaction_id: 0,
-        execution_time: 
timestampAddDuration(purchase.download.contractData.timestamp, {
-          d_ms: 1000,
-        }),
+        execution_time: timestampAddDuration(
+          purchase.download.contractData.timestamp,
+          {
+            d_ms: 1000,
+          },
+        ),
       });
     }
     await acceptRefunds(ws, proposalId, refunds, RefundReason.AbortRefund);
diff --git a/packages/taler-wallet-core/src/operations/state.ts 
b/packages/taler-wallet-core/src/operations/state.ts
index 60aee4c3..645ad8ad 100644
--- a/packages/taler-wallet-core/src/operations/state.ts
+++ b/packages/taler-wallet-core/src/operations/state.ts
@@ -57,7 +57,7 @@ export class InternalWalletState {
 
   constructor(
     // FIXME: Make this a getter and make
-    // the actual value nullable. 
+    // the actual value nullable.
     // Check if we are in a DB migration / garbage collection
     // and throw an error in that case.
     public db: Database<typeof Stores>,
diff --git a/packages/taler-wallet-core/src/operations/tip.ts 
b/packages/taler-wallet-core/src/operations/tip.ts
index 68b5a2ad..328fe2cf 100644
--- a/packages/taler-wallet-core/src/operations/tip.ts
+++ b/packages/taler-wallet-core/src/operations/tip.ts
@@ -227,7 +227,7 @@ async function processTipImpl(
         planchetIndex: planchets.length,
         secretSeed: tipRecord.secretSeed,
       };
-      logger.trace(`deriving tip planchet: ${j2s(deriveReq)}`)
+      logger.trace(`deriving tip planchet: ${j2s(deriveReq)}`);
       const p = await ws.cryptoApi.createTipPlanchet(deriveReq);
       logger.trace(`derive result: ${j2s(p)}`);
       denomForPlanchet[planchets.length] = denom;
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts 
b/packages/taler-wallet-core/src/operations/transactions.ts
index a862d24e..c7e6a9c5 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -269,9 +269,7 @@ export async function getTransactions(
           );
           let r0: WalletRefundItem | undefined;
           let amountRaw = Amounts.getZero(contractData.amount.currency);
-          let amountEffective = Amounts.getZero(
-            contractData.amount.currency,
-          );
+          let amountEffective = Amounts.getZero(contractData.amount.currency);
           for (const rk of Object.keys(pr.refunds)) {
             const refund = pr.refunds[rk];
             const myGroupKey = `${refund.executionTime.t_ms}`;
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts 
b/packages/taler-wallet-core/src/operations/withdraw.ts
index c2dfcd1c..d28bea1e 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -86,7 +86,6 @@ export function isWithdrawableDenom(d: DenominationRecord): 
boolean {
   return started && stillOkay && !d.isRevoked;
 }
 
-
 /**
  * Get a list of denominations (with repetitions possible)
  * whose total value is as close as possible to the available
@@ -562,7 +561,6 @@ export async function updateWithdrawalDenoms(
   }
 }
 
-
 async function incrementWithdrawalRetry(
   ws: InternalWalletState,
   withdrawalGroupId: string,
diff --git a/packages/taler-wallet-core/src/types/dbTypes.ts 
b/packages/taler-wallet-core/src/types/dbTypes.ts
index 0cfc8801..60752fd6 100644
--- a/packages/taler-wallet-core/src/types/dbTypes.ts
+++ b/packages/taler-wallet-core/src/types/dbTypes.ts
@@ -1587,11 +1587,10 @@ class TipsStore extends Store<"tips", TipRecord> {
     "tipsByMerchantTipIdAndOriginIndex",
     [string, string],
     TipRecord
-  >(
-    this,
-    "tipsByMerchantTipIdAndOriginIndex",
-    ["merchantTipId", "merchantBaseUrl"],
-  );
+  >(this, "tipsByMerchantTipIdAndOriginIndex", [
+    "merchantTipId",
+    "merchantBaseUrl",
+  ]);
 }
 
 class WithdrawalGroupsStore extends Store<
diff --git a/packages/taler-wallet-core/src/types/notifications.ts 
b/packages/taler-wallet-core/src/types/notifications.ts
index 9ddcf4fa..8601c65b 100644
--- a/packages/taler-wallet-core/src/types/notifications.ts
+++ b/packages/taler-wallet-core/src/types/notifications.ts
@@ -124,7 +124,6 @@ export interface RefreshRefusedNotification {
   type: NotificationType.RefreshUnwarranted;
 }
 
-
 export interface ReserveConfirmedNotification {
   type: NotificationType.ReserveConfirmed;
 }
diff --git a/packages/taler-wallet-core/src/wallet.ts 
b/packages/taler-wallet-core/src/wallet.ts
index 631ac950..65b816cc 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -979,7 +979,7 @@ export class Wallet {
   async getBackupStatus(): Promise<BackupInfo> {
     return getBackupInfo(this.ws);
   }
-  
+
   /**
    * Implementation of the "wallet-core" API.
    */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]