From 25d227556b785c9e82d7ccdaac94bb428d8dccd2 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Mon, 7 Dec 2020 20:25:29 -0500 Subject: [PATCH] Add "Raw deposit transaction as hex" to details window Rename Contract as json button to detail data --- .../resources/i18n/displayStrings.properties | 1 + .../overlays/windows/TradeDetailsWindow.java | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 9c621af54a9..4022bfd536d 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -2643,6 +2643,7 @@ tradeDetailsWindow.tradingPeersOnion=Trading peers onion address tradeDetailsWindow.tradingPeersPubKeyHash=Trading peers pubkey hash tradeDetailsWindow.tradeState=Trade state tradeDetailsWindow.agentAddresses=Arbitrator/Mediator +tradeDetailsWindow.detailData=Detail data walletPasswordWindow.headline=Enter password to unlock diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java index 494dad9d02c..f68c3bfb4b4 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java @@ -320,7 +320,7 @@ private void addContent() { } Tuple3 tuple = add2ButtonsWithBox(gridPane, ++rowIndex, - Res.get("shared.viewContractAsJson"), Res.get("shared.close"), 15, false); + Res.get("tradeDetailsWindow.detailData"), Res.get("shared.close"), 15, false); Button viewContractButton = tuple.first; viewContractButton.setMaxWidth(Region.USE_COMPUTED_SIZE); Button closeButton = tuple.second; @@ -335,15 +335,21 @@ private void addContent() { viewContractButton.setOnAction(e -> { TextArea textArea = new BisqTextArea(); textArea.setText(trade.getContractAsJson()); - String contractAsJson = trade.getContractAsJson(); - contractAsJson += "\n\nBuyerMultiSigPubKeyHex: " + Utils.HEX.encode(contract.getBuyerMultiSigPubKey()); - contractAsJson += "\nSellerMultiSigPubKeyHex: " + Utils.HEX.encode(contract.getSellerMultiSigPubKey()); + String data = "Contract as json:\n"; + data += trade.getContractAsJson(); + data += "\n\nBuyerMultiSigPubKeyHex: " + Utils.HEX.encode(contract.getBuyerMultiSigPubKey()); + data += "\nSellerMultiSigPubKeyHex: " + Utils.HEX.encode(contract.getSellerMultiSigPubKey()); if (CurrencyUtil.isFiatCurrency(offer.getCurrencyCode())) { - contractAsJson += "\nBuyersAccountAge: " + buyersAccountAge; - contractAsJson += "\nSellersAccountAge: " + sellersAccountAge; + data += "\n\nBuyersAccountAge: " + buyersAccountAge; + data += "\nSellersAccountAge: " + sellersAccountAge; } - textArea.setText(contractAsJson); + if (depositTx != null) { + String depositTxAsHex = Utils.HEX.encode(depositTx.bitcoinSerialize(true)); + data += "\n\nRaw deposit transaction as hex:\n" + depositTxAsHex; + } + + textArea.setText(data); textArea.setPrefHeight(50); textArea.setEditable(false); textArea.setWrapText(true);