rename proto type from CONFIRMED_IN_UI* to CONFIRMED*

This commit is contained in:
woodser 2024-01-09 07:02:39 -05:00
parent 6c83fc4cf8
commit d26ddac5c0
7 changed files with 12 additions and 12 deletions

View File

@ -156,7 +156,7 @@ public abstract class Trade implements Tradable, Model {
DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN(Phase.DEPOSITS_UNLOCKED),
// payment sent
BUYER_CONFIRMED_IN_UI_PAYMENT_SENT(Phase.PAYMENT_SENT),
BUYER_CONFIRMED_PAYMENT_SENT(Phase.PAYMENT_SENT),
BUYER_SENT_PAYMENT_SENT_MSG(Phase.PAYMENT_SENT),
BUYER_SEND_FAILED_PAYMENT_SENT_MSG(Phase.PAYMENT_SENT),
BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG(Phase.PAYMENT_SENT),
@ -164,7 +164,7 @@ public abstract class Trade implements Tradable, Model {
SELLER_RECEIVED_PAYMENT_SENT_MSG(Phase.PAYMENT_SENT),
// payment received
SELLER_CONFIRMED_IN_UI_PAYMENT_RECEIPT(Phase.PAYMENT_RECEIVED),
SELLER_CONFIRMED_PAYMENT_RECEIPT(Phase.PAYMENT_RECEIVED),
SELLER_SENT_PAYMENT_RECEIVED_MSG(Phase.PAYMENT_RECEIVED),
SELLER_SEND_FAILED_PAYMENT_RECEIVED_MSG(Phase.PAYMENT_RECEIVED),
SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG(Phase.PAYMENT_RECEIVED),
@ -610,13 +610,13 @@ public abstract class Trade implements Tradable, Model {
});
// reset buyer's payment sent state if no ack receive
if (this instanceof BuyerTrade && getState().ordinal() >= Trade.State.BUYER_CONFIRMED_IN_UI_PAYMENT_SENT.ordinal() && getState().ordinal() < Trade.State.BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG.ordinal()) {
if (this instanceof BuyerTrade && getState().ordinal() >= Trade.State.BUYER_CONFIRMED_PAYMENT_SENT.ordinal() && getState().ordinal() < Trade.State.BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG.ordinal()) {
log.warn("Resetting state of {} {} from {} to {} because no ack was received", getClass().getSimpleName(), getId(), getState(), Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN);
setState(Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN);
}
// reset seller's payment received state if no ack receive
if (this instanceof SellerTrade && getState().ordinal() >= Trade.State.SELLER_CONFIRMED_IN_UI_PAYMENT_RECEIPT.ordinal() && getState().ordinal() < Trade.State.SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG.ordinal()) {
if (this instanceof SellerTrade && getState().ordinal() >= Trade.State.SELLER_CONFIRMED_PAYMENT_RECEIPT.ordinal() && getState().ordinal() < Trade.State.SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG.ordinal()) {
log.warn("Resetting state of {} {} from {} to {} because no ack was received", getClass().getSimpleName(), getId(), getState(), Trade.State.BUYER_SENT_PAYMENT_SENT_MSG);
setState(Trade.State.BUYER_SENT_PAYMENT_SENT_MSG);
}

View File

@ -123,7 +123,7 @@ public class BuyerProtocol extends DisputeProtocol {
(errorMessage) -> {
handleTaskRunnerFault(event, errorMessage);
})))
.run(() -> trade.setState(Trade.State.BUYER_CONFIRMED_IN_UI_PAYMENT_SENT))
.run(() -> trade.setState(Trade.State.BUYER_CONFIRMED_PAYMENT_SENT))
.executeTasks(true);
} catch (Exception e) {
errorMessageHandler.handleErrorMessage("Error confirming payment sent: " + e.getMessage());

View File

@ -119,7 +119,7 @@ public class SellerProtocol extends DisputeProtocol {
}, (errorMessage) -> {
handleTaskRunnerFault(event, errorMessage);
})))
.run(() -> trade.setState(Trade.State.SELLER_CONFIRMED_IN_UI_PAYMENT_RECEIPT))
.run(() -> trade.setState(Trade.State.SELLER_CONFIRMED_PAYMENT_RECEIPT))
.executeTasks(true);
} catch (Exception e) {
errorMessageHandler.handleErrorMessage("Error confirming payment received: " + e.getMessage());

View File

@ -401,7 +401,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
break;
// buyer step 3
case BUYER_CONFIRMED_IN_UI_PAYMENT_SENT: // UI action
case BUYER_CONFIRMED_PAYMENT_SENT: // UI action
case BUYER_SENT_PAYMENT_SENT_MSG: // PAYMENT_SENT_MSG sent
case BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG: // PAYMENT_SENT_MSG arrived
// We don't switch the UI before we got the feedback of the msg delivery
@ -424,7 +424,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
break;
// seller step 3
case SELLER_CONFIRMED_IN_UI_PAYMENT_RECEIPT:
case SELLER_CONFIRMED_PAYMENT_RECEIPT:
case SELLER_SEND_FAILED_PAYMENT_RECEIVED_MSG:
case SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG:
case SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG:

View File

@ -150,7 +150,7 @@ public class BuyerStep2View extends TradeStepView {
showPopup();
} else if (state.ordinal() <= Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG.ordinal()) {
switch (state) {
case BUYER_CONFIRMED_IN_UI_PAYMENT_SENT:
case BUYER_CONFIRMED_PAYMENT_SENT:
busyAnimation.play();
statusLabel.setText(Res.get("shared.preparingConfirmation"));
break;

View File

@ -116,7 +116,7 @@ public class SellerStep3View extends TradeStepView {
busyAnimation.stop();
statusLabel.setText("");
} else switch (state) {
case SELLER_CONFIRMED_IN_UI_PAYMENT_RECEIPT:
case SELLER_CONFIRMED_PAYMENT_RECEIPT:
busyAnimation.play();
statusLabel.setText(Res.get("shared.preparingConfirmation"));
break;

View File

@ -1423,13 +1423,13 @@ message Trade {
DEPOSIT_TXS_SEEN_IN_NETWORK = 13;
DEPOSIT_TXS_CONFIRMED_IN_BLOCKCHAIN = 14;
DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN = 15;
BUYER_CONFIRMED_IN_UI_PAYMENT_SENT = 16;
BUYER_CONFIRMED_PAYMENT_SENT = 16;
BUYER_SENT_PAYMENT_SENT_MSG = 17;
BUYER_SEND_FAILED_PAYMENT_SENT_MSG = 18;
BUYER_STORED_IN_MAILBOX_PAYMENT_SENT_MSG = 19;
BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG = 20;
SELLER_RECEIVED_PAYMENT_SENT_MSG = 21;
SELLER_CONFIRMED_IN_UI_PAYMENT_RECEIPT = 22;
SELLER_CONFIRMED_PAYMENT_RECEIPT = 22;
SELLER_SENT_PAYMENT_RECEIVED_MSG = 23;
SELLER_SEND_FAILED_PAYMENT_RECEIVED_MSG = 24;
SELLER_STORED_IN_MAILBOX_PAYMENT_RECEIVED_MSG = 25;