[bisq-network/bisq] Add Capitual payment method (#5501)

Kai notifications at github.com
Mon Jun 7 11:03:34 CEST 2021


@KaiWitt commented on this pull request.



> +        List<TradeCurrency> currencies = new ArrayList<>(Arrays.asList(
+                new FiatCurrency("EUR"),
+                new FiatCurrency("BRL"),
+                new FiatCurrency("GBP"),
+                new FiatCurrency("USD")
+        ));
+        currencies.sort(Comparator.comparing(TradeCurrency::getCode));
+        return currencies;

Sorting is not necessary when you initialize it in the correct order
```suggestion
        return new ArrayList<>(Arrays.asList(
                new FiatCurrency("BRL"),
                new FiatCurrency("EUR"),
                new FiatCurrency("GBP"),
                new FiatCurrency("USD")
        ));
```

> +        CurrencyUtil.getAllCapitualCurrencies().stream().forEach(e ->
+                fillUpFlowPaneWithCurrencies(isEditable, flowPane, e, capitualAccount));

You can use `forEach` on the list itself
```suggestion
        CurrencyUtil.getAllCapitualCurrencies().forEach(e ->
                fillUpFlowPaneWithCurrencies(isEditable, flowPane, e, capitualAccount));
```

> +        gridRowFrom = gridRow;
+        addCompactTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
+                capitualAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
+        addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
+                Res.get(capitualAccount.getPaymentMethod().getId()));
+        addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.capitual.cap"),
+                capitualAccount.getAccountNr());
+        addLimitations(true);
+        addCurrenciesGrid(false);
+    }
+
+    @Override
+    public void updateAllInputsValid() {
+        allInputsValid.set(isAccountNameValid()
+                && capitualValidator.validate(capitualAccount.getAccountNr()).isValid
+                && capitualAccount.getTradeCurrencies().size() > 0);

```suggestion
                && !capitualAccount.getTradeCurrencies().isEmpty());
```
It's faster and makes your intent clearer

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5501#pullrequestreview-677146944
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210607/18de6471/attachment.htm>


More information about the bisq-github mailing list