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 7e3d0b50c3..151effb36e 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java @@ -162,14 +162,14 @@ public class TakeBuyBTCOfferTest extends AbstractTradeTest { trade = aliceClient.getTrade(tradeId); if (!trade.getIsPaymentSent()) { - log.warn("Alice still waiting for trade {} BUYER_SAW_ARRIVED_PAYMENT_INITIATED_MSG, attempt # {}", + log.warn("Alice still waiting for trade {} BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG, attempt # {}", trade.getShortId(), i); sleep(5000); continue; } else { assertEquals(OFFER_FEE_PAID.name(), trade.getOffer().getState()); - EXPECTED_PROTOCOL_STATUS.setState(BUYER_SAW_ARRIVED_PAYMENT_INITIATED_MSG) + EXPECTED_PROTOCOL_STATUS.setState(BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG) .setPhase(PAYMENT_SENT) .setFiatSent(true); verifyExpectedProtocolStatus(trade); @@ -189,7 +189,7 @@ public class TakeBuyBTCOfferTest extends AbstractTradeTest { var trade = bobClient.getTrade(tradeId); Predicate tradeStateAndPhaseCorrect = (t) -> - t.getState().equals(SELLER_RECEIVED_PAYMENT_INITIATED_MSG.name()) + t.getState().equals(SELLER_RECEIVED_PAYMENT_SENT_MSG.name()) && (t.getPhase().equals(PAYOUT_PUBLISHED.name()) || t.getPhase().equals(PAYMENT_SENT.name())); for (int i = 1; i <= maxTradeStateAndPhaseChecks.get(); i++) { 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 bac4b7a859..ab250251d4 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java @@ -164,7 +164,7 @@ public class TakeSellBTCOfferTest extends AbstractTradeTest { trade = bobClient.getTrade(tradeId); if (!trade.getIsPaymentSent()) { - log.warn("Bob still waiting for trade {} BUYER_SAW_ARRIVED_PAYMENT_INITIATED_MSG, attempt # {}", + log.warn("Bob still waiting for trade {} BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG, attempt # {}", trade.getShortId(), i); sleep(5000); @@ -172,7 +172,7 @@ public class TakeSellBTCOfferTest extends AbstractTradeTest { } else { // Note: offer.state == available assertEquals(AVAILABLE.name(), trade.getOffer().getState()); - EXPECTED_PROTOCOL_STATUS.setState(BUYER_SAW_ARRIVED_PAYMENT_INITIATED_MSG) + EXPECTED_PROTOCOL_STATUS.setState(BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG) .setPhase(PAYMENT_SENT) .setFiatSent(true); verifyExpectedProtocolStatus(trade); @@ -192,7 +192,7 @@ public class TakeSellBTCOfferTest extends AbstractTradeTest { var trade = aliceClient.getTrade(tradeId); Predicate tradeStateAndPhaseCorrect = (t) -> - t.getState().equals(SELLER_RECEIVED_PAYMENT_INITIATED_MSG.name()) + t.getState().equals(SELLER_RECEIVED_PAYMENT_SENT_MSG.name()) && (t.getPhase().equals(PAYOUT_PUBLISHED.name()) || t.getPhase().equals(PAYMENT_SENT.name())); for (int i = 1; i <= maxTradeStateAndPhaseChecks.get(); i++) { if (!tradeStateAndPhaseCorrect.test(trade)) { diff --git a/core/src/main/java/bisq/core/trade/Trade.java b/core/src/main/java/bisq/core/trade/Trade.java index 6312f02859..bfc729573a 100644 --- a/core/src/main/java/bisq/core/trade/Trade.java +++ b/core/src/main/java/bisq/core/trade/Trade.java @@ -154,21 +154,24 @@ public abstract class Trade implements Tradable, Model { // #################### Phase PAYMENT_SENT - BUYER_CONFIRMED_IN_UI_PAYMENT_INITIATED(Phase.PAYMENT_SENT), - BUYER_SENT_PAYMENT_INITIATED_MSG(Phase.PAYMENT_SENT), - BUYER_SAW_ARRIVED_PAYMENT_INITIATED_MSG(Phase.PAYMENT_SENT), - BUYER_STORED_IN_MAILBOX_PAYMENT_INITIATED_MSG(Phase.PAYMENT_SENT), - BUYER_SEND_FAILED_PAYMENT_INITIATED_MSG(Phase.PAYMENT_SENT), + BUYER_CONFIRMED_IN_UI_PAYMENT_SENT(Phase.PAYMENT_SENT), + BUYER_SENT_PAYMENT_SENT_MSG(Phase.PAYMENT_SENT), + BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG(Phase.PAYMENT_SENT), + BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG(Phase.PAYMENT_SENT), + BUYER_SEND_FAILED_PAYMENT_SENT_MSG(Phase.PAYMENT_SENT), - SELLER_RECEIVED_PAYMENT_INITIATED_MSG(Phase.PAYMENT_SENT), + SELLER_RECEIVED_PAYMENT_SENT_MSG(Phase.PAYMENT_SENT), // #################### Phase PAYMENT_RECEIVED // note that this state can also be triggered by auto confirmation feature SELLER_CONFIRMED_IN_UI_PAYMENT_RECEIPT(Phase.PAYMENT_RECEIVED), + SELLER_SENT_PAYMENT_RECEIVED_MSG(Phase.PAYMENT_RECEIVED), + SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG(Phase.PAYMENT_RECEIVED), + SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG(Phase.PAYMENT_RECEIVED), + SELLER_SEND_FAILED_PAYMENT_RECEIVED_MSG(Phase.PAYMENT_RECEIVED), // #################### Phase PAYOUT_PUBLISHED SELLER_PUBLISHED_PAYOUT_TX(Phase.PAYOUT_PUBLISHED), // TODO (woodser): this enum is over used, like during arbitration - SELLER_SENT_PAYOUT_TX_PUBLISHED_MSG(Phase.PAYOUT_PUBLISHED), SELLER_SAW_ARRIVED_PAYOUT_TX_PUBLISHED_MSG(Phase.PAYOUT_PUBLISHED), SELLER_STORED_IN_MAILBOX_PAYOUT_TX_PUBLISHED_MSG(Phase.PAYOUT_PUBLISHED), @@ -850,10 +853,10 @@ public abstract class Trade implements Tradable, Model { walletService.closeMultisigWallet(getId()); // update trade state - this.getSelf().setPayoutTxHex(signedPayoutTxHex); - this.setPayoutTx(parsedTxSet.getTxs().get(0)); - this.setPayoutTxId(parsedTxSet.getTxs().get(0).getHash()); - this.setState(Trade.State.SELLER_PUBLISHED_PAYOUT_TX); + getSelf().setPayoutTxHex(signedPayoutTxHex); + setPayoutTx(parsedTxSet.getTxs().get(0)); + setPayoutTxId(parsedTxSet.getTxs().get(0).getHash()); + setState(isBuyer() ? Trade.State.BUYER_PUBLISHED_PAYOUT_TX : Trade.State.SELLER_PUBLISHED_PAYOUT_TX); } /** @@ -1116,26 +1119,42 @@ public abstract class Trade implements Tradable, Model { /////////////////////////////////////////////////////////////////////////////////////////// // Getter /////////////////////////////////////////////////////////////////////////////////////////// - + + public boolean isBuyer() { + return offer.getDirection() == Direction.BUY; + } + + public boolean isSeller() { + return offer.getDirection() == Direction.SELL; + } + + public boolean isMaker() { + return this instanceof MakerTrade; + } + + public boolean isTaker() { + return this instanceof TakerTrade; + } + public TradingPeer getSelf() { if (this instanceof MakerTrade) return processModel.getMaker(); if (this instanceof TakerTrade) return processModel.getTaker(); if (this instanceof ArbitratorTrade) return processModel.getArbitrator(); throw new RuntimeException("Trade is not maker, taker, or arbitrator"); } - + public TradingPeer getMaker() { return processModel.getMaker(); } - + public TradingPeer getTaker() { return processModel.getTaker(); } - + public TradingPeer getBuyer() { return offer.getDirection() == Direction.BUY ? processModel.getMaker() : processModel.getTaker(); } - + public TradingPeer getSeller() { return offer.getDirection() == Direction.BUY ? processModel.getTaker() : processModel.getMaker(); } 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 c5f4870c37..bd826a9cb8 100644 --- a/core/src/main/java/bisq/core/trade/protocol/BuyerProtocol.java +++ b/core/src/main/java/bisq/core/trade/protocol/BuyerProtocol.java @@ -69,8 +69,8 @@ public abstract class BuyerProtocol extends DisputeProtocol { .executeTasks(); given(anyPhase(Trade.Phase.PAYMENT_SENT, Trade.Phase.PAYMENT_RECEIVED) - .anyState(Trade.State.BUYER_STORED_IN_MAILBOX_PAYMENT_INITIATED_MSG, - Trade.State.BUYER_SEND_FAILED_PAYMENT_INITIATED_MSG) + .anyState(Trade.State.BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG, + Trade.State.BUYER_SEND_FAILED_PAYMENT_SENT_MSG) .with(BuyerEvent.STARTUP)) .setup(tasks(BuyerSendsPaymentSentMessage.class)) .executeTasks(); @@ -151,7 +151,7 @@ public abstract class BuyerProtocol extends DisputeProtocol { errorMessageHandler.handleErrorMessage(errorMessage); handleTaskRunnerFault(event, errorMessage); }))) - .run(() -> trade.setState(Trade.State.BUYER_CONFIRMED_IN_UI_PAYMENT_INITIATED)) + .run(() -> trade.setState(Trade.State.BUYER_CONFIRMED_IN_UI_PAYMENT_SENT)) .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 18fd88c4f7..8f78dff583 100644 --- a/core/src/main/java/bisq/core/trade/protocol/SellerProtocol.java +++ b/core/src/main/java/bisq/core/trade/protocol/SellerProtocol.java @@ -113,7 +113,7 @@ public abstract class SellerProtocol extends DisputeProtocol { synchronized (trade) { SellerEvent event = SellerEvent.PAYMENT_RECEIVED; // CountDownLatch latch = new CountDownLatch(1); // TODO (woodser): user countdown latch, but freezes legacy app - expect(anyPhase(Trade.Phase.PAYMENT_SENT, Trade.Phase.PAYOUT_PUBLISHED) + expect(anyPhase(Trade.Phase.PAYMENT_SENT) .with(event) .preCondition(trade.confirmPermitted())) .setup(tasks( diff --git a/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSendsPaymentSentMessage.java b/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSendsPaymentSentMessage.java index d96121201e..3e1e2388ed 100644 --- a/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSendsPaymentSentMessage.java +++ b/core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSendsPaymentSentMessage.java @@ -89,8 +89,8 @@ public class BuyerSendsPaymentSentMessage extends SendMailboxMessageTask { @Override protected void setStateSent() { - if (trade.getState().ordinal() < Trade.State.BUYER_SENT_PAYMENT_INITIATED_MSG.ordinal()) { - trade.setStateIfValidTransitionTo(Trade.State.BUYER_SENT_PAYMENT_INITIATED_MSG); + if (trade.getState().ordinal() < Trade.State.BUYER_SENT_PAYMENT_SENT_MSG.ordinal()) { + trade.setStateIfValidTransitionTo(Trade.State.BUYER_SENT_PAYMENT_SENT_MSG); } processModel.getTradeManager().requestPersistence(); @@ -112,7 +112,7 @@ public class BuyerSendsPaymentSentMessage extends SendMailboxMessageTask { @Override protected void setStateStoredInMailbox() { - trade.setStateIfValidTransitionTo(Trade.State.BUYER_STORED_IN_MAILBOX_PAYMENT_INITIATED_MSG); + trade.setStateIfValidTransitionTo(Trade.State.BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG); if (!trade.isPayoutPublished()) { tryToSendAgainLater(); } @@ -127,7 +127,7 @@ public class BuyerSendsPaymentSentMessage extends SendMailboxMessageTask { @Override protected void setStateFault() { - trade.setStateIfValidTransitionTo(Trade.State.BUYER_SEND_FAILED_PAYMENT_INITIATED_MSG); + trade.setStateIfValidTransitionTo(Trade.State.BUYER_SEND_FAILED_PAYMENT_SENT_MSG); if (!trade.isPayoutPublished()) { tryToSendAgainLater(); } @@ -192,8 +192,8 @@ public class BuyerSendsPaymentSentMessage extends SendMailboxMessageTask { private void onMessageStateChange(MessageState newValue) { // Once we receive an ACK from our msg we know the peer has received the msg and we stop. if (newValue == MessageState.ACKNOWLEDGED) { - // We treat a ACK like BUYER_SAW_ARRIVED_PAYMENT_INITIATED_MSG - trade.setStateIfValidTransitionTo(Trade.State.BUYER_SAW_ARRIVED_PAYMENT_INITIATED_MSG); + // We treat a ACK like BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG + trade.setStateIfValidTransitionTo(Trade.State.BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG); processModel.getTradeManager().requestPersistence(); diff --git a/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerProcessesPaymentSentMessage.java b/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerProcessesPaymentSentMessage.java index f694c1587a..91c481a181 100644 --- a/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerProcessesPaymentSentMessage.java +++ b/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerProcessesPaymentSentMessage.java @@ -69,7 +69,7 @@ public class SellerProcessesPaymentSentMessage extends TradeTask { trade.setCounterCurrencyExtraData(counterCurrencyExtraData); } - trade.setState(Trade.State.SELLER_RECEIVED_PAYMENT_INITIATED_MSG); + trade.setState(Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG); processModel.getTradeManager().requestPersistence(); diff --git a/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerSendsPaymentReceivedMessage.java b/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerSendsPaymentReceivedMessage.java index 79e2c543a4..32cd938abc 100644 --- a/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerSendsPaymentReceivedMessage.java +++ b/core/src/main/java/bisq/core/trade/protocol/tasks/seller/SellerSendsPaymentReceivedMessage.java @@ -77,7 +77,7 @@ public class SellerSendsPaymentReceivedMessage extends SendMailboxMessageTask { @Override protected void setStateSent() { - trade.setState(Trade.State.SELLER_SENT_PAYOUT_TX_PUBLISHED_MSG); + trade.setState(trade.getState() == Trade.State.SELLER_PUBLISHED_PAYOUT_TX ? Trade.State.SELLER_SENT_PAYOUT_TX_PUBLISHED_MSG : Trade.State.SELLER_SENT_PAYMENT_RECEIVED_MSG); log.info("Sent SellerReceivedPaymentMessage: tradeId={} at peer {} SignedWitness {}", trade.getId(), trade.getTradingPeerNodeAddress(), signedWitness); processModel.getTradeManager().requestPersistence(); @@ -85,7 +85,7 @@ public class SellerSendsPaymentReceivedMessage extends SendMailboxMessageTask { @Override protected void setStateArrived() { - trade.setState(Trade.State.SELLER_SAW_ARRIVED_PAYOUT_TX_PUBLISHED_MSG); + trade.setState(trade.getState() == Trade.State.SELLER_PUBLISHED_PAYOUT_TX ? Trade.State.SELLER_SAW_ARRIVED_PAYOUT_TX_PUBLISHED_MSG : Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG); log.info("SellerReceivedPaymentMessage arrived: tradeId={} at peer {} SignedWitness {}", trade.getId(), trade.getTradingPeerNodeAddress(), signedWitness); processModel.getTradeManager().requestPersistence(); @@ -93,7 +93,7 @@ public class SellerSendsPaymentReceivedMessage extends SendMailboxMessageTask { @Override protected void setStateStoredInMailbox() { - trade.setState(Trade.State.SELLER_STORED_IN_MAILBOX_PAYOUT_TX_PUBLISHED_MSG); + trade.setState(trade.getState() == Trade.State.SELLER_PUBLISHED_PAYOUT_TX ? Trade.State.SELLER_STORED_IN_MAILBOX_PAYOUT_TX_PUBLISHED_MSG : Trade.State.SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG); log.info("SellerReceivedPaymentMessage storedInMailbox: tradeId={} at peer {} SignedWitness {}", trade.getId(), trade.getTradingPeerNodeAddress(), signedWitness); processModel.getTradeManager().requestPersistence(); @@ -101,7 +101,7 @@ public class SellerSendsPaymentReceivedMessage extends SendMailboxMessageTask { @Override protected void setStateFault() { - trade.setState(Trade.State.SELLER_SEND_FAILED_PAYOUT_TX_PUBLISHED_MSG); + trade.setState(trade.getState() == Trade.State.SELLER_PUBLISHED_PAYOUT_TX ? Trade.State.SELLER_SEND_FAILED_PAYOUT_TX_PUBLISHED_MSG : Trade.State.SELLER_SEND_FAILED_PAYMENT_RECEIVED_MSG); log.error("SellerReceivedPaymentMessage failed: tradeId={} at peer {} SignedWitness {}", trade.getId(), trade.getTradingPeerNodeAddress(), signedWitness); processModel.getTradeManager().requestPersistence(); diff --git a/core/src/main/java/bisq/core/trade/txproof/xmr/XmrTxProofService.java b/core/src/main/java/bisq/core/trade/txproof/xmr/XmrTxProofService.java index 454bbff2dd..671c17bdf1 100644 --- a/core/src/main/java/bisq/core/trade/txproof/xmr/XmrTxProofService.java +++ b/core/src/main/java/bisq/core/trade/txproof/xmr/XmrTxProofService.java @@ -207,7 +207,7 @@ public class XmrTxProofService implements AssetTxProofService { if (isExpectedTradeState(trade.getState())) { startRequestsIfValid(trade); } else { - // We are expecting SELLER_RECEIVED_PAYMENT_INITIATED_MSG in the future, so listen on changes + // We are expecting SELLER_RECEIVED_PAYMENT_SENT_MSG in the future, so listen on changes ChangeListener tradeStateListener = (observable, oldValue, newValue) -> { if (isExpectedTradeState(newValue)) { ChangeListener listener = tradeStateListenerMap.remove(trade.getId()); @@ -346,7 +346,7 @@ public class XmrTxProofService implements AssetTxProofService { } private boolean isExpectedTradeState(Trade.State newValue) { - return newValue == Trade.State.SELLER_RECEIVED_PAYMENT_INITIATED_MSG; + return newValue == Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG; } private boolean is32BitHexStringInValid(String hexString) { 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 e04ec8271e..3864aa5810 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 @@ -452,31 +452,35 @@ public class PendingTradesViewModel extends ActivatableWithDataModel { switch (state) { - case BUYER_CONFIRMED_IN_UI_PAYMENT_INITIATED: - case BUYER_SENT_PAYMENT_INITIATED_MSG: + case BUYER_CONFIRMED_IN_UI_PAYMENT_SENT: + case BUYER_SENT_PAYMENT_SENT_MSG: busyAnimation.play(); statusLabel.setText(Res.get("shared.sendingConfirmation")); model.setMessageStateProperty(MessageState.SENT); @@ -149,17 +149,17 @@ public class BuyerStep2View extends TradeStepView { statusLabel.setText(Res.get("shared.sendingConfirmationAgain")); }, 10); break; - case BUYER_SAW_ARRIVED_PAYMENT_INITIATED_MSG: + case BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG: busyAnimation.stop(); statusLabel.setText(Res.get("shared.messageArrived")); model.setMessageStateProperty(MessageState.ARRIVED); break; - case BUYER_STORED_IN_MAILBOX_PAYMENT_INITIATED_MSG: + case BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG: busyAnimation.stop(); statusLabel.setText(Res.get("shared.messageStoredInMailbox")); model.setMessageStateProperty(MessageState.STORED_IN_MAILBOX); break; - case BUYER_SEND_FAILED_PAYMENT_INITIATED_MSG: + case BUYER_SEND_FAILED_PAYMENT_SENT_MSG: // We get a popup and the trade closed, so we dont need to show anything here busyAnimation.stop(); statusLabel.setText(""); diff --git a/proto/src/main/proto/pb.proto b/proto/src/main/proto/pb.proto index e08e03eace..0c11059450 100644 --- a/proto/src/main/proto/pb.proto +++ b/proto/src/main/proto/pb.proto @@ -1524,22 +1524,26 @@ message Trade { MAKER_RECEIVED_DEPOSIT_TX_PUBLISHED_MSG = 16; MAKER_SAW_DEPOSIT_TX_IN_NETWORK = 17; DEPOSIT_UNLOCKED_IN_BLOCK_CHAIN = 18; - BUYER_CONFIRMED_IN_UI_PAYMENT_INITIATED = 19; - BUYER_SENT_PAYMENT_INITIATED_MSG = 20; - BUYER_SAW_ARRIVED_PAYMENT_INITIATED_MSG = 21; - BUYER_STORED_IN_MAILBOX_PAYMENT_INITIATED_MSG = 22; - BUYER_SEND_FAILED_PAYMENT_INITIATED_MSG = 23; - SELLER_RECEIVED_PAYMENT_INITIATED_MSG = 24; + BUYER_CONFIRMED_IN_UI_PAYMENT_SENT = 19; + BUYER_SENT_PAYMENT_SENT_MSG = 20; + BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG = 21; + BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG = 22; + BUYER_SEND_FAILED_PAYMENT_SENT_MSG = 23; + SELLER_RECEIVED_PAYMENT_SENT_MSG = 24; SELLER_CONFIRMED_IN_UI_PAYMENT_RECEIPT = 25; - SELLER_PUBLISHED_PAYOUT_TX = 26; - SELLER_SENT_PAYOUT_TX_PUBLISHED_MSG = 27; - SELLER_SAW_ARRIVED_PAYOUT_TX_PUBLISHED_MSG = 28; - SELLER_STORED_IN_MAILBOX_PAYOUT_TX_PUBLISHED_MSG = 29; - SELLER_SEND_FAILED_PAYOUT_TX_PUBLISHED_MSG = 30; - BUYER_RECEIVED_PAYOUT_TX_PUBLISHED_MSG = 31; - BUYER_SAW_PAYOUT_TX_IN_NETWORK = 32; - BUYER_PUBLISHED_PAYOUT_TX = 33; - WITHDRAW_COMPLETED = 34; + SELLER_SENT_PAYMENT_RECEIVED_MSG = 26; + SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG = 27; + SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG = 28; + SELLER_SEND_FAILED_PAYMENT_RECEIVED_MSG = 29; + SELLER_PUBLISHED_PAYOUT_TX = 30; + SELLER_SENT_PAYOUT_TX_PUBLISHED_MSG = 31; + SELLER_SAW_ARRIVED_PAYOUT_TX_PUBLISHED_MSG = 32; + SELLER_STORED_IN_MAILBOX_PAYOUT_TX_PUBLISHED_MSG = 33; + SELLER_SEND_FAILED_PAYOUT_TX_PUBLISHED_MSG = 34; + BUYER_RECEIVED_PAYOUT_TX_PUBLISHED_MSG = 35; + BUYER_SAW_PAYOUT_TX_IN_NETWORK = 36; + BUYER_PUBLISHED_PAYOUT_TX = 37; + WITHDRAW_COMPLETED = 38; } enum Phase {