From 1f61e82946ea0d8d4342721542088367273ac4bf Mon Sep 17 00:00:00 2001 From: napoly Date: Fri, 11 Nov 2022 17:54:50 +0100 Subject: [PATCH] fix transaction IDs in legacy UI trade info views --- .../main/resources/i18n/displayStrings.properties | 7 +++++-- .../resources/i18n/displayStrings_cs.properties | 1 - .../resources/i18n/displayStrings_de.properties | 1 - .../resources/i18n/displayStrings_es.properties | 1 - .../resources/i18n/displayStrings_fa.properties | 1 - .../resources/i18n/displayStrings_fr.properties | 1 - .../resources/i18n/displayStrings_it.properties | 1 - .../resources/i18n/displayStrings_ja.properties | 1 - .../resources/i18n/displayStrings_pt-br.properties | 1 - .../resources/i18n/displayStrings_pt.properties | 1 - .../resources/i18n/displayStrings_ru.properties | 1 - .../resources/i18n/displayStrings_th.properties | 1 - .../resources/i18n/displayStrings_vi.properties | 1 - .../i18n/displayStrings_zh-hans.properties | 1 - .../i18n/displayStrings_zh-hant.properties | 1 - .../main/overlays/windows/ContractWindow.java | 6 ++++-- .../main/overlays/windows/TradeDetailsWindow.java | 13 +++---------- .../pendingtrades/steps/TradeStepView.java | 12 +++++------- 18 files changed, 17 insertions(+), 35 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 9626ff82..5731d18a 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -115,7 +115,10 @@ shared.enterPercentageValue=Enter % value shared.OR=OR shared.notEnoughFunds=You don''t have enough funds in your Haveno wallet for this transaction—{0} is needed but only {1} is available.\n\nPlease add funds from an external wallet, or fund your Haveno wallet at Funds > Receive Funds. shared.waitingForFunds=Waiting for funds... -shared.depositTransactionId=Deposit transaction ID +shared.yourDepositTransactionId=Your deposit transaction ID +shared.peerDepositTransactionId=Peer's deposit transaction ID +shared.makerDepositTransactionId=Maker's deposit transaction ID +shared.takerDepositTransactionId=Taker's deposit transaction ID shared.TheBTCBuyer=The XMR buyer shared.You=You shared.sendingConfirmation=Sending confirmation... @@ -251,7 +254,7 @@ mainView.marketPrice.tooltip.bisqInternalPrice=There is no market price from ext mainView.marketPrice.tooltip=Market price is provided by {0}{1}\nLast update: {2}\nProvider node URL: {3} mainView.balance.available=Available balance mainView.balance.reserved=Reserved in offers -mainView.balance.pending=Pending balance +mainView.balance.pending=Pending balance mainView.balance.reserved.short=Reserved mainView.balance.pending.short=Pending diff --git a/core/src/main/resources/i18n/displayStrings_cs.properties b/core/src/main/resources/i18n/displayStrings_cs.properties index f13ff1e0..b49e84ee 100644 --- a/core/src/main/resources/i18n/displayStrings_cs.properties +++ b/core/src/main/resources/i18n/displayStrings_cs.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=Zadejte % hodnotu shared.OR=NEBO shared.notEnoughFunds=Ve své peněžence Bisq nemáte pro tuto transakci dostatek prostředků — je potřeba {0}, ale k dispozici je pouze {1}.\n\nPřidejte prostředky z externí peněženky nebo financujte svou peněženku Bisq v části Prostředky > Přijmout prostředky. shared.waitingForFunds=Čekání na finance... -shared.depositTransactionId=ID vkladové transakce shared.TheBTCBuyer=BTC kupující shared.You=Vy shared.sendingConfirmation=Posílám potvrzení... diff --git a/core/src/main/resources/i18n/displayStrings_de.properties b/core/src/main/resources/i18n/displayStrings_de.properties index 3c6e9f7a..48f2542c 100644 --- a/core/src/main/resources/i18n/displayStrings_de.properties +++ b/core/src/main/resources/i18n/displayStrings_de.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=%-Wert eingeben shared.OR=ODER shared.notEnoughFunds=Für diese Transaktion haben Sie nicht genug Gelder in Ihrem Bisq-Wallet—{0} werden benötigt, aber nur {1} sind verfügbar.\n\nBitte fügen Sie Gelder aus einer externen Wallet hinzu, oder senden Sie Gelder an Ihr Bisq-Wallet unter Gelder > Gelder erhalten. shared.waitingForFunds=Warte auf Gelder... -shared.depositTransactionId=Kautionstransaktions-ID shared.TheBTCBuyer=Der BTC-Käufer shared.You=Sie shared.sendingConfirmation=Sende Bestätigung... diff --git a/core/src/main/resources/i18n/displayStrings_es.properties b/core/src/main/resources/i18n/displayStrings_es.properties index 463dd5e3..e3b5d22d 100644 --- a/core/src/main/resources/i18n/displayStrings_es.properties +++ b/core/src/main/resources/i18n/displayStrings_es.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=Introduzca valor % shared.OR=ó shared.notEnoughFunds=No tiene suficientes fondos en su monedero bisq para esta transacción. Necesita {0} pero solo tiene {1} disponibles.\n\nPor favor deposite desde un monedero externo o agregue fondos a su monedero Bisq en Fondos > Recibir Fondos. shared.waitingForFunds=Esperando fondos... -shared.depositTransactionId=ID de transacción del depósito shared.TheBTCBuyer=El comprador de BTC shared.You=Usted shared.sendingConfirmation=Enviando confirmación... diff --git a/core/src/main/resources/i18n/displayStrings_fa.properties b/core/src/main/resources/i18n/displayStrings_fa.properties index 681bf718..2ff9ae40 100644 --- a/core/src/main/resources/i18n/displayStrings_fa.properties +++ b/core/src/main/resources/i18n/displayStrings_fa.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=ارزش ٪ را وارد کنید shared.OR=یا shared.notEnoughFunds=You don''t have enough funds in your Bisq wallet for this transaction—{0} is needed but only {1} is available.\n\nPlease add funds from an external wallet, or fund your Bisq wallet at Funds > Receive Funds. shared.waitingForFunds=در انتظار دریافت وجه... -shared.depositTransactionId=شناسه تراکنش وجه دریافتی shared.TheBTCBuyer=خریدار بیتکوین shared.You=شما shared.sendingConfirmation=در حال ارسال تاییدیه... diff --git a/core/src/main/resources/i18n/displayStrings_fr.properties b/core/src/main/resources/i18n/displayStrings_fr.properties index e4b2621a..40906dfd 100644 --- a/core/src/main/resources/i18n/displayStrings_fr.properties +++ b/core/src/main/resources/i18n/displayStrings_fr.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=Entrez la valeur en % shared.OR=OU shared.notEnoughFunds=Il n'y a pas suffisamment de fonds dans votre portefeuille Bisq pour payer cette transaction. La transaction a besoin de {0} Votre solde disponible est de {1}. \n\nVeuillez ajouter des fonds à partir d'un portefeuille Bitcoin externe ou recharger votre portefeuille Bisq dans «Fonds / Dépôts > Recevoir des Fonds». shared.waitingForFunds=En attente des fonds... -shared.depositTransactionId=ID de la transaction de dépôt shared.TheBTCBuyer=L'acheteur de BTC shared.You=Vous shared.sendingConfirmation=Envoi de la confirmation... diff --git a/core/src/main/resources/i18n/displayStrings_it.properties b/core/src/main/resources/i18n/displayStrings_it.properties index 05f15371..7e08e1f2 100644 --- a/core/src/main/resources/i18n/displayStrings_it.properties +++ b/core/src/main/resources/i18n/displayStrings_it.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=Immetti il valore % shared.OR=OPPURE shared.notEnoughFunds=You don''t have enough funds in your Bisq wallet for this transaction—{0} is needed but only {1} is available.\n\nPlease add funds from an external wallet, or fund your Bisq wallet at Funds > Receive Funds. shared.waitingForFunds=In attesa dei fondi... -shared.depositTransactionId=ID transazione di deposito shared.TheBTCBuyer=L'acquirente di BTC shared.You=Tu shared.sendingConfirmation=Invio della conferma in corso... diff --git a/core/src/main/resources/i18n/displayStrings_ja.properties b/core/src/main/resources/i18n/displayStrings_ja.properties index 12c177a6..4a217ea6 100644 --- a/core/src/main/resources/i18n/displayStrings_ja.properties +++ b/core/src/main/resources/i18n/displayStrings_ja.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=%を入力 shared.OR=または shared.notEnoughFunds=このトランザクションには、Bisqウォレットに資金が足りません。\n{0}が必要ですが、Bisqウォレットには{1}しかありません。\n\n外部のビットコインウォレットから入金するか、または「資金 > 資金の受取」でBisqウォレットに入金してください。 shared.waitingForFunds=資金を待っています -shared.depositTransactionId=入金トランザクションID shared.TheBTCBuyer=BTC買い手 shared.You=あなた shared.sendingConfirmation=承認を送信中 diff --git a/core/src/main/resources/i18n/displayStrings_pt-br.properties b/core/src/main/resources/i18n/displayStrings_pt-br.properties index 43836d93..c1919e37 100644 --- a/core/src/main/resources/i18n/displayStrings_pt-br.properties +++ b/core/src/main/resources/i18n/displayStrings_pt-br.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=Insira a % shared.OR=OU shared.notEnoughFunds=You don''t have enough funds in your Bisq wallet for this transaction—{0} is needed but only {1} is available.\n\nPlease add funds from an external wallet, or fund your Bisq wallet at Funds > Receive Funds. shared.waitingForFunds=Aguardando pagamento... -shared.depositTransactionId=ID da Transação de depósito shared.TheBTCBuyer=O comprador de BTC shared.You=Você shared.sendingConfirmation=Enviando confirmação... diff --git a/core/src/main/resources/i18n/displayStrings_pt.properties b/core/src/main/resources/i18n/displayStrings_pt.properties index ceec7c0a..04b75feb 100644 --- a/core/src/main/resources/i18n/displayStrings_pt.properties +++ b/core/src/main/resources/i18n/displayStrings_pt.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=Insira % do valor shared.OR=OU shared.notEnoughFunds=You don''t have enough funds in your Bisq wallet for this transaction—{0} is needed but only {1} is available.\n\nPlease add funds from an external wallet, or fund your Bisq wallet at Funds > Receive Funds. shared.waitingForFunds=Esperando pelos fundos... -shared.depositTransactionId=ID da transação de depósito shared.TheBTCBuyer=O comprador de BTC shared.You=Você shared.sendingConfirmation=Enviando confirmação... diff --git a/core/src/main/resources/i18n/displayStrings_ru.properties b/core/src/main/resources/i18n/displayStrings_ru.properties index 80725d68..c93b0a42 100644 --- a/core/src/main/resources/i18n/displayStrings_ru.properties +++ b/core/src/main/resources/i18n/displayStrings_ru.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=Ввести величину в % shared.OR=ИЛИ shared.notEnoughFunds=You don''t have enough funds in your Bisq wallet for this transaction—{0} is needed but only {1} is available.\n\nPlease add funds from an external wallet, or fund your Bisq wallet at Funds > Receive Funds. shared.waitingForFunds=Ожидание средств... -shared.depositTransactionId=Идентификатор зачисления на счёт shared.TheBTCBuyer=Покупатель ВТС shared.You=Вы shared.sendingConfirmation=Отправка подтверждения... diff --git a/core/src/main/resources/i18n/displayStrings_th.properties b/core/src/main/resources/i18n/displayStrings_th.properties index 61112a5d..43596576 100644 --- a/core/src/main/resources/i18n/displayStrings_th.properties +++ b/core/src/main/resources/i18n/displayStrings_th.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=เข้าสู่ % ตามมูลค่า shared.OR=หรือ shared.notEnoughFunds=You don''t have enough funds in your Bisq wallet for this transaction—{0} is needed but only {1} is available.\n\nPlease add funds from an external wallet, or fund your Bisq wallet at Funds > Receive Funds. shared.waitingForFunds=กำลังรอเงิน ... -shared.depositTransactionId=รหัสธุรกรรมการฝากเงิน (transaction ID) shared.TheBTCBuyer=ผู้ซื้อ BTC shared.You=คุณ shared.sendingConfirmation=กำลังส่งการยืนยัน ... diff --git a/core/src/main/resources/i18n/displayStrings_vi.properties b/core/src/main/resources/i18n/displayStrings_vi.properties index c0c82d1e..bf53dc38 100644 --- a/core/src/main/resources/i18n/displayStrings_vi.properties +++ b/core/src/main/resources/i18n/displayStrings_vi.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=Nhập giá trị % shared.OR=HOẶC shared.notEnoughFunds=You don''t have enough funds in your Bisq wallet for this transaction—{0} is needed but only {1} is available.\n\nPlease add funds from an external wallet, or fund your Bisq wallet at Funds > Receive Funds. shared.waitingForFunds=Đợi nộp tiền... -shared.depositTransactionId=ID giao dịch gửi tiền shared.TheBTCBuyer=Người mua BTC shared.You=Bạn shared.sendingConfirmation=Gửi xác nhận... diff --git a/core/src/main/resources/i18n/displayStrings_zh-hans.properties b/core/src/main/resources/i18n/displayStrings_zh-hans.properties index debdd774..4945a0e2 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hans.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hans.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=输入 % 值 shared.OR=或者 shared.notEnoughFunds=您的 Bisq 钱包中没有足够的资金去支付这一交易 需要{0} 您可用余额为 {1}。\n\n请从外部比特币钱包注入资金或在“资金/存款”充值到您的 Bisq 钱包。 shared.waitingForFunds=等待资金充值... -shared.depositTransactionId=存款交易 ID shared.TheBTCBuyer=BTC 买家 shared.You=您 shared.sendingConfirmation=发送确认... diff --git a/core/src/main/resources/i18n/displayStrings_zh-hant.properties b/core/src/main/resources/i18n/displayStrings_zh-hant.properties index 6cd1fe35..438fb4c1 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hant.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hant.properties @@ -112,7 +112,6 @@ shared.enterPercentageValue=輸入 % 值 shared.OR=或者 shared.notEnoughFunds=您的 Bisq 錢包中沒有足夠的資金去支付這一交易 需要{0} 您可用餘額為 {1}。\n\n請從外部比特幣錢包注入資金或在“資金/存款”充值到您的 Bisq 錢包。 shared.waitingForFunds=等待資金充值... -shared.depositTransactionId=存款交易 ID shared.TheBTCBuyer=BTC 買家 shared.You=您 shared.sendingConfirmation=發送確認... 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 5c8a6a46..aa57cb4c 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 @@ -265,8 +265,10 @@ public class ContractWindow extends Overlay { addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.makerFeeTxId"), offer.getOfferFeePaymentTxId()); addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.takerFeeTxId"), "TAKER FEE TX ID NOT PART OF CONTRACT"); // TODO (woodser): should taker fee tx id be part of contract? - if (dispute.getDepositTxSerialized() != null) - addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.depositTransactionId"), dispute.getDepositTxId()); + if (dispute.getDepositTxSerialized() != null) { + addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.makerDepositTransactionId"), contract.getMakerDepositTxHash()); + addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.takerDepositTransactionId"), contract.getTakerDepositTxHash()); + } if (dispute.getDelayedPayoutTxId() != null) addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.delayedPayoutTxId"), dispute.getDelayedPayoutTxId()); 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 cf10a09c..2dada4d9 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 @@ -18,8 +18,6 @@ package bisq.desktop.main.overlays.windows; import bisq.desktop.components.HavenoTextArea; -import bisq.desktop.components.TextFieldWithCopyIcon; -import bisq.desktop.components.TxIdTextField; import bisq.desktop.main.MainView; import bisq.desktop.main.overlays.Overlay; import bisq.desktop.util.DisplayUtils; @@ -33,9 +31,9 @@ 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.TradeManager; import bisq.core.trade.Contract; import bisq.core.trade.Trade; +import bisq.core.trade.TradeManager; import bisq.core.trade.txproof.AssetTxProofResult; import bisq.core.util.FormattingUtils; import bisq.core.util.VolumeUtil; @@ -46,9 +44,6 @@ import bisq.network.p2p.NodeAddress; import bisq.common.UserThread; import bisq.common.util.Tuple3; -import org.bitcoinj.core.Transaction; -import org.bitcoinj.core.Utils; - import javax.inject.Inject; import javax.inject.Named; @@ -273,13 +268,11 @@ public class TradeDetailsWindow extends Overlay { Res.get(contract.getPaymentMethodId())); } - addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.makerFeeTxId"), offer.getOfferFeePaymentTxId()); - if (trade.getMakerDepositTx() != null) - addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.depositTransactionId"), // TODO (woodser): separate UI labels for deposit tx ids + addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.makerDepositTransactionId"), trade.getMakerDepositTx().getHash()); if (trade.getTakerDepositTx() != null) - addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.depositTransactionId"), // TODO (woodser): separate UI labels for deposit tx ids + addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.takerDepositTransactionId"), trade.getTakerDepositTx().getHash()); if (trade.getPayoutTxId() != null) diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java index 3573d492..d4a1c6ce 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java @@ -335,8 +335,7 @@ public abstract class TradeStepView extends AnchorPane { // self's deposit tx id final Tuple3 labelSelfTxIdTextFieldVBoxTuple3 = - addTopLabelTxIdTextField(gridPane, gridRow, - "Your " + Res.get("shared.depositTransactionId").toLowerCase(), + addTopLabelTxIdTextField(gridPane, gridRow, Res.get("shared.yourDepositTransactionId"), Layout.COMPACT_FIRST_ROW_DISTANCE); GridPane.setColumnSpan(labelSelfTxIdTextFieldVBoxTuple3.third, 2); @@ -350,8 +349,7 @@ public abstract class TradeStepView extends AnchorPane { // peer's deposit tx id final Tuple3 labelPeerTxIdTextFieldVBoxTuple3 = - addTopLabelTxIdTextField(gridPane, ++gridRow, - "Peer's " + Res.get("shared.depositTransactionId").toLowerCase(), + addTopLabelTxIdTextField(gridPane, ++gridRow, Res.get("shared.peerDepositTransactionId"), -Layout.GROUP_DISTANCE_WITHOUT_SEPARATOR); GridPane.setColumnSpan(labelPeerTxIdTextFieldVBoxTuple3.third, 2); @@ -644,7 +642,7 @@ public abstract class TradeStepView extends AnchorPane { } Optional optionalDispute = model.dataModel.mediationManager.findDispute(trade.getId()); - if (!optionalDispute.isPresent()) { + if (optionalDispute.isEmpty()) { return; } @@ -656,14 +654,14 @@ public abstract class TradeStepView extends AnchorPane { log.error("trade.getMakerDepositTx() was null at openMediationResultPopup. " + "We add the trade to failed trades. TradeId={}", trade.getId()); //model.dataModel.addTradeToFailedTrades(); // TODO (woodser): new way to move trade to failed trades? - model.dataModel.onMoveInvalidTradeToFailedTrades(trade);; + model.dataModel.onMoveInvalidTradeToFailedTrades(trade); new Popup().warning(Res.get("portfolio.pending.mediationResult.error.depositTxNull")).show(); // TODO (woodser): separate error messages for maker/taker return; } else if (trade instanceof TakerTrade && trade.getTakerDepositTx() == null) { log.error("trade.getTakerDepositTx() was null at openMediationResultPopup. " + "We add the trade to failed trades. TradeId={}", trade.getId()); //model.dataModel.addTradeToFailedTrades(); - model.dataModel.onMoveInvalidTradeToFailedTrades(trade);; + model.dataModel.onMoveInvalidTradeToFailedTrades(trade); new Popup().warning(Res.get("portfolio.pending.mediationResult.error.depositTxNull")).show(); return; }