add confirmed trade state

This commit is contained in:
woodser 2022-09-01 15:11:37 -04:00
parent 3b788d1fea
commit 355a6146b6
27 changed files with 90 additions and 105 deletions

View file

@ -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");
}

View file

@ -420,12 +420,12 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
// deposit published
case ARBITRATOR_PUBLISHED_DEPOSIT_TXS:
case SAW_DEPOSIT_TXS_IN_NETWORK:
case DEPOSIT_TXS_SEEN_IN_BLOCKCHAIN:
case DEPOSIT_TXS_CONFIRMED_IN_BLOCKCHAIN: // TODO: separate step to wait for first confirmation
buyerState.set(BuyerState.STEP1);
sellerState.set(SellerState.STEP1);
break;
// buyer and seller step 2
// deposit unlocked
case DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN: