mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Add user name to dispute window and to trade details window (json contract window)
This commit is contained in:
parent
2b047976af
commit
e38fa9a819
@ -17,26 +17,32 @@
|
||||
|
||||
package bisq.core.support.dispute.agent;
|
||||
|
||||
import bisq.core.locale.Res;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@Slf4j
|
||||
public class DisputeAgentLookupMap {
|
||||
|
||||
// See also: https://bisq.wiki/Finding_your_mediator
|
||||
@Nullable
|
||||
public static String getKeyBaseUserName(String fullAddress) {
|
||||
switch (fullAddress) {
|
||||
case "sjlho4zwp3gecspf.onion":
|
||||
case "sjlho4zwp3gecspf.onion:9999":
|
||||
return "leo816";
|
||||
case "wizbisqzd7ku25di7p2ztsajioabihlnyp5lq5av66tmu7do2dke2tid.onion":
|
||||
case "wizbisqzd7ku25di7p2ztsajioabihlnyp5lq5av66tmu7do2dke2tid.onion:9999":
|
||||
return "wiz";
|
||||
case "apbp7ubuyezav4hy.onion":
|
||||
case "apbp7ubuyezav4hy.onion:9999":
|
||||
return "bisq_knight";
|
||||
case "a56olqlmmpxrn5q34itq5g5tb5d3fg7vxekpbceq7xqvfl3cieocgsyd.onion":
|
||||
case "a56olqlmmpxrn5q34itq5g5tb5d3fg7vxekpbceq7xqvfl3cieocgsyd.onion:9999":
|
||||
return "leo816";
|
||||
case "3z5jnirlccgxzoxc6zwkcgwj66bugvqplzf6z2iyd5oxifiaorhnanqd.onion":
|
||||
case "3z5jnirlccgxzoxc6zwkcgwj66bugvqplzf6z2iyd5oxifiaorhnanqd.onion:9999":
|
||||
return "refundagent2";
|
||||
default:
|
||||
return null;
|
||||
log.warn("No user name for dispute agent with address {} found.", fullAddress);
|
||||
return Res.get("shared.na");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ import bisq.core.payment.payload.PaymentMethod;
|
||||
import bisq.core.support.dispute.Dispute;
|
||||
import bisq.core.support.dispute.DisputeList;
|
||||
import bisq.core.support.dispute.DisputeManager;
|
||||
import bisq.core.support.dispute.agent.DisputeAgentLookupMap;
|
||||
import bisq.core.support.dispute.arbitration.ArbitrationManager;
|
||||
import bisq.core.support.dispute.mediation.MediationManager;
|
||||
import bisq.core.support.dispute.refund.RefundManager;
|
||||
@ -193,17 +194,20 @@ public class ContractWindow extends Overlay<ContractWindow> {
|
||||
sellerPaymentAccountPayload.getPaymentDetails()).second.setMouseTransparent(false);
|
||||
|
||||
String title = "";
|
||||
String agentKeyBaseUserName = "";
|
||||
if (dispute.getSupportType() != null) {
|
||||
switch (dispute.getSupportType()) {
|
||||
case ARBITRATION:
|
||||
title = Res.get("shared.selectedArbitrator");
|
||||
break;
|
||||
case MEDIATION:
|
||||
agentKeyBaseUserName = DisputeAgentLookupMap.getKeyBaseUserName(contract.getMediatorNodeAddress().getFullAddress());
|
||||
title = Res.get("shared.selectedMediator");
|
||||
break;
|
||||
case TRADE:
|
||||
break;
|
||||
case REFUND:
|
||||
agentKeyBaseUserName = DisputeAgentLookupMap.getKeyBaseUserName(contract.getRefundAgentNodeAddress().getFullAddress());
|
||||
title = Res.get("shared.selectedRefundAgent");
|
||||
break;
|
||||
}
|
||||
@ -212,7 +216,8 @@ public class ContractWindow extends Overlay<ContractWindow> {
|
||||
if (disputeManager != null) {
|
||||
NodeAddress agentNodeAddress = disputeManager.getAgentNodeAddress(dispute);
|
||||
if (agentNodeAddress != null) {
|
||||
addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, title, agentNodeAddress.getFullAddress());
|
||||
String value = agentKeyBaseUserName + " (" + agentNodeAddress.getFullAddress() + ")";
|
||||
addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, title, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ import bisq.core.locale.CurrencyUtil;
|
||||
import bisq.core.locale.Res;
|
||||
import bisq.core.offer.Offer;
|
||||
import bisq.core.payment.payload.PaymentAccountPayload;
|
||||
import bisq.core.support.dispute.agent.DisputeAgentLookupMap;
|
||||
import bisq.core.support.dispute.arbitration.ArbitrationManager;
|
||||
import bisq.core.trade.Contract;
|
||||
import bisq.core.trade.Trade;
|
||||
@ -346,6 +347,7 @@ public class TradeDetailsWindow extends Overlay<TradeDetailsWindow> {
|
||||
textArea.setText(trade.getContractAsJson());
|
||||
String data = "Contract as json:\n";
|
||||
data += trade.getContractAsJson();
|
||||
data += "\n\nOther detail data:";
|
||||
data += "\n\nBuyerMultiSigPubKeyHex: " + Utils.HEX.encode(contract.getBuyerMultiSigPubKey());
|
||||
data += "\nSellerMultiSigPubKeyHex: " + Utils.HEX.encode(contract.getSellerMultiSigPubKey());
|
||||
if (CurrencyUtil.isFiatCurrency(offer.getCurrencyCode())) {
|
||||
@ -358,6 +360,9 @@ public class TradeDetailsWindow extends Overlay<TradeDetailsWindow> {
|
||||
data += "\n\nRaw deposit transaction as hex:\n" + depositTxAsHex;
|
||||
}
|
||||
|
||||
data += "\n\nSelected mediator: " + DisputeAgentLookupMap.getKeyBaseUserName(contract.getMediatorNodeAddress().getFullAddress());
|
||||
data += "\nSelected arbitrator (refund agent): " + DisputeAgentLookupMap.getKeyBaseUserName(contract.getRefundAgentNodeAddress().getFullAddress());
|
||||
|
||||
textArea.setText(data);
|
||||
textArea.setPrefHeight(50);
|
||||
textArea.setEditable(false);
|
||||
|
@ -1251,12 +1251,6 @@ public abstract class DisputeView extends ActivatableView<VBox, Void> {
|
||||
}
|
||||
|
||||
String keyBaseUserName = DisputeAgentLookupMap.getKeyBaseUserName(agentNodeAddress.getFullAddress());
|
||||
if (keyBaseUserName == null) {
|
||||
setText(Res.get("shared.na"));
|
||||
log.warn("Support agents user name is not found: {}", keyBaseUserName);
|
||||
return;
|
||||
}
|
||||
|
||||
setText(keyBaseUserName);
|
||||
} else {
|
||||
setText("");
|
||||
|
Loading…
Reference in New Issue
Block a user