mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Remove redundant getTrade(id) method
Resolves issue found during https://github.com/bisq-network/bisq/pull/4673 review, and mentioned in comment https://github.com/bisq-network/bisq/pull/4673#discussion_r510090257
This commit is contained in:
parent
2ae6bfaf51
commit
fa0e05a336
@ -82,7 +82,7 @@ class CoreTradesService {
|
||||
}
|
||||
|
||||
void confirmPaymentStarted(String tradeId) {
|
||||
var trade = getTradeWithId(tradeId);
|
||||
var trade = getTrade(tradeId);
|
||||
if (isFollowingBuyerProtocol(trade)) {
|
||||
var tradeProtocol = tradeManager.getTradeProtocol(trade);
|
||||
((BuyerProtocol) tradeProtocol).onPaymentStarted(
|
||||
@ -98,7 +98,7 @@ class CoreTradesService {
|
||||
}
|
||||
|
||||
void confirmPaymentReceived(String tradeId) {
|
||||
var trade = getTradeWithId(tradeId);
|
||||
var trade = getTrade(tradeId);
|
||||
if (isFollowingBuyerProtocol(trade)) {
|
||||
throw new IllegalStateException("you are the buyer, and not receiving payment");
|
||||
} else {
|
||||
@ -114,10 +114,6 @@ class CoreTradesService {
|
||||
}
|
||||
|
||||
Trade getTrade(String tradeId) {
|
||||
return getTradeWithId(tradeId);
|
||||
}
|
||||
|
||||
private Trade getTradeWithId(String tradeId) {
|
||||
return tradeManager.getTradeById(tradeId).orElseThrow(() ->
|
||||
new IllegalArgumentException(format("trade with id '%s' not found", tradeId)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user