Skip to content

Commit

Permalink
Add warning & redirect txIds to dispute details & filter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stejbac committed Oct 10, 2024
1 parent b7330a2 commit da05ebf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -45,7 +44,6 @@
import bisq.network.p2p.NodeAddress;

import bisq.common.UserThread;
import bisq.common.crypto.PubKeyRing;

import org.bitcoinj.core.Utils;

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit da05ebf

Please sign in to comment.