Remove handleTakeOfferRequest delegate method in maker trade

This commit is contained in:
chimp1984 2020-09-26 12:51:43 -05:00
parent 766b1e2e1e
commit 456f16ddf4
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3
5 changed files with 3 additions and 31 deletions

View File

@ -20,13 +20,10 @@ package bisq.core.trade;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.offer.Offer;
import bisq.core.proto.CoreProtoResolver;
import bisq.core.trade.messages.TakeOfferRequest;
import bisq.core.trade.protocol.BuyerAsMakerProtocol;
import bisq.core.trade.protocol.MakerProtocol;
import bisq.network.p2p.NodeAddress;
import bisq.common.handlers.ErrorMessageHandler;
import bisq.common.storage.Storage;
import org.bitcoinj.core.Coin;
@ -108,11 +105,4 @@ public final class BuyerAsMakerTrade extends BuyerTrade implements MakerTrade {
protected void createTradeProtocol() {
tradeProtocol = new BuyerAsMakerProtocol(this);
}
@Override
public void handleTakeOfferRequest(TakeOfferRequest message,
NodeAddress taker,
ErrorMessageHandler errorMessageHandler) {
((MakerProtocol) tradeProtocol).handleTakeOfferRequest(message, taker, errorMessageHandler);
}
}

View File

@ -17,14 +17,5 @@
package bisq.core.trade;
import bisq.core.trade.messages.TakeOfferRequest;
import bisq.network.p2p.NodeAddress;
import bisq.common.handlers.ErrorMessageHandler;
public interface MakerTrade {
void handleTakeOfferRequest(TakeOfferRequest message,
NodeAddress peerNodeAddress,
ErrorMessageHandler errorMessageHandler);
}

View File

@ -20,13 +20,10 @@ package bisq.core.trade;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.offer.Offer;
import bisq.core.proto.CoreProtoResolver;
import bisq.core.trade.messages.TakeOfferRequest;
import bisq.core.trade.protocol.MakerProtocol;
import bisq.core.trade.protocol.SellerAsMakerProtocol;
import bisq.network.p2p.NodeAddress;
import bisq.common.handlers.ErrorMessageHandler;
import bisq.common.storage.Storage;
import org.bitcoinj.core.Coin;
@ -109,11 +106,4 @@ public final class SellerAsMakerTrade extends SellerTrade implements MakerTrade
protected void createTradeProtocol() {
tradeProtocol = new SellerAsMakerProtocol(this);
}
@Override
public void handleTakeOfferRequest(TakeOfferRequest message,
NodeAddress taker,
ErrorMessageHandler errorMessageHandler) {
((MakerProtocol) tradeProtocol).handleTakeOfferRequest(message, taker, errorMessageHandler);
}
}

View File

@ -35,6 +35,7 @@ import bisq.core.trade.failed.FailedTradesManager;
import bisq.core.trade.handlers.TradeResultHandler;
import bisq.core.trade.messages.TakeOfferRequest;
import bisq.core.trade.messages.TradeMessage;
import bisq.core.trade.protocol.MakerProtocol;
import bisq.core.trade.protocol.ProcessModelServiceProvider;
import bisq.core.trade.statistics.TradeStatisticsManager;
import bisq.core.user.User;
@ -253,7 +254,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
initTrade(trade);
tradableList.add(trade);
((MakerTrade) trade).handleTakeOfferRequest(takeOfferRequest, peer, errorMessage -> {
((MakerProtocol) trade.getTradeProtocol()).handleTakeOfferRequest(takeOfferRequest, peer, errorMessage -> {
if (takeOfferRequestErrorMessageHandler != null)
takeOfferRequestErrorMessageHandler.handleErrorMessage(errorMessage);
});

View File

@ -369,7 +369,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
///////////////////////////////////////////////////////////////////////////////////////////
private void onTradeStateChanged(Trade.State tradeState) {
log.debug("UI tradeState={}, id={}",
log.info("UI tradeState={}, id={}",
tradeState,
trade != null ? trade.getShortId() : "trade is null");