diff --git a/core/src/main/java/bisq/core/trade/closed/ClosedTradableManager.java b/core/src/main/java/bisq/core/trade/closed/ClosedTradableManager.java index f3adfe9f67..96a364c558 100644 --- a/core/src/main/java/bisq/core/trade/closed/ClosedTradableManager.java +++ b/core/src/main/java/bisq/core/trade/closed/ClosedTradableManager.java @@ -87,12 +87,12 @@ public class ClosedTradableManager implements PersistedDataHost { return offer.isMyOffer(keyRing); } - public ObservableList getClosedTradables() { + public ObservableList getObservableList() { return closedTradables.getObservableList(); } public List getClosedTrades() { - return ImmutableList.copyOf(getClosedTradables().stream() + return ImmutableList.copyOf(getObservableList().stream() .filter(e -> e instanceof Trade) .map(e -> (Trade) e) .collect(Collectors.toList())); diff --git a/core/src/main/java/bisq/core/trade/failed/FailedTradesManager.java b/core/src/main/java/bisq/core/trade/failed/FailedTradesManager.java index 3c2b1b1786..752ff6c572 100644 --- a/core/src/main/java/bisq/core/trade/failed/FailedTradesManager.java +++ b/core/src/main/java/bisq/core/trade/failed/FailedTradesManager.java @@ -101,7 +101,7 @@ public class FailedTradesManager implements PersistedDataHost { return offer.isMyOffer(keyRing); } - public ObservableList getFailedTrades() { + public ObservableList getObservableList() { return failedTrades.getObservableList(); } diff --git a/core/src/main/java/bisq/core/trade/txproof/xmr/XmrTxProofService.java b/core/src/main/java/bisq/core/trade/txproof/xmr/XmrTxProofService.java index 571a388028..30349d3f78 100644 --- a/core/src/main/java/bisq/core/trade/txproof/xmr/XmrTxProofService.java +++ b/core/src/main/java/bisq/core/trade/txproof/xmr/XmrTxProofService.java @@ -374,8 +374,8 @@ public class XmrTxProofService implements AssetTxProofService { // We need to prevent that a user tries to scam by reusing a txKey and txHash of a previous XMR trade with // the same user (same address) and same amount. We check only for the txKey as a same txHash but different // txKey is not possible to get a valid result at proof. - Stream failedAndOpenTrades = Stream.concat(activeTrades.stream(), failedTradesManager.getFailedTrades().stream()); - Stream closedTrades = closedTradableManager.getClosedTradables().stream() + Stream failedAndOpenTrades = Stream.concat(activeTrades.stream(), failedTradesManager.getObservableList().stream()); + Stream closedTrades = closedTradableManager.getObservableList().stream() .filter(tradable -> tradable instanceof Trade) .map(tradable -> (Trade) tradable); Stream allTrades = Stream.concat(failedAndOpenTrades, closedTrades); diff --git a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TradableRepository.java b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TradableRepository.java index 3f9ec96961..e58221dac1 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TradableRepository.java +++ b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TradableRepository.java @@ -52,8 +52,8 @@ public class TradableRepository { return ImmutableSet.builder() .addAll(openOfferManager.getObservableList()) .addAll(tradeManager.getObservableList()) - .addAll(closedTradableManager.getClosedTradables()) - .addAll(failedTradesManager.getFailedTrades()) + .addAll(closedTradableManager.getObservableList()) + .addAll(failedTradesManager.getObservableList()) .build(); } } diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java index 4f39b8742b..1df383ea07 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java @@ -613,7 +613,7 @@ class OfferBookViewModel extends ActivatableViewModel { } int getNumTrades(Offer offer) { - return closedTradableManager.getClosedTradables().stream() + return closedTradableManager.getObservableList().stream() .filter(e -> { final NodeAddress tradingPeerNodeAddress = e instanceof Trade ? ((Trade) e).getTradingPeerNodeAddress() : null; return tradingPeerNodeAddress != null && diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/PortfolioView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/PortfolioView.java index acfd093b2e..c23e460795 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/PortfolioView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/PortfolioView.java @@ -127,11 +127,11 @@ public class PortfolioView extends ActivatableView { @Override protected void activate() { - failedTradesManager.getFailedTrades().addListener((ListChangeListener) c -> { - if (failedTradesManager.getFailedTrades().size() > 0 && root.getTabs().size() == 3) + failedTradesManager.getObservableList().addListener((ListChangeListener) c -> { + if (failedTradesManager.getObservableList().size() > 0 && root.getTabs().size() == 3) root.getTabs().add(failedTradesTab); }); - if (failedTradesManager.getFailedTrades().size() > 0 && root.getTabs().size() == 3) + if (failedTradesManager.getObservableList().size() > 0 && root.getTabs().size() == 3) root.getTabs().add(failedTradesTab); root.getSelectionModel().selectedItemProperty().addListener(tabChangeListener); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesDataModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesDataModel.java index f0249b401d..47eaf7e018 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesDataModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesDataModel.java @@ -48,12 +48,12 @@ class ClosedTradesDataModel extends ActivatableDataModel { @Override protected void activate() { applyList(); - closedTradableManager.getClosedTradables().addListener(tradesListChangeListener); + closedTradableManager.getObservableList().addListener(tradesListChangeListener); } @Override protected void deactivate() { - closedTradableManager.getClosedTradables().removeListener(tradesListChangeListener); + closedTradableManager.getObservableList().removeListener(tradesListChangeListener); } public ObservableList getList() { @@ -67,7 +67,7 @@ class ClosedTradesDataModel extends ActivatableDataModel { private void applyList() { list.clear(); - list.addAll(closedTradableManager.getClosedTradables().stream().map(ClosedTradableListItem::new).collect(Collectors.toList())); + list.addAll(closedTradableManager.getObservableList().stream().map(ClosedTradableListItem::new).collect(Collectors.toList())); // we sort by date, earliest first list.sort((o1, o2) -> o2.getTradable().getDate().compareTo(o1.getTradable().getDate())); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesViewModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesViewModel.java index e359e4f0ee..6e023f0036 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesViewModel.java @@ -184,7 +184,7 @@ class ClosedTradesViewModel extends ActivatableWithDataModel e instanceof Trade && tradable instanceof Trade && ((Trade) e).getTradingPeerNodeAddress() != null && diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/failedtrades/FailedTradesDataModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/failedtrades/FailedTradesDataModel.java index 5d33f4c16a..a4ce6e375e 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/failedtrades/FailedTradesDataModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/failedtrades/FailedTradesDataModel.java @@ -52,12 +52,12 @@ class FailedTradesDataModel extends ActivatableDataModel { @Override protected void activate() { applyList(); - failedTradesManager.getFailedTrades().addListener(tradesListChangeListener); + failedTradesManager.getObservableList().addListener(tradesListChangeListener); } @Override protected void deactivate() { - failedTradesManager.getFailedTrades().removeListener(tradesListChangeListener); + failedTradesManager.getObservableList().removeListener(tradesListChangeListener); } public ObservableList getList() { @@ -71,7 +71,7 @@ class FailedTradesDataModel extends ActivatableDataModel { private void applyList() { list.clear(); - list.addAll(failedTradesManager.getFailedTrades().stream().map(FailedTradesListItem::new).collect(Collectors.toList())); + list.addAll(failedTradesManager.getObservableList().stream().map(FailedTradesListItem::new).collect(Collectors.toList())); // we sort by date, earliest first list.sort((o1, o2) -> o2.getTrade().getDate().compareTo(o1.getTrade().getDate())); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java index 2e7f538c7e..35934419fd 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java @@ -348,7 +348,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel { if (e instanceof Trade) { Trade t = (Trade) e;