Skip to content

Commit

Permalink
Merge pull request #4912 from chimp1984/add-serialized-tx-as-hex-to-t…
Browse files Browse the repository at this point in the history
…rade-details

Add "Raw deposit transaction as hex" to details window
  • Loading branch information
sqrrm authored Dec 8, 2020
2 parents 368121e + 25d2275 commit 2a2f05f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private void addContent() {
}

Tuple3<Button, Button, HBox> 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;
Expand All @@ -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);
Expand Down

0 comments on commit 2a2f05f

Please sign in to comment.