Skip to content

Commit

Permalink
Push Trade->TradeModel mapping down from CoreApi into CoreTradesService
Browse files Browse the repository at this point in the history
  • Loading branch information
ghubstan committed Jan 25, 2022
1 parent ef00a2c commit 4c8cec5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/bisq/core/api/CoreApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import java.util.Optional;
import java.util.Set;
import java.util.function.Consumer;
import java.util.stream.Collectors;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -332,7 +331,7 @@ public TradeModel getTradeModel(String tradeId) {
}

public List<TradeModel> getOpenTrades() {
return coreTradesService.getOpenTrades().stream().map(t -> (TradeModel) t).collect(Collectors.toList());
return coreTradesService.getOpenTrades();
}

public List<TradeModel> getTradeHistory(GetTradesRequest.Category category) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/bisq/core/api/CoreTradesService.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ Trade getTrade(String tradeId) {
));
}

List<Trade> getOpenTrades() {
List<TradeModel> getOpenTrades() {
coreWalletsService.verifyWalletsAreAvailable();
coreWalletsService.verifyEncryptedWalletIsUnlocked();
return tradeManager.getTrades();
return tradeManager.getTrades().stream().map(t -> (TradeModel) t).collect(Collectors.toList());
}

List<TradeModel> getTradeHistory(GetTradesRequest.Category category) {
Expand Down

0 comments on commit 4c8cec5

Please sign in to comment.