From da05ebfd7a6681069822f54f6aa61157d1c8c124 Mon Sep 17 00:00:00 2001 From: Steven Barclay Date: Wed, 9 Oct 2024 20:31:06 +0800 Subject: [PATCH] Add warning & redirect txIds to dispute details & filter Make sure the published warning & redirect txIds of a refund dispute show up in the details window, in place of the DPT ID for v4 protocol trades. (Unlike the latter, the fields are missing from the details for mediation disputes, as it isn't known which combination of staged txs will be published, if any.) Also make sure the two txIds are filterable on, by adding them to the 'DisputeView.FilterResult' enum and 'getFilterResult(..)' method. --- .../main/resources/i18n/displayStrings.properties | 2 ++ .../main/overlays/windows/ContractWindow.java | 12 ++++++++++-- .../desktop/main/support/dispute/DisputeView.java | 8 ++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 61317bb5039..7bf0781003b 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -227,8 +227,10 @@ shared.refundAgentForSupportStaff=Refund agent shared.delayedPayoutTxId=Delayed payout transaction ID shared.buyersWarningTxId=BTC buyer's warning transaction ID shared.sellersWarningTxId=BTC seller's warning transaction ID +shared.publishedWarningTxId=Published warning transaction ID shared.buyersRedirectTxId=BTC buyer's redirection transaction ID shared.sellersRedirectTxId=BTC seller's redirection transaction ID +shared.publishedRedirectTxId=Published redirection transaction ID shared.claimTxId=Claim transaction ID shared.peersClaimTxId=Peer's claim transaction ID shared.delayedPayoutTxReceiverAddress=Delayed payout transaction sent to diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/ContractWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/ContractWindow.java index 618df8b7f74..ec49b13cd16 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/ContractWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/ContractWindow.java @@ -25,7 +25,6 @@ import bisq.core.account.witness.AccountAgeWitnessService; import bisq.core.locale.CountryUtil; -import bisq.core.locale.CurrencyUtil; import bisq.core.locale.Res; import bisq.core.offer.Offer; import bisq.core.payment.payload.PaymentAccountPayload; @@ -45,7 +44,6 @@ import bisq.network.p2p.NodeAddress; import bisq.common.UserThread; -import bisq.common.crypto.PubKeyRing; import org.bitcoinj.core.Utils; @@ -143,6 +141,10 @@ private void addContent() { rows++; if (dispute.getDelayedPayoutTxId() != null) rows++; + if (dispute.getWarningTxId() != null) + rows++; + if (dispute.getRedirectTxId() != null) + rows++; if (dispute.getDonationAddressOfDelayedPayoutTx() != null) rows++; if (showAcceptedCountryCodes) @@ -271,6 +273,12 @@ private void addContent() { if (dispute.getDelayedPayoutTxId() != null) addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.delayedPayoutTxId"), dispute.getDelayedPayoutTxId()); + if (dispute.getWarningTxId() != null) + addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.publishedWarningTxId"), dispute.getWarningTxId()); + + if (dispute.getRedirectTxId() != null) + addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.publishedRedirectTxId"), dispute.getRedirectTxId()); + if (dispute.getDonationAddressOfDelayedPayoutTx() != null) { addLabelExplorerAddressTextField(gridPane, ++rowIndex, Res.get("shared.delayedPayoutTxReceiverAddress"), dispute.getDonationAddressOfDelayedPayoutTx()); diff --git a/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeView.java b/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeView.java index 8b9fc11e6f5..81293183047 100644 --- a/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeView.java +++ b/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeView.java @@ -140,6 +140,8 @@ public enum FilterResult { DEPOSIT_TX("Deposit tx ID"), PAYOUT_TX("Payout tx ID"), DEL_PAYOUT_TX("Delayed payout tx ID"), + WARNING_TX("Warning tx ID"), + REDIRECT_TX("Redirect tx ID"), RESULT_MESSAGE("Result message"), REASON("Reason"), JSON("Contract as json"); @@ -478,6 +480,12 @@ protected FilterResult getFilterResult(Dispute dispute, String filterTerm) { if (dispute.getDelayedPayoutTxId() != null && dispute.getDelayedPayoutTxId().contains(filter)) { return FilterResult.DEL_PAYOUT_TX; } + if (dispute.getWarningTxId() != null && dispute.getWarningTxId().contains(filter)) { + return FilterResult.WARNING_TX; + } + if (dispute.getRedirectTxId() != null && dispute.getRedirectTxId().contains(filter)) { + return FilterResult.REDIRECT_TX; + } DisputeResult disputeResult = dispute.getDisputeResultProperty().get(); if (disputeResult != null) {