mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-10 23:50:10 -04:00
remove offerFeeTxId from models
This commit is contained in:
parent
9fb5dfb788
commit
9c5d0702ba
26 changed files with 53 additions and 290 deletions
|
@ -35,7 +35,6 @@ import haveno.core.trade.protocol.tasks.SellerPreparePaymentReceivedMessage;
|
|||
import haveno.core.trade.protocol.tasks.SellerPublishDepositTx;
|
||||
import haveno.core.trade.protocol.tasks.SellerPublishTradeStatistics;
|
||||
import haveno.core.trade.protocol.tasks.SellerSendPaymentReceivedMessageToBuyer;
|
||||
import haveno.core.trade.protocol.tasks.TakerVerifyMakerFeePayment;
|
||||
import haveno.core.trade.protocol.tasks.VerifyPeersAccountAgeWitness;
|
||||
import haveno.desktop.common.view.FxmlView;
|
||||
import haveno.desktop.common.view.InitializableView;
|
||||
|
@ -85,7 +84,6 @@ public class DebugView extends InitializableView<GridPane, Void> {
|
|||
addGroup("SellerAsTakerProtocol",
|
||||
FXCollections.observableArrayList(Arrays.asList(
|
||||
ApplyFilter.class,
|
||||
TakerVerifyMakerFeePayment.class,
|
||||
|
||||
ApplyFilter.class,
|
||||
VerifyPeersAccountAgeWitness.class,
|
||||
|
@ -96,10 +94,8 @@ public class DebugView extends InitializableView<GridPane, Void> {
|
|||
|
||||
ProcessPaymentSentMessage.class,
|
||||
ApplyFilter.class,
|
||||
TakerVerifyMakerFeePayment.class,
|
||||
|
||||
ApplyFilter.class,
|
||||
TakerVerifyMakerFeePayment.class,
|
||||
SellerPreparePaymentReceivedMessage.class,
|
||||
//SellerBroadcastPayoutTx.class, // TODO (woodser): removed from main pipeline; debug view?
|
||||
SellerSendPaymentReceivedMessageToBuyer.class
|
||||
|
@ -126,13 +122,11 @@ public class DebugView extends InitializableView<GridPane, Void> {
|
|||
addGroup("BuyerAsTakerProtocol",
|
||||
FXCollections.observableArrayList(Arrays.asList(
|
||||
ApplyFilter.class,
|
||||
TakerVerifyMakerFeePayment.class,
|
||||
|
||||
ApplyFilter.class,
|
||||
VerifyPeersAccountAgeWitness.class,
|
||||
|
||||
ApplyFilter.class,
|
||||
TakerVerifyMakerFeePayment.class,
|
||||
BuyerPreparePaymentSentMessage.class,
|
||||
BuyerSendPaymentSentMessage.class,
|
||||
|
||||
|
|
|
@ -17,28 +17,25 @@
|
|||
|
||||
package haveno.desktop.main.funds.transactions;
|
||||
|
||||
import haveno.core.offer.Offer;
|
||||
import haveno.core.offer.OpenOffer;
|
||||
import haveno.core.trade.Tradable;
|
||||
import monero.wallet.model.MoneroTxWallet;
|
||||
|
||||
class TransactionAwareOpenOffer implements TransactionAwareTradable {
|
||||
private final OpenOffer delegate;
|
||||
private final OpenOffer openOffer;
|
||||
|
||||
TransactionAwareOpenOffer(OpenOffer delegate) {
|
||||
this.delegate = delegate;
|
||||
this.openOffer = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRelatedToTransaction(MoneroTxWallet transaction) {
|
||||
Offer offer = delegate.getOffer();
|
||||
String paymentTxId = offer.getOfferFeeTxId();
|
||||
|
||||
String txId = transaction.getHash();
|
||||
|
||||
return txId.equals(paymentTxId);
|
||||
return txId.equals(openOffer.getReserveTxHash());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tradable asTradable() {
|
||||
return delegate;
|
||||
return openOffer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package haveno.desktop.main.funds.transactions;
|
||||
|
||||
import haveno.common.crypto.PubKeyRing;
|
||||
import haveno.core.offer.Offer;
|
||||
import haveno.core.support.dispute.Dispute;
|
||||
import haveno.core.support.dispute.arbitration.ArbitrationManager;
|
||||
import haveno.core.support.dispute.refund.RefundManager;
|
||||
|
@ -29,8 +28,6 @@ import javafx.collections.ObservableList;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import monero.wallet.model.MoneroTxWallet;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
@Slf4j
|
||||
class TransactionAwareTrade implements TransactionAwareTradable {
|
||||
|
@ -56,14 +53,12 @@ class TransactionAwareTrade implements TransactionAwareTradable {
|
|||
public boolean isRelatedToTransaction(MoneroTxWallet transaction) {
|
||||
String txId = transaction.getHash();
|
||||
|
||||
boolean isOfferFeeTx = isOfferFeeTx(txId);
|
||||
boolean isMakerDepositTx = isMakerDepositTx(txId);
|
||||
boolean isTakerDepositTx = isTakerDepositTx(txId);
|
||||
boolean isPayoutTx = isPayoutTx(txId);
|
||||
boolean isDisputedPayoutTx = isDisputedPayoutTx(txId);
|
||||
|
||||
return isOfferFeeTx || isMakerDepositTx || isTakerDepositTx ||
|
||||
isPayoutTx || isDisputedPayoutTx;
|
||||
return isMakerDepositTx || isTakerDepositTx || isPayoutTx || isDisputedPayoutTx;
|
||||
}
|
||||
|
||||
private boolean isPayoutTx(String txId) {
|
||||
|
@ -75,14 +70,7 @@ class TransactionAwareTrade implements TransactionAwareTradable {
|
|||
}
|
||||
|
||||
private boolean isTakerDepositTx(String txId) {
|
||||
return txId.equals(trade.getTaker().getDepositTxHash());
|
||||
}
|
||||
|
||||
private boolean isOfferFeeTx(String txId) {
|
||||
return Optional.ofNullable(trade.getOffer())
|
||||
.map(Offer::getOfferFeeTxId)
|
||||
.map(paymentTxId -> paymentTxId.equals(txId))
|
||||
.orElse(false);
|
||||
return txId.equals(trade.getTaker().getDepositTxHash());
|
||||
}
|
||||
|
||||
private boolean isDisputedPayoutTx(String txId) {
|
||||
|
|
|
@ -119,10 +119,7 @@ class TransactionsListItem {
|
|||
Trade trade = (Trade) tradable;
|
||||
|
||||
Offer offer = trade.getOffer();
|
||||
String offerFeeTxId = offer.getOfferFeeTxId();
|
||||
if (offerFeeTxId != null && offerFeeTxId.equals(txId)) {
|
||||
details = Res.get("funds.tx.createOfferFee", tradeId);
|
||||
} else if (trade.getSelf().getDepositTxHash() != null &&
|
||||
if (trade.getSelf().getDepositTxHash() != null &&
|
||||
trade.getSelf().getDepositTxHash().equals(txId)) {
|
||||
details = Res.get("funds.tx.multiSigDeposit", tradeId);
|
||||
} else if (trade.getPayoutTxId() != null &&
|
||||
|
|
|
@ -192,7 +192,6 @@ class EditOfferDataModel extends MutableOfferDataModel {
|
|||
newOfferPayload.getCounterCurrencyCode(),
|
||||
newOfferPayload.getPaymentMethodId(),
|
||||
newOfferPayload.getMakerPaymentAccountId(),
|
||||
offerPayload.getOfferFeeTxId(),
|
||||
newOfferPayload.getCountryCode(),
|
||||
newOfferPayload.getAcceptedCountryCodes(),
|
||||
newOfferPayload.getBankId(),
|
||||
|
|
|
@ -315,9 +315,6 @@ public class FailedTradesView extends ActivatableViewAndModel<VBox, FailedTrades
|
|||
if (model.getDirectionLabel(item).contains(filterString)) {
|
||||
return true;
|
||||
}
|
||||
if (offer.getOfferFeeTxId() != null && offer.getOfferFeeTxId().contains(filterString)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Trade trade = item.getTrade();
|
||||
|
||||
|
|
|
@ -352,9 +352,6 @@ public class OpenOffersView extends ActivatableViewAndModel<VBox, OpenOffersView
|
|||
if (model.getDirectionLabel(item).contains(filterString)) {
|
||||
return true;
|
||||
}
|
||||
if (offer.getOfferFeeTxId() != null && offer.getOfferFeeTxId().contains(filterString)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue