From 454506aca186e5e6a7b926db627e9a3eccdba6a4 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Fri, 17 Aug 2018 13:08:04 +0200 Subject: [PATCH 1/3] Fix proposal list management --- .../bisq/desktop/main/dao/governance/result/VoteResultView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/bisq/desktop/main/dao/governance/result/VoteResultView.java b/src/main/java/bisq/desktop/main/dao/governance/result/VoteResultView.java index 0f67e6cf645..ac51c4a1c7d 100644 --- a/src/main/java/bisq/desktop/main/dao/governance/result/VoteResultView.java +++ b/src/main/java/bisq/desktop/main/dao/governance/result/VoteResultView.java @@ -243,8 +243,8 @@ private void fillCycleList() { cycleListItemList.clear(); bsqStateService.getCycles().forEach(cycle -> { List proposalsForCycle = proposalService.getProposalPayloads().stream() - .filter(proposalPayload -> cycleService.isTxInCycle(cycle, proposalPayload.getProposal().getTxId())) .map(ProposalPayload::getProposal) + .filter(proposal -> cycleService.isTxInCycle(cycle, proposal.getTxId())) .collect(Collectors.toList()); List evaluatedProposalsForCycle = voteResultService.getAllEvaluatedProposals().stream() From 005d330db94b4e3df6a2341c62f27b2c70c5fdc2 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Fri, 17 Aug 2018 21:57:45 +0200 Subject: [PATCH 2/3] Change link to F2F docs page --- .../main/account/content/fiataccounts/FiatAccountsView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java b/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java index 23303721097..a233028a10c 100644 --- a/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java +++ b/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java @@ -250,7 +250,7 @@ private void onSaveNewAccount(PaymentAccount paymentAccount) { new Popup<>().information(Res.get("payment.f2f.info")) .width(700) .closeButtonText(Res.get("payment.f2f.info.openURL")) - .onClose(() -> GUIUtil.openWebPage("https://docs.bisq.network/#f2f")) + .onClose(() -> GUIUtil.openWebPage("https://docs.bisq.network/trading-rules.html#f2f-trading")) .actionButtonText(Res.get("shared.iUnderstand")) .onAction(() -> doSaveNewAccount(paymentAccount)) .show(); From a2f2503b471ab30f5755758e5b45de059e24f4a2 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Sun, 19 Aug 2018 12:30:04 +0200 Subject: [PATCH 3/3] Update getAdjustedFiatVolume and getAdjustedAmount methods --- .../java/bisq/desktop/main/offer/MutableOfferDataModel.java | 4 ++-- .../java/bisq/desktop/main/offer/MutableOfferViewModel.java | 6 +++--- .../desktop/main/offer/takeoffer/TakeOfferDataModel.java | 2 +- .../desktop/main/offer/takeoffer/TakeOfferViewModel.java | 5 +++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java b/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java index 662ede8fb63..a1962c0fdde 100644 --- a/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java +++ b/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java @@ -673,7 +673,7 @@ void calculateVolume() { if (isHalCashAccount()) volumeByAmount = OfferUtil.getAdjustedVolumeForHalCash(volumeByAmount); else if (CurrencyUtil.isFiatCurrency(tradeCurrencyCode.get())) - volumeByAmount = OfferUtil.getRoundedFiatVolume(volumeByAmount, tradeCurrencyCode.get()); + volumeByAmount = OfferUtil.getRoundedFiatVolume(volumeByAmount); volume.set(volumeByAmount); } catch (Throwable t) { @@ -695,7 +695,7 @@ void calculateAmount() { if (isHalCashAccount()) value = OfferUtil.getAdjustedAmountForHalCash(value, price.get(), getMaxTradeLimit()); else if (CurrencyUtil.isFiatCurrency(tradeCurrencyCode.get())) - value = OfferUtil.getRoundedFiatAmount(value, price.get(), tradeCurrencyCode.get(), getMaxTradeLimit()); + value = OfferUtil.getRoundedFiatAmount(value, price.get(), getMaxTradeLimit()); calculateVolume(); diff --git a/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java b/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java index d6063853726..bd12d115f2a 100644 --- a/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java +++ b/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java @@ -764,7 +764,7 @@ void onFocusOutVolumeTextField(boolean oldValue, boolean newValue) { if (dataModel.isHalCashAccount()) volume = OfferUtil.getAdjustedVolumeForHalCash(volume); else if (CurrencyUtil.isFiatCurrency(tradeCurrencyCode.get())) - volume = OfferUtil.getRoundedFiatVolume(volume, tradeCurrencyCode.get()); + volume = OfferUtil.getRoundedFiatVolume(volume); this.volume.set(btcFormatter.formatVolume(volume)); } @@ -979,7 +979,7 @@ private void setAmountToModel() { if (dataModel.isHalCashAccount()) amount = OfferUtil.getAdjustedAmountForHalCash(amount, price, maxTradeLimit); else if (CurrencyUtil.isFiatCurrency(tradeCurrencyCode.get())) - amount = OfferUtil.getRoundedFiatAmount(amount, price, tradeCurrencyCode.get(), maxTradeLimit); + amount = OfferUtil.getRoundedFiatAmount(amount, price, maxTradeLimit); } dataModel.setAmount(amount); if (syncMinAmountWithAmount || @@ -1003,7 +1003,7 @@ private void setMinAmountToModel() { if (dataModel.isHalCashAccount()) minAmount = OfferUtil.getAdjustedAmountForHalCash(minAmount, price, maxTradeLimit); else if (CurrencyUtil.isFiatCurrency(tradeCurrencyCode.get())) - minAmount = OfferUtil.getRoundedFiatAmount(minAmount, price, tradeCurrencyCode.get(), maxTradeLimit); + minAmount = OfferUtil.getRoundedFiatAmount(minAmount, price, maxTradeLimit); } dataModel.setMinAmount(minAmount); diff --git a/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java b/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java index babde6088dd..247c079cbd7 100644 --- a/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java +++ b/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java @@ -496,7 +496,7 @@ void calculateVolume() { if (offer.getPaymentMethod().getId().equals(PaymentMethod.HAL_CASH_ID)) volumeByAmount = OfferUtil.getAdjustedVolumeForHalCash(volumeByAmount); else if (CurrencyUtil.isFiatCurrency(getCurrencyCode())) - volumeByAmount = OfferUtil.getRoundedFiatVolume(volumeByAmount, getCurrencyCode()); + volumeByAmount = OfferUtil.getRoundedFiatVolume(volumeByAmount); volume.set(volumeByAmount); diff --git a/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java b/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java index 55b6e3589ee..b335faf9880 100644 --- a/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java +++ b/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java @@ -296,7 +296,7 @@ void onFocusOutAmountTextField(boolean oldValue, boolean newValue, String userIn // We only apply the rounding if the amount is variable (minAmount is lower as amount). // Otherwise we could get an amount lower then the minAmount set by rounding Coin roundedAmount = OfferUtil.getRoundedFiatAmount(dataModel.getAmount().get(), tradePrice, - dataModel.getCurrencyCode(), maxTradeLimit); + maxTradeLimit); dataModel.applyAmount(roundedAmount); } amount.set(btcFormatter.formatCoin(dataModel.getAmount().get())); @@ -566,7 +566,7 @@ private void setAmountToModel() { } else if (CurrencyUtil.isFiatCurrency(dataModel.getCurrencyCode()) && !isAmountEqualMinAmount(amount)) { // We only apply the rounding if the amount is variable (minAmount is lower as amount). // Otherwise we could get an amount lower then the minAmount set by rounding - amount = OfferUtil.getRoundedFiatAmount(amount, price, dataModel.getCurrencyCode(), maxTradeLimit); + amount = OfferUtil.getRoundedFiatAmount(amount, price, maxTradeLimit); } } dataModel.applyAmount(amount); @@ -577,6 +577,7 @@ private boolean isAmountEqualMinAmount(Coin amount) { return amount.value == offer.getMinAmount().value; } + /////////////////////////////////////////////////////////////////////////////////////////// // Getters ///////////////////////////////////////////////////////////////////////////////////////////