gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] 04/04: re-indent with latest version of prettier


From: gnunet
Subject: [taler-wallet-core] 04/04: re-indent with latest version of prettier
Date: Wed, 03 Jun 2020 13:16:36 +0200

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

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

commit 83af702f1cae043902e23e9358c3e036ddca8d33
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Wed Jun 3 16:46:25 2020 +0530

    re-indent with latest version of prettier
---
 src/android/index.ts                       |  7 +++++--
 src/crypto/workers/cryptoImplementation.ts | 16 +++++++++++++---
 src/headless/integrationtest.ts            |  8 ++++++--
 src/headless/taler-wallet-cli.ts           |  5 ++++-
 src/operations/history.ts                  | 10 ++++------
 src/operations/pay.ts                      |  5 +++--
 src/operations/pending.ts                  | 14 ++++++++------
 src/operations/reserves.ts                 |  6 +++++-
 src/operations/tip.ts                      |  5 ++++-
 src/operations/withdraw.ts                 | 14 ++++++--------
 src/types/talerTypes.ts                    |  8 +++++---
 src/types/transactions.ts                  |  2 +-
 src/types/walletTypes.ts                   |  3 +--
 src/util/amounts.ts                        |  2 +-
 src/util/time.ts                           |  1 -
 src/webex/pages/popup.tsx                  | 10 ++++++----
 src/webex/pages/welcome.tsx                | 23 ++++++++++-------------
 src/webex/pages/withdraw.tsx               | 23 +++++++++++++----------
 src/webex/permissions.ts                   |  2 +-
 19 files changed, 96 insertions(+), 68 deletions(-)

diff --git a/src/android/index.ts b/src/android/index.ts
index 0e8efd84..a10236ce 100644
--- a/src/android/index.ts
+++ b/src/android/index.ts
@@ -33,7 +33,10 @@ import {
 } from "../util/http";
 import { NodeHttpLib } from "../headless/NodeHttpLib";
 import { WalletNotification } from "../types/notifications";
-import { WALLET_EXCHANGE_PROTOCOL_VERSION, WALLET_MERCHANT_PROTOCOL_VERSION } 
from "../operations/versions";
+import {
+  WALLET_EXCHANGE_PROTOCOL_VERSION,
+  WALLET_MERCHANT_PROTOCOL_VERSION,
+} from "../operations/versions";
 
 // @ts-ignore: special built-in module
 //import akono = require("akono");
@@ -159,7 +162,7 @@ class AndroidWalletMessageHandler {
           supported_protocol_versions: {
             exchange: WALLET_EXCHANGE_PROTOCOL_VERSION,
             merchant: WALLET_MERCHANT_PROTOCOL_VERSION,
-          }
+          },
         };
       }
       case "getTransactions": {
diff --git a/src/crypto/workers/cryptoImplementation.ts 
b/src/crypto/workers/cryptoImplementation.ts
index dc0452dc..e0ba24e4 100644
--- a/src/crypto/workers/cryptoImplementation.ts
+++ b/src/crypto/workers/cryptoImplementation.ts
@@ -65,7 +65,11 @@ import {
 } from "../talerCrypto";
 import { randomBytes } from "../primitives/nacl-fast";
 import { kdf } from "../primitives/kdf";
-import { Timestamp, getTimestampNow, timestampTruncateToSecond } from 
"../../util/time";
+import {
+  Timestamp,
+  getTimestampNow,
+  timestampTruncateToSecond,
+} from "../../util/time";
 
 enum SignaturePurpose {
   RESERVE_WITHDRAW = 1200,
@@ -368,7 +372,10 @@ export class CryptoImplementation {
 
     for (const ncd of newCoinDenoms.selectedDenoms) {
       const t = Amounts.add(ncd.denom.value, ncd.denom.feeWithdraw).amount;
-      valueWithFee = Amounts.add(valueWithFee, Amounts.mult(t, 
ncd.count).amount).amount;
+      valueWithFee = Amounts.add(
+        valueWithFee,
+        Amounts.mult(t, ncd.count).amount,
+      ).amount;
     }
 
     // melt fee
@@ -406,7 +413,10 @@ export class CryptoImplementation {
           const coinNumber = planchets.length;
           const transferPriv = decodeCrock(transferPrivs[i]);
           const oldCoinPub = decodeCrock(meltCoin.coinPub);
-          const transferSecret = keyExchangeEcdheEddsa(transferPriv, 
oldCoinPub);
+          const transferSecret = keyExchangeEcdheEddsa(
+            transferPriv,
+            oldCoinPub,
+          );
           const fresh = setupRefreshPlanchet(transferSecret, coinNumber);
           const coinPriv = fresh.coinPriv;
           const coinPub = fresh.coinPub;
diff --git a/src/headless/integrationtest.ts b/src/headless/integrationtest.ts
index 5beb7b79..db96d57c 100644
--- a/src/headless/integrationtest.ts
+++ b/src/headless/integrationtest.ts
@@ -87,7 +87,9 @@ async function makePayment(
   };
 }
 
-export async function runIntegrationTest(args: IntegrationTestArgs): 
Promise<void> {
+export async function runIntegrationTest(
+  args: IntegrationTestArgs,
+): Promise<void> {
   logger.info("running test with arguments", args);
 
   const parsedSpendAmount = Amounts.parseOrThrow(args.amountToSpend);
@@ -191,7 +193,9 @@ export async function runIntegrationTest(args: 
IntegrationTestArgs): Promise<voi
   );
 }
 
-export async function runIntegrationTestBasic(cfg: Configuration): 
Promise<void> {
+export async function runIntegrationTestBasic(
+  cfg: Configuration,
+): Promise<void> {
   const walletDbPath = cfg.getString("integrationtest", "walletdb").required();
 
   const bankBaseUrl = cfg
diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts
index 72d00a06..5a792ee0 100644
--- a/src/headless/taler-wallet-cli.ts
+++ b/src/headless/taler-wallet-cli.ts
@@ -649,7 +649,10 @@ testCli
       args.genTipUri.merchant ?? "https://backend.test.taler.net/";,
       args.genTipUri.merchantApiKey ?? "sandbox",
     );
-    const tipUri = await merchantBackend.authorizeTip(args.genTipUri.amount, 
"test");
+    const tipUri = await merchantBackend.authorizeTip(
+      args.genTipUri.amount,
+      "test",
+    );
     console.log(tipUri);
   });
 
diff --git a/src/operations/history.ts b/src/operations/history.ts
index 4e43596f..f04dad11 100644
--- a/src/operations/history.ts
+++ b/src/operations/history.ts
@@ -18,11 +18,7 @@
  * Imports.
  */
 import { InternalWalletState } from "./state";
-import {
-  Stores,
-  ProposalStatus,
-  ProposalRecord,
-} from "../types/dbTypes";
+import { Stores, ProposalStatus, ProposalRecord } from "../types/dbTypes";
 import { Amounts } from "../util/amounts";
 import { AmountJson } from "../util/amounts";
 import {
@@ -216,7 +212,9 @@ export async function getHistory(
               HistoryEventType.Withdrawn,
               wsr.withdrawalGroupId,
             ),
-            amountWithdrawnEffective: 
Amounts.stringify(wsr.denomsSel.totalCoinValue),
+            amountWithdrawnEffective: Amounts.stringify(
+              wsr.denomsSel.totalCoinValue,
+            ),
             amountWithdrawnRaw: Amounts.stringify(wsr.rawWithdrawalAmount),
             exchangeBaseUrl: wsr.exchangeBaseUrl,
             timestamp: wsr.timestampFinish,
diff --git a/src/operations/pay.ts b/src/operations/pay.ts
index b2627f74..7faace46 100644
--- a/src/operations/pay.ts
+++ b/src/operations/pay.ts
@@ -165,7 +165,7 @@ export async function getTotalPaymentCost(
     costs.push(refreshCost);
   }
   return {
-    totalCost: Amounts.sum(costs).amount
+    totalCost: Amounts.sum(costs).amount,
   };
 }
 
@@ -195,7 +195,8 @@ export function selectPayCoins(
       Amounts.cmp(o1.feeDeposit, o2.feeDeposit) ||
       strcmp(o1.denomPub, o2.denomPub),
   );
-  const paymentAmount = Amounts.add(contractTermsAmount, 
customerWireFees).amount;
+  const paymentAmount = Amounts.add(contractTermsAmount, customerWireFees)
+    .amount;
   const currency = paymentAmount.currency;
   let amountPayRemaining = paymentAmount;
   let amountDepositFeeLimitRemaining = depositFeeLimit;
diff --git a/src/operations/pending.ts b/src/operations/pending.ts
index c793f5f0..cf9b306d 100644
--- a/src/operations/pending.ts
+++ b/src/operations/pending.ts
@@ -260,12 +260,14 @@ async function gatherWithdrawalPending(
     }
     let numCoinsWithdrawn = 0;
     let numCoinsTotal = 0;
-    await tx.iterIndexed(Stores.planchets.byGroup, 
wsr.withdrawalGroupId).forEach((x) => {
-      numCoinsTotal++;
-      if (x.withdrawalDone) {
-        numCoinsWithdrawn++;
-      }
-    });
+    await tx
+      .iterIndexed(Stores.planchets.byGroup, wsr.withdrawalGroupId)
+      .forEach((x) => {
+        numCoinsTotal++;
+        if (x.withdrawalDone) {
+          numCoinsWithdrawn++;
+        }
+      });
     resp.pendingOperations.push({
       type: PendingOperationType.Withdraw,
       givesLifeness: true,
diff --git a/src/operations/reserves.ts b/src/operations/reserves.ts
index 3d45d8d5..2761dfaf 100644
--- a/src/operations/reserves.ts
+++ b/src/operations/reserves.ts
@@ -106,7 +106,11 @@ export async function createReserve(
   let bankInfo: ReserveBankInfo | undefined;
 
   if (req.bankWithdrawStatusUrl) {
-    const denomSelInfo = await selectWithdrawalDenoms(ws, canonExchange, 
req.amount);
+    const denomSelInfo = await selectWithdrawalDenoms(
+      ws,
+      canonExchange,
+      req.amount,
+    );
     const denomSel = denomSelectionInfoToState(denomSelInfo);
     bankInfo = {
       statusUrl: req.bankWithdrawStatusUrl,
diff --git a/src/operations/tip.ts b/src/operations/tip.ts
index 15d2339b..1ae7700a 100644
--- a/src/operations/tip.ts
+++ b/src/operations/tip.ts
@@ -200,7 +200,10 @@ async function processTipImpl(
     const planchets: TipPlanchet[] = [];
 
     for (const sd of denomsForWithdraw.selectedDenoms) {
-      const denom = await 
ws.db.getIndexed(Stores.denominations.denomPubHashIndex, sd.denomPubHash);
+      const denom = await ws.db.getIndexed(
+        Stores.denominations.denomPubHashIndex,
+        sd.denomPubHash,
+      );
       if (!denom) {
         throw Error("denom does not exist anymore");
       }
diff --git a/src/operations/withdraw.ts b/src/operations/withdraw.ts
index 14071be7..28474341 100644
--- a/src/operations/withdraw.ts
+++ b/src/operations/withdraw.ts
@@ -420,17 +420,19 @@ async function processPlanchet(
   }
 }
 
-export function denomSelectionInfoToState(dsi: DenominationSelectionInfo): 
DenomSelectionState {
+export function denomSelectionInfoToState(
+  dsi: DenominationSelectionInfo,
+): DenomSelectionState {
   return {
     selectedDenoms: dsi.selectedDenoms.map((x) => {
       return {
         count: x.count,
-        denomPubHash: x.denom.denomPubHash
+        denomPubHash: x.denom.denomPubHash,
       };
     }),
     totalCoinValue: dsi.totalCoinValue,
     totalWithdrawCost: dsi.totalWithdrawCost,
-  }
+  };
 }
 
 /**
@@ -617,11 +619,7 @@ export async function getExchangeWithdrawalInfo(
     throw Error(`exchange ${exchangeInfo.baseUrl} wire details not available`);
   }
 
-  const selectedDenoms = await selectWithdrawalDenoms(
-    ws,
-    baseUrl,
-    amount,
-  );
+  const selectedDenoms = await selectWithdrawalDenoms(ws, baseUrl, amount);
   const exchangeWireAccounts: string[] = [];
   for (const account of exchangeWireInfo.accounts) {
     exchangeWireAccounts.push(account.payto_uri);
diff --git a/src/types/talerTypes.ts b/src/types/talerTypes.ts
index eb10d6e1..0221d26b 100644
--- a/src/types/talerTypes.ts
+++ b/src/types/talerTypes.ts
@@ -869,9 +869,8 @@ export const codecForTax = (): Codec<Tax> =>
     .property("tax", codecForString)
     .build("Tax");
 
-
 export const codecForI18n = (): Codec<{ [lang_tag: string]: string }> =>
-  makeCodecForMap(codecForString)
+  makeCodecForMap(codecForString);
 
 export const codecForProduct = (): Codec<Product> =>
   makeCodecForObject<Product>()
@@ -908,7 +907,10 @@ export const codecForContractTerms = (): 
Codec<ContractTerms> =>
     .property("merchant", codecForMerchantInfo())
     .property("merchant_pub", codecForString)
     .property("exchanges", makeCodecForList(codecForExchangeHandle()))
-    .property("products", 
makeCodecOptional(makeCodecForList(codecForProduct())))
+    .property(
+      "products",
+      makeCodecOptional(makeCodecForList(codecForProduct())),
+    )
     .property("extra", codecForAny)
     .build("ContractTerms");
 
diff --git a/src/types/transactions.ts b/src/types/transactions.ts
index b1d033c0..6ed9a52d 100644
--- a/src/types/transactions.ts
+++ b/src/types/transactions.ts
@@ -16,7 +16,7 @@
 
 /**
  * Type and schema definitions for the wallet's transaction list.
- * 
+ *
  * @author Florian Dold
  * @author Torsten Grote
  */
diff --git a/src/types/walletTypes.ts b/src/types/walletTypes.ts
index da87b1c1..dbfd12b5 100644
--- a/src/types/walletTypes.ts
+++ b/src/types/walletTypes.ts
@@ -476,7 +476,6 @@ export interface DepositInfo {
   denomSig: string;
 }
 
-
 export interface ExtendedPermissionsResponse {
   newValue: boolean;
-}
\ No newline at end of file
+}
diff --git a/src/util/amounts.ts b/src/util/amounts.ts
index cdb98b0f..c0bb0361 100644
--- a/src/util/amounts.ts
+++ b/src/util/amounts.ts
@@ -342,7 +342,7 @@ function mult(a: AmountJson, n: number): Result {
   if (n == 0) {
     return { amount: getZero(a.currency), saturated: false };
   }
-  let acc = {... a};
+  let acc = { ...a };
   while (n > 1) {
     let r: Result;
     if (n % 2 == 0) {
diff --git a/src/util/time.ts b/src/util/time.ts
index f296aba1..5c2f49d1 100644
--- a/src/util/time.ts
+++ b/src/util/time.ts
@@ -49,7 +49,6 @@ export function getTimestampNow(): Timestamp {
 export function getDurationRemaining(
   deadline: Timestamp,
   now = getTimestampNow(),
-
 ): Duration {
   if (deadline.t_ms === "never") {
     return { d_ms: "forever" };
diff --git a/src/webex/pages/popup.tsx b/src/webex/pages/popup.tsx
index 4d3c65b2..875bbcb5 100644
--- a/src/webex/pages/popup.tsx
+++ b/src/webex/pages/popup.tsx
@@ -624,10 +624,12 @@ const HistoryComponent = (props: any): JSX.Element => {
 
 class WalletSettings extends React.Component<any, any> {
   render(): JSX.Element {
-    return <div>
-    <h2>Permissions</h2>
-    <PermissionsCheckbox />
-  </div>;
+    return (
+      <div>
+        <h2>Permissions</h2>
+        <PermissionsCheckbox />
+      </div>
+    );
   }
 }
 
diff --git a/src/webex/pages/welcome.tsx b/src/webex/pages/welcome.tsx
index 8d4920ca..a7c24d65 100644
--- a/src/webex/pages/welcome.tsx
+++ b/src/webex/pages/welcome.tsx
@@ -108,19 +108,16 @@ export function PermissionsCheckbox(): JSX.Element {
       const granted = await new Promise<boolean>((resolve, reject) => {
         // We set permissions here, since apparently FF wants this to be done
         // as the result of an input event ...
-        getPermissionsApi().request(
-          extendedPermissions,
-          (granted: boolean) => {
-            if (chrome.runtime.lastError) {
-              console.error("error requesting permissions");
-              console.error(chrome.runtime.lastError);
-              reject(chrome.runtime.lastError);
-              return;
-            }
-            console.log("permissions granted:", granted);
-            resolve(granted);
-          },
-        );
+        getPermissionsApi().request(extendedPermissions, (granted: boolean) => 
{
+          if (chrome.runtime.lastError) {
+            console.error("error requesting permissions");
+            console.error(chrome.runtime.lastError);
+            reject(chrome.runtime.lastError);
+            return;
+          }
+          console.log("permissions granted:", granted);
+          resolve(granted);
+        });
       });
       const res = await wxApi.setExtendedPermissions(granted);
       console.log(res);
diff --git a/src/webex/pages/withdraw.tsx b/src/webex/pages/withdraw.tsx
index 5ef4376f..d8ac3c45 100644
--- a/src/webex/pages/withdraw.tsx
+++ b/src/webex/pages/withdraw.tsx
@@ -28,11 +28,13 @@ import { WithdrawDetails } from "../../types/walletTypes";
 import { WithdrawDetailView, renderAmount } from "../renderHtml";
 
 import React, { useState, useEffect } from "react";
-import { getWithdrawDetails, acceptWithdrawal, onUpdateNotification } from 
"../wxApi";
+import {
+  getWithdrawDetails,
+  acceptWithdrawal,
+  onUpdateNotification,
+} from "../wxApi";
 
-function WithdrawalDialog(props: {
-  talerWithdrawUri: string;
-}): JSX.Element {
+function WithdrawalDialog(props: { talerWithdrawUri: string }): JSX.Element {
   const [details, setDetails] = useState<WithdrawDetails | undefined>();
   const [selectedExchange, setSelectedExchange] = useState<
     string | undefined
@@ -48,8 +50,8 @@ function WithdrawalDialog(props: {
     return onUpdateNotification(() => {
       setUpdateCounter(updateCounter + 1);
     });
-  // eslint-disable-next-line react-hooks/exhaustive-deps
-  }, [])
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, []);
 
   useEffect(() => {
     const fetchData = async (): Promise<void> => {
@@ -174,11 +176,12 @@ function WithdrawalDialog(props: {
         <strong>{renderAmount(details.bankWithdrawDetails.amount)}</strong> 
from
         your bank account into your wallet.
       </i18n.Translate>
-      { selectedExchange ?
+      {selectedExchange ? (
         <p>
-          The exchange <strong>{selectedExchange}</strong> will be used as the 
Taler payment service provider.
-        </p> : null
-      }
+          The exchange <strong>{selectedExchange}</strong> will be used as the
+          Taler payment service provider.
+        </p>
+      ) : null}
 
       <div>
         <button
diff --git a/src/webex/permissions.ts b/src/webex/permissions.ts
index 57ca6dc6..bcd357fd 100644
--- a/src/webex/permissions.ts
+++ b/src/webex/permissions.ts
@@ -17,4 +17,4 @@
 export const extendedPermissions = {
   permissions: ["webRequest", "webRequestBlocking"],
   origins: ["http://*/*";, "https://*/*";],
-};
\ No newline at end of file
+};

-- 
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]