Skip to content

Commit

Permalink
Remove unnecessary casts
Browse files Browse the repository at this point in the history
  • Loading branch information
ghubstan committed Jan 27, 2022
1 parent ad638e3 commit 8206425
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/src/main/java/bisq/core/api/CoreTradesService.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Trade getTrade(String tradeId) {
List<TradeModel> getOpenTrades() {
coreWalletsService.verifyWalletsAreAvailable();
coreWalletsService.verifyEncryptedWalletIsUnlocked();
return tradeManager.getTrades().stream().map(t -> (TradeModel) t).collect(Collectors.toList());
return tradeManager.getTrades().stream().collect(Collectors.toList());
}

List<TradeModel> getTradeHistory(GetTradesRequest.Category category) {
Expand All @@ -303,16 +303,15 @@ List<TradeModel> getTradeHistory(GetTradesRequest.Category category) {
.map(t -> (TradeModel) t)
.collect(Collectors.toList());
closedTrades.addAll(bsqSwapTradeManager.getBsqSwapTrades());
// TODO Sort closedTrades by date?
return closedTrades;
} else {
var failedV1Trades = failedTradesManager.getTrades();
return failedV1Trades.stream().map(t -> (TradeModel) t).collect(Collectors.toList());
return failedV1Trades.stream().collect(Collectors.toList());
}
}

void failTrade(String tradeId) {
// TODO Recommend that API users should use this method with extra care because
// TODO Recommend API users call this method with extra care because
// the API lacks methods for diagnosing trade problems, and does not support
// interaction with mediators. Users may accidentally fail valid trades,
// although they can easily be un-failed with the 'unfailtrade' method.
Expand Down

0 comments on commit 8206425

Please sign in to comment.