From 355a6146b683020f6b693b859f0b70d15425faaa Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 1 Sep 2022 15:11:37 -0400 Subject: [PATCH] add confirmed trade state --- .../method/trade/AbstractTradeTest.java | 2 +- .../method/trade/TakeBuyBTCOfferTest.java | 4 +- ...keBuyBTCOfferWithNationalBankAcctTest.java | 4 +- .../method/trade/TakeBuyXMROfferTest.java | 2 +- .../method/trade/TakeSellBTCOfferTest.java | 2 +- .../method/trade/TakeSellXMROfferTest.java | 4 +- core/src/main/java/bisq/core/trade/Trade.java | 76 +++++++------------ .../core/trade/protocol/BuyerProtocol.java | 2 +- .../core/trade/protocol/SellerProtocol.java | 4 +- .../resources/i18n/displayStrings.properties | 2 +- .../i18n/displayStrings_cs.properties | 2 +- .../i18n/displayStrings_de.properties | 2 +- .../i18n/displayStrings_es.properties | 2 +- .../i18n/displayStrings_fa.properties | 2 +- .../i18n/displayStrings_fr.properties | 2 +- .../i18n/displayStrings_it.properties | 2 +- .../i18n/displayStrings_ja.properties | 2 +- .../i18n/displayStrings_pt-br.properties | 2 +- .../i18n/displayStrings_pt.properties | 2 +- .../i18n/displayStrings_ru.properties | 2 +- .../i18n/displayStrings_th.properties | 2 +- .../i18n/displayStrings_vi.properties | 2 +- .../i18n/displayStrings_zh-hans.properties | 2 +- .../i18n/displayStrings_zh-hant.properties | 2 +- .../notifications/NotificationCenter.java | 5 +- .../pendingtrades/PendingTradesViewModel.java | 4 +- proto/src/main/proto/pb.proto | 56 +++++++------- 27 files changed, 90 insertions(+), 105 deletions(-) diff --git a/apitest/src/test/java/bisq/apitest/method/trade/AbstractTradeTest.java b/apitest/src/test/java/bisq/apitest/method/trade/AbstractTradeTest.java index 36be727969..eb8cb44cae 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/AbstractTradeTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/AbstractTradeTest.java @@ -74,7 +74,7 @@ public class AbstractTradeTest extends AbstractOfferTest { return trade; } - protected final void waitForDepositConfirmation(Logger log, + protected final void waitForDepositUnlocked(Logger log, TestInfo testInfo, GrpcClient grpcClient, String tradeId) { diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java index c8a9957990..15688ec6c2 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java @@ -77,7 +77,7 @@ public class TakeBuyBTCOfferTest extends AbstractTradeTest { alicesUsdOffers = aliceClient.getMyOffersSortedByDate(BUY.name(), USD); assertEquals(0, alicesUsdOffers.size()); genBtcBlocksThenWait(1, 2_500); - waitForDepositConfirmation(log, testInfo, bobClient, trade.getTradeId()); + waitForDepositUnlocked(log, testInfo, bobClient, trade.getTradeId()); trade = bobClient.getTrade(tradeId); verifyTakerDepositConfirmed(trade); @@ -93,7 +93,7 @@ public class TakeBuyBTCOfferTest extends AbstractTradeTest { public void testAlicesConfirmPaymentStarted(final TestInfo testInfo) { try { var trade = aliceClient.getTrade(tradeId); - waitForDepositConfirmation(log, testInfo, aliceClient, trade.getTradeId()); + waitForDepositUnlocked(log, testInfo, aliceClient, trade.getTradeId()); aliceClient.confirmPaymentStarted(trade.getTradeId()); sleep(6_000); waitForBuyerSeesPaymentInitiatedMessage(log, testInfo, aliceClient, tradeId); diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferWithNationalBankAcctTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferWithNationalBankAcctTest.java index e15cf248eb..378f62ce15 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferWithNationalBankAcctTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferWithNationalBankAcctTest.java @@ -139,7 +139,7 @@ public class TakeBuyBTCOfferWithNationalBankAcctTest extends AbstractTradeTest { alicesOffers = aliceClient.getMyOffersSortedByDate(BUY.name(), BRL); assertEquals(0, alicesOffers.size()); genBtcBlocksThenWait(1, 2_500); - waitForDepositConfirmation(log, testInfo, bobClient, trade.getTradeId()); + waitForDepositUnlocked(log, testInfo, bobClient, trade.getTradeId()); trade = bobClient.getTrade(tradeId); verifyTakerDepositConfirmed(trade); @@ -176,7 +176,7 @@ public class TakeBuyBTCOfferWithNationalBankAcctTest extends AbstractTradeTest { public void testAlicesConfirmPaymentStarted(final TestInfo testInfo) { try { var trade = aliceClient.getTrade(tradeId); - waitForDepositConfirmation(log, testInfo, aliceClient, trade.getTradeId()); + waitForDepositUnlocked(log, testInfo, aliceClient, trade.getTradeId()); aliceClient.confirmPaymentStarted(trade.getTradeId()); sleep(6_000); waitForBuyerSeesPaymentInitiatedMessage(log, testInfo, aliceClient, tradeId); diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyXMROfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyXMROfferTest.java index 73df80550c..b56b451a13 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyXMROfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyXMROfferTest.java @@ -83,7 +83,7 @@ public class TakeBuyXMROfferTest extends AbstractTradeTest { alicesXmrOffers = aliceClient.getMyOffersSortedByDate(XMR); assertEquals(0, alicesXmrOffers.size()); genBtcBlocksThenWait(1, 2_500); - waitForDepositConfirmation(log, testInfo, bobClient, trade.getTradeId()); + waitForDepositUnlocked(log, testInfo, bobClient, trade.getTradeId()); trade = bobClient.getTrade(tradeId); verifyTakerDepositConfirmed(trade); diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java index 5f9aecb4a9..ed38f79402 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java @@ -84,7 +84,7 @@ public class TakeSellBTCOfferTest extends AbstractTradeTest { var takeableUsdOffers = bobClient.getOffersSortedByDate(SELL.name(), USD); assertEquals(0, takeableUsdOffers.size()); genBtcBlocksThenWait(1, 2_500); - waitForDepositConfirmation(log, testInfo, bobClient, trade.getTradeId()); + waitForDepositUnlocked(log, testInfo, bobClient, trade.getTradeId()); trade = bobClient.getTrade(tradeId); verifyTakerDepositConfirmed(trade); logTrade(log, testInfo, "Alice's Maker/Buyer View", aliceClient.getTrade(tradeId)); diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellXMROfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellXMROfferTest.java index 03582392d8..5d2bcbbced 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellXMROfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellXMROfferTest.java @@ -93,7 +93,7 @@ public class TakeSellXMROfferTest extends AbstractTradeTest { assertEquals(0, alicesXmrOffers.size()); genBtcBlocksThenWait(1, 2_500); - waitForDepositConfirmation(log, testInfo, bobClient, trade.getTradeId()); + waitForDepositUnlocked(log, testInfo, bobClient, trade.getTradeId()); trade = bobClient.getTrade(tradeId); verifyTakerDepositConfirmed(trade); @@ -109,7 +109,7 @@ public class TakeSellXMROfferTest extends AbstractTradeTest { public void testAlicesConfirmPaymentStarted(final TestInfo testInfo) { try { var trade = aliceClient.getTrade(tradeId); - waitForDepositConfirmation(log, testInfo, aliceClient, trade.getTradeId()); + waitForDepositUnlocked(log, testInfo, aliceClient, trade.getTradeId()); log.debug("Alice sends XMR payment to Bob for trade {}", trade.getTradeId()); aliceClient.confirmPaymentStarted(trade.getTradeId()); sleep(3500); diff --git a/core/src/main/java/bisq/core/trade/Trade.java b/core/src/main/java/bisq/core/trade/Trade.java index 9ca4204e9c..0674634490 100644 --- a/core/src/main/java/bisq/core/trade/Trade.java +++ b/core/src/main/java/bisq/core/trade/Trade.java @@ -121,10 +121,11 @@ public abstract class Trade implements Tradable, Model { SEND_FAILED_PUBLISH_DEPOSIT_TX_REQUEST(Phase.DEPOSIT_REQUESTED), // deposit published - SAW_DEPOSIT_TXS_IN_NETWORK(Phase.DEPOSITS_PUBLISHED), // TODO: seeing in network usually happens after arbitrator publishes + DEPOSIT_TXS_SEEN_IN_BLOCKCHAIN(Phase.DEPOSITS_PUBLISHED), // TODO: seeing in network usually happens after arbitrator publishes ARBITRATOR_PUBLISHED_DEPOSIT_TXS(Phase.DEPOSITS_PUBLISHED), // deposit confirmed (TODO) + DEPOSIT_TXS_CONFIRMED_IN_BLOCKCHAIN(Phase.DEPOSITS_CONFIRMED), // deposit unlocked DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN(Phase.DEPOSITS_UNLOCKED), @@ -191,6 +192,7 @@ public abstract class Trade implements Tradable, Model { INIT, DEPOSIT_REQUESTED, // TODO (woodser): remove unused phases DEPOSITS_PUBLISHED, + DEPOSITS_CONFIRMED, DEPOSITS_UNLOCKED, PAYMENT_SENT, PAYMENT_RECEIVED, @@ -849,7 +851,6 @@ public abstract class Trade implements Tradable, Model { } // get daemon and primary wallet - MoneroDaemon daemon = processModel.getXmrWalletService().getDaemon(); MoneroWallet havenoWallet = processModel.getXmrWalletService().getWallet(); // fetch deposit txs from daemon @@ -857,19 +858,19 @@ public abstract class Trade implements Tradable, Model { // handle deposit txs seen if (txs.size() == 2) { + setStatePublished(); boolean makerFirst = txs.get(0).getHash().equals(processModel.getMaker().getDepositTxHash()); makerDepositTx = makerFirst ? txs.get(0) : txs.get(1); takerDepositTx = makerFirst ? txs.get(1) : txs.get(0); // check if deposit txs unlocked if (txs.get(0).isConfirmed() && txs.get(1).isConfirmed()) { + setStateConfirmed(); long unlockHeight = Math.max(txs.get(0).getHeight(), txs.get(1).getHeight()) + XmrWalletService.NUM_BLOCKS_UNLOCK; if (havenoWallet.getHeight() >= unlockHeight) { - setUnlockedState(); + setStateUnlocked(); return; } - } else { - setStateIfValidTransitionTo(Trade.State.SAW_DEPOSIT_TXS_IN_NETWORK); } } @@ -880,39 +881,40 @@ public abstract class Trade implements Tradable, Model { @Override public void onNewBlock(long height) { - // ignore if no longer listening + // skip if no longer listening if (depositTxListener == null) return; // use latest height height = havenoWallet.getHeight(); - // ignore if before unlock height + // skip if before unlock height if (unlockHeight != null && height < unlockHeight) return; // fetch txs from daemon List txs = xmrWalletService.getTxs(Arrays.asList(processModel.getMaker().getDepositTxHash(), processModel.getTaker().getDepositTxHash())); - // ignore if deposit txs not seen + // skip if deposit txs not seen if (txs.size() != 2) return; + setStatePublished(); // update deposit txs boolean makerFirst = txs.get(0).getHash().equals(processModel.getMaker().getDepositTxHash()); makerDepositTx = makerFirst ? txs.get(0) : txs.get(1); takerDepositTx = makerFirst ? txs.get(1) : txs.get(0); - // compute unlock height - if (unlockHeight == null && txs.size() == 2 && txs.get(0).isConfirmed() && txs.get(1).isConfirmed()) { + // check if deposit txs confirmed and compute unlock height + if (txs.size() == 2 && txs.get(0).isConfirmed() && txs.get(1).isConfirmed() && unlockHeight == null) { + log.info("Multisig deposits confirmed for trade {}", getId()); + setStateConfirmed(); unlockHeight = Math.max(txs.get(0).getHeight(), txs.get(1).getHeight()) + XmrWalletService.NUM_BLOCKS_UNLOCK; } - + // check if deposit txs unlocked if (unlockHeight != null && height >= unlockHeight) { log.info("Multisig deposits unlocked for trade {}", getId()); - setUnlockedState(); xmrWalletService.removeWalletListener(depositTxListener); // remove listener when notified depositTxListener = null; // prevent re-applying trade state in subsequent requests - } else if (txs.size() == 2) { - setStateIfValidTransitionTo(Trade.State.SAW_DEPOSIT_TXS_IN_NETWORK); + setStateUnlocked(); } } }; @@ -1299,6 +1301,10 @@ public abstract class Trade implements Tradable, Model { disputeState != DisputeState.REFUND_REQUEST_CLOSED; } + public boolean isDepositConfirmed() { + return getState().getPhase().ordinal() >= Phase.DEPOSITS_CONFIRMED.ordinal(); + } + public boolean isDepositUnlocked() { return getState().getPhase().ordinal() >= Phase.DEPOSITS_UNLOCKED.ordinal(); } @@ -1434,40 +1440,16 @@ public abstract class Trade implements Tradable, Model { return tradeVolumeProperty; } -// private void setupConfidenceListener() { -// if (getDepositTx() != null) { -// TransactionConfidence transactionConfidence = getDepositTx().getConfidence(); -// if (transactionConfidence.getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING) { -// setConfirmedState(); -// } else { -// ListenableFuture future = transactionConfidence.getDepthFuture(1); -// Futures.addCallback(future, new FutureCallback<>() { -// @Override -// public void onSuccess(TransactionConfidence result) { -// setConfirmedState(); -// } -// -// @Override -// public void onFailure(@NotNull Throwable t) { -// t.printStackTrace(); -// log.error(t.getMessage()); -// throw new RuntimeException(t); -// } -// }, MoreExecutors.directExecutor()); -// } -// } else { -// log.error("depositTx == null. That must not happen."); -// } -// } + private void setStatePublished() { + if (!isDepositPublished()) setState(State.DEPOSIT_TXS_SEEN_IN_BLOCKCHAIN); + } - private void setUnlockedState() { - // we only apply the state if we are not already further in the process - if (!isDepositUnlocked()) { - // As setState is called here from the trade itself we cannot trigger a requestPersistence call. - // But as we get setupConfidenceListener called at startup anyway there is no issue if it would not be - // persisted in case the shutdown routine did not persist the trade. - setStateIfValidTransitionTo(State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN); // TODO (woodser): for xmr this means deposit txs have unlocked after 10 confirmations - } + private void setStateConfirmed() { + if (!isDepositConfirmed()) setState(State.DEPOSIT_TXS_CONFIRMED_IN_BLOCKCHAIN); + } + + private void setStateUnlocked() { + if (!isDepositUnlocked()) setState(State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN); } @Override diff --git a/core/src/main/java/bisq/core/trade/protocol/BuyerProtocol.java b/core/src/main/java/bisq/core/trade/protocol/BuyerProtocol.java index fb5cfe3655..786e16eff3 100644 --- a/core/src/main/java/bisq/core/trade/protocol/BuyerProtocol.java +++ b/core/src/main/java/bisq/core/trade/protocol/BuyerProtocol.java @@ -55,7 +55,7 @@ public abstract class BuyerProtocol extends DisputeProtocol { // TODO: run with trade lock and latch, otherwise getting invalid transition warnings on startup after offline trades - given(phase(Trade.Phase.DEPOSITS_PUBLISHED) + given(anyPhase(Trade.Phase.DEPOSIT_REQUESTED, Trade.Phase.DEPOSITS_PUBLISHED, Trade.Phase.DEPOSITS_CONFIRMED) .with(BuyerEvent.STARTUP)) .setup(tasks(SetupDepositTxsListener.class)) .executeTasks(); diff --git a/core/src/main/java/bisq/core/trade/protocol/SellerProtocol.java b/core/src/main/java/bisq/core/trade/protocol/SellerProtocol.java index 9d175f26ac..b79c07f8a5 100644 --- a/core/src/main/java/bisq/core/trade/protocol/SellerProtocol.java +++ b/core/src/main/java/bisq/core/trade/protocol/SellerProtocol.java @@ -48,9 +48,9 @@ public abstract class SellerProtocol extends DisputeProtocol { protected void onInitialized() { super.onInitialized(); - // TODO: run with trade lock and latch, otherwise getting invalid transition warnings on startup after offline trades + // TODO: run with trade lock and latch, otherwise getting invalid transition warnings on startup after offline trades - given(phase(Trade.Phase.DEPOSITS_PUBLISHED) + given(anyPhase(Trade.Phase.DEPOSIT_REQUESTED, Trade.Phase.DEPOSITS_PUBLISHED, Trade.Phase.DEPOSITS_CONFIRMED) .with(BuyerEvent.STARTUP)) .setup(tasks(SetupDepositTxsListener.class)) .executeTasks(); diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 087fa75d9c..1d0aace4e6 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -2203,7 +2203,7 @@ notification.trade.headline=Notification for trade with ID {0} notification.ticket.headline=Support ticket for trade with ID {0} notification.trade.completed=The trade is now completed and you can withdraw your funds. notification.trade.accepted=Your offer has been accepted by a XMR {0}. -notification.trade.confirmed=Your trade has been confirmed.\nYou can start the payment now. +notification.trade.unlocked=Your trade has been confirmed.\nYou can start the payment now. notification.trade.paymentStarted=The XMR buyer has started the payment. notification.trade.selectTrade=Select trade notification.trade.peerOpenedDispute=Your trading peer has opened a {0}. diff --git a/core/src/main/resources/i18n/displayStrings_cs.properties b/core/src/main/resources/i18n/displayStrings_cs.properties index 4b1e1fdc74..f13ff1e062 100644 --- a/core/src/main/resources/i18n/displayStrings_cs.properties +++ b/core/src/main/resources/i18n/displayStrings_cs.properties @@ -1686,7 +1686,7 @@ notification.trade.headline=Oznámení o obchodu s ID {0} notification.ticket.headline=Úkol na podporu pro obchod s ID {0} notification.trade.completed=Obchod je nyní dokončen a můžete si vybrat své prostředky. notification.trade.accepted=Vaše nabídka byla přijata BTC {0}. -notification.trade.confirmed=Váš obchod má alespoň jedno potvrzení blockchainu.\nPlatbu můžete začít hned teď. +notification.trade.unlocked=Váš obchod má alespoň jedno potvrzení blockchainu.\nPlatbu můžete začít hned teď. notification.trade.paymentStarted=Kupující BTC zahájil platbu. notification.trade.selectTrade=Vyberte obchod notification.trade.peerOpenedDispute=Váš obchodní partner otevřel {0}. diff --git a/core/src/main/resources/i18n/displayStrings_de.properties b/core/src/main/resources/i18n/displayStrings_de.properties index 9d5db8c9a9..3c6e9f7a33 100644 --- a/core/src/main/resources/i18n/displayStrings_de.properties +++ b/core/src/main/resources/i18n/displayStrings_de.properties @@ -1686,7 +1686,7 @@ notification.trade.headline=Benachrichtigung zum Handel mit der ID {0} notification.ticket.headline=Support-Ticket für den Handel mit der ID {0} notification.trade.completed=Ihr Handel ist jetzt abgeschlossen und Sie können Ihre Gelder abheben. notification.trade.accepted=Ihr Angebot wurde von einem BTC-{0} angenommen. -notification.trade.confirmed=Ihr Handel hat wenigstens eine Blockchain-Bestätigung.\nSie können die Zahlung nun beginnen. +notification.trade.unlocked=Ihr Handel hat wenigstens eine Blockchain-Bestätigung.\nSie können die Zahlung nun beginnen. notification.trade.paymentStarted=Der BTC-Käufer hat die Zahlung begonnen. notification.trade.selectTrade=Handel wählen notification.trade.peerOpenedDispute=Ihr Handelspartner hat ein/einen {0} geöffnet. diff --git a/core/src/main/resources/i18n/displayStrings_es.properties b/core/src/main/resources/i18n/displayStrings_es.properties index bd9c447977..463dd5e312 100644 --- a/core/src/main/resources/i18n/displayStrings_es.properties +++ b/core/src/main/resources/i18n/displayStrings_es.properties @@ -1686,7 +1686,7 @@ notification.trade.headline=Notificación de intercambio con ID {0} notification.ticket.headline=Ticket de soporte de intercambio con ID {0} notification.trade.completed=El intercambio se ha completado y puede retirar sus fondos. notification.trade.accepted=Su oferta ha sido aceptada por un {0} BTC -notification.trade.confirmed=Su intercambio tiene al menos una confirmación en la cadena de bloques.\nPuede comenzar el pago ahora. +notification.trade.unlocked=Su intercambio tiene al menos una confirmación en la cadena de bloques.\nPuede comenzar el pago ahora. notification.trade.paymentStarted=El comprador de BTC ha comenzado el pago. notification.trade.selectTrade=Seleccionar intercambio notification.trade.peerOpenedDispute=Su pareja de intercambio ha abierto un {0}. diff --git a/core/src/main/resources/i18n/displayStrings_fa.properties b/core/src/main/resources/i18n/displayStrings_fa.properties index 57dec4197f..681bf71857 100644 --- a/core/src/main/resources/i18n/displayStrings_fa.properties +++ b/core/src/main/resources/i18n/displayStrings_fa.properties @@ -1686,7 +1686,7 @@ notification.trade.headline=اعلان برای معامله با شناسه {0} notification.ticket.headline=تیکت پشتیبانی برای معامله با شناسه {0} notification.trade.completed=معامله اکنون کامل شده است و می توانید وجوه خود را برداشت کنید. notification.trade.accepted=پیشنهاد شما توسط BTC {0} پذیرفته شده است. -notification.trade.confirmed=معامله شما دارای حداقل یک تایید بلاک چین است.\n شما اکنون می توانید پرداخت را شروع کنید. +notification.trade.unlocked=معامله شما دارای حداقل یک تایید بلاک چین است.\n شما اکنون می توانید پرداخت را شروع کنید. notification.trade.paymentStarted=خریدار BTC پرداخت را آغاز کرده است. notification.trade.selectTrade=انتخاب معامله notification.trade.peerOpenedDispute=همتای معامله شما یک {0} را باز کرده است. diff --git a/core/src/main/resources/i18n/displayStrings_fr.properties b/core/src/main/resources/i18n/displayStrings_fr.properties index df4cddd6ed..e4b2621aa2 100644 --- a/core/src/main/resources/i18n/displayStrings_fr.properties +++ b/core/src/main/resources/i18n/displayStrings_fr.properties @@ -1687,7 +1687,7 @@ notification.trade.headline=Notification pour la transaction avec l''ID {0} notification.ticket.headline=Ticket de support pour l''échange avec l''ID {0} notification.trade.completed=La transaction est maintenant terminée et vous pouvez retirer vos fonds. notification.trade.accepted=Votre ordre a été accepté par un BTC {0}. -notification.trade.confirmed=Votre échange avait au moins une confirmation sur la blockchain.\nVous pouvez effectuer le paiement maintenant. +notification.trade.unlocked=Votre échange avait au moins une confirmation sur la blockchain.\nVous pouvez effectuer le paiement maintenant. notification.trade.paymentStarted=L'acheteur de BTC a initié le paiement. notification.trade.selectTrade=Choisir un trade notification.trade.peerOpenedDispute=Votre pair de trading a ouvert un {0}. diff --git a/core/src/main/resources/i18n/displayStrings_it.properties b/core/src/main/resources/i18n/displayStrings_it.properties index 6292a1934d..05f1537185 100644 --- a/core/src/main/resources/i18n/displayStrings_it.properties +++ b/core/src/main/resources/i18n/displayStrings_it.properties @@ -1686,7 +1686,7 @@ notification.trade.headline=Notifica per scambi con ID {0} notification.ticket.headline=Biglietto di supporto per scambi con ID {0} notification.trade.completed=Il commercio è ora completato e puoi ritirare i tuoi fondi. notification.trade.accepted=La tua offerta è stata accettata da un BTC {0}. -notification.trade.confirmed=Il tuo trade ha almeno una conferma blockchain.\nPuoi iniziare il pagamento ora. +notification.trade.unlocked=Il tuo trade ha almeno una conferma blockchain.\nPuoi iniziare il pagamento ora. notification.trade.paymentStarted=L'acquirente BTC ha avviato il pagamento. notification.trade.selectTrade=Seleziona scambio notification.trade.peerOpenedDispute=Il tuo peer di trading ha aperto un {0}. diff --git a/core/src/main/resources/i18n/displayStrings_ja.properties b/core/src/main/resources/i18n/displayStrings_ja.properties index f83d0d3869..12c177a694 100644 --- a/core/src/main/resources/i18n/displayStrings_ja.properties +++ b/core/src/main/resources/i18n/displayStrings_ja.properties @@ -1686,7 +1686,7 @@ notification.trade.headline=ID {0}とのトレードの通知 notification.ticket.headline=ID {0}とのトレード用サポートチケット notification.trade.completed=これでトレードは完了し、資金を出金することができます。 notification.trade.accepted=あなたのオファーはBTC {0}によって承認されました。 -notification.trade.confirmed=あなたのトレードには少なくとも1つのブロックチェーン承認があります。\nあなたは今、支払いを始めることができます。 +notification.trade.unlocked=あなたのトレードには少なくとも1つのブロックチェーン承認があります。\nあなたは今、支払いを始めることができます。 notification.trade.paymentStarted=BTCの買い手が支払いを開始しました。 notification.trade.selectTrade=取引を選択 notification.trade.peerOpenedDispute=あなたの取引相手は{0}をオープンしました。 diff --git a/core/src/main/resources/i18n/displayStrings_pt-br.properties b/core/src/main/resources/i18n/displayStrings_pt-br.properties index 5f2741b821..43836d9301 100644 --- a/core/src/main/resources/i18n/displayStrings_pt-br.properties +++ b/core/src/main/resources/i18n/displayStrings_pt-br.properties @@ -1694,7 +1694,7 @@ notification.trade.headline=Notificação para o oferta com ID {0} notification.ticket.headline=Ticket de suporte para a oferta com ID {0} notification.trade.completed=A negociação foi concluída e você já pode retirar seus fundos. notification.trade.accepted=Sua oferta foi aceita por um {0}. -notification.trade.confirmed=Sua negociação tem pelo menos uma confirmação da blockchain.\nVocê já pode iniciar o pagamento. +notification.trade.unlocked=Sua negociação tem pelo menos uma confirmação da blockchain.\nVocê já pode iniciar o pagamento. notification.trade.paymentStarted=O comprador BTC iniciou o pagamento notification.trade.selectTrade=Selecionar negociação notification.trade.peerOpenedDispute=Seu parceiro de negociação abriu um {0}. diff --git a/core/src/main/resources/i18n/displayStrings_pt.properties b/core/src/main/resources/i18n/displayStrings_pt.properties index 9d7ef1892b..ceec7c0a40 100644 --- a/core/src/main/resources/i18n/displayStrings_pt.properties +++ b/core/src/main/resources/i18n/displayStrings_pt.properties @@ -1684,7 +1684,7 @@ notification.trade.headline=Notificação para o oferta com ID {0} notification.ticket.headline=Bilhete de apoio para o negócio com ID {0} notification.trade.completed=O negócio completou e você já pode levantar seus fundos. notification.trade.accepted=Sua oferta foi aceite por um {0} de BTC. -notification.trade.confirmed=Seu negócio tem pelo menos uma confirmação da blockchain.\nVocê pode começar o pagamento agora. +notification.trade.unlocked=Seu negócio tem pelo menos uma confirmação da blockchain.\nVocê pode começar o pagamento agora. notification.trade.paymentStarted=O comprador de BTC iniciou o pagamento notification.trade.selectTrade=Selecionar negócio notification.trade.peerOpenedDispute=Seu par de negociação abriu um {0}. diff --git a/core/src/main/resources/i18n/displayStrings_ru.properties b/core/src/main/resources/i18n/displayStrings_ru.properties index fe8ede8782..80725d6858 100644 --- a/core/src/main/resources/i18n/displayStrings_ru.properties +++ b/core/src/main/resources/i18n/displayStrings_ru.properties @@ -1686,7 +1686,7 @@ notification.trade.headline=Уведомление о сделке с идент notification.ticket.headline=Запрос в службу поддержки для сделки с идентификатором {0} notification.trade.completed=Сделка завершена, и вы можете вывести свои средства. notification.trade.accepted=Ваше предложение принял {0} ВТС. -notification.trade.confirmed=Ваша сделка была подтверждена в блокчейне не менее одного раза.\nМожете начать оплату. +notification.trade.unlocked=Ваша сделка была подтверждена в блокчейне не менее одного раза.\nМожете начать оплату. notification.trade.paymentStarted=Покупатель ВТС начал оплату. notification.trade.selectTrade=Выбрать сделку notification.trade.peerOpenedDispute=Ваш контрагент открыл {0}. diff --git a/core/src/main/resources/i18n/displayStrings_th.properties b/core/src/main/resources/i18n/displayStrings_th.properties index 8bdab2f127..61112a5d07 100644 --- a/core/src/main/resources/i18n/displayStrings_th.properties +++ b/core/src/main/resources/i18n/displayStrings_th.properties @@ -1686,7 +1686,7 @@ notification.trade.headline=การแจ้งเตือนการซื notification.ticket.headline=ศูนย์ช่วยเหลือสนับสนุนการซื้อขายด้วย ID {0} notification.trade.completed=การค้าเสร็จสิ้นแล้วและคุณสามารถถอนเงินของคุณได้ notification.trade.accepted=ข้อเสนอของคุณได้รับการยอมรับจาก BTC {0} แล้ว -notification.trade.confirmed=การซื้อขายของคุณมีการยืนยัน blockchain อย่างน้อยหนึ่งรายการ\nคุณสามารถเริ่มการชำระเงินได้เลย +notification.trade.unlocked=การซื้อขายของคุณมีการยืนยัน blockchain อย่างน้อยหนึ่งรายการ\nคุณสามารถเริ่มการชำระเงินได้เลย notification.trade.paymentStarted=ผู้ซื้อ BTC ได้เริ่มการชำระเงินแล้ว notification.trade.selectTrade=เลือกการซื้อขาย notification.trade.peerOpenedDispute=เครือข่ายทางการค้าของคุณได้เริ่มต้นเปิดที่ {0} diff --git a/core/src/main/resources/i18n/displayStrings_vi.properties b/core/src/main/resources/i18n/displayStrings_vi.properties index 07932e84d6..c0c82d1eda 100644 --- a/core/src/main/resources/i18n/displayStrings_vi.properties +++ b/core/src/main/resources/i18n/displayStrings_vi.properties @@ -1688,7 +1688,7 @@ notification.trade.headline=Thông báo với giao dịch có ID {0} notification.ticket.headline=Vé hỗ trợ cho giao dịch có ID {0} notification.trade.completed=giao dịch đã hoàn thành và bạn có thể rút tiền. notification.trade.accepted=Chào giá của bạn đã được chấp thuận bởi BTC {0}. -notification.trade.confirmed=giao dịch của bạn có ít nhất một xác nhận blockchain.\nBạn có thể bắt đầu thanh toán bây giờ. +notification.trade.unlocked=giao dịch của bạn có ít nhất một xác nhận blockchain.\nBạn có thể bắt đầu thanh toán bây giờ. notification.trade.paymentStarted=Người mua BTC đã bắt đầu thanh toán. notification.trade.selectTrade=Lựa chọn giao dịch notification.trade.peerOpenedDispute=Đối tác giao dịch của bạn đã mở một {0}. diff --git a/core/src/main/resources/i18n/displayStrings_zh-hans.properties b/core/src/main/resources/i18n/displayStrings_zh-hans.properties index 7b93191bc7..debdd77460 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hans.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hans.properties @@ -1690,7 +1690,7 @@ notification.trade.headline=交易 ID {0} 的通知 notification.ticket.headline=交易 ID {0} 的帮助话题 notification.trade.completed=交易现在完成,您可以提取资金。 notification.trade.accepted=您 BTC {0} 的报价被接受。 -notification.trade.confirmed=您的交易至少有一个区块链确认。\n您现在可以开始付款。 +notification.trade.unlocked=您的交易至少有一个区块链确认。\n您现在可以开始付款。 notification.trade.paymentStarted=BTC 买家已经开始付款。 notification.trade.selectTrade=选择交易 notification.trade.peerOpenedDispute=您的交易对象创建了一个 {0}。 diff --git a/core/src/main/resources/i18n/displayStrings_zh-hant.properties b/core/src/main/resources/i18n/displayStrings_zh-hant.properties index 778ef89b8a..6cd1fe35fd 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hant.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hant.properties @@ -1686,7 +1686,7 @@ notification.trade.headline=交易 ID {0} 的通知 notification.ticket.headline=交易 ID {0} 的幫助話題 notification.trade.completed=交易現在完成,您可以提取資金。 notification.trade.accepted=您 BTC {0} 的報價被接受。 -notification.trade.confirmed=您的交易至少有一個區塊鏈確認。\n您現在可以開始付款。 +notification.trade.unlocked=您的交易至少有一個區塊鏈確認。\n您現在可以開始付款。 notification.trade.paymentStarted=BTC 買家已經開始付款。 notification.trade.selectTrade=選擇交易 notification.trade.peerOpenedDispute=您的交易對象創建了一個 {0}。 diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/notifications/NotificationCenter.java b/desktop/src/main/java/bisq/desktop/main/overlays/notifications/NotificationCenter.java index b05dadd65c..1d5a2e3795 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/notifications/NotificationCenter.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/notifications/NotificationCenter.java @@ -187,13 +187,14 @@ public class NotificationCenter { message = Res.get("notification.trade.completed"); } else { if (trade instanceof MakerTrade && - phase.ordinal() == Trade.Phase.DEPOSITS_PUBLISHED.ordinal()) { + phase.ordinal() == Trade.Phase.DEPOSITS_PUBLISHED.ordinal() || + phase.ordinal() == Trade.Phase.DEPOSITS_CONFIRMED.ordinal()) { final String role = trade instanceof BuyerTrade ? Res.get("shared.seller") : Res.get("shared.buyer"); message = Res.get("notification.trade.accepted", role); } if (trade instanceof BuyerTrade && phase.ordinal() == Trade.Phase.DEPOSITS_UNLOCKED.ordinal()) - message = Res.get("notification.trade.confirmed"); + message = Res.get("notification.trade.unlocked"); else if (trade instanceof SellerTrade && phase.ordinal() == Trade.Phase.PAYMENT_SENT.ordinal()) message = Res.get("notification.trade.paymentStarted"); } diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java index 3249b12d8a..af17a7186b 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesViewModel.java @@ -420,12 +420,12 @@ public class PendingTradesViewModel extends ActivatableWithDataModel