mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-25 07:27:18 +01:00
Refactor: Rename fromAny to expectedPhases
This commit is contained in:
parent
d91e44c9ab
commit
faf07f623f
3 changed files with 5 additions and 5 deletions
|
@ -174,7 +174,7 @@ public class BuyerAsMakerProtocol extends TradeProtocol implements BuyerProtocol
|
||||||
// mailbox message but the stored in mailbox case is not expected and the seller would try to send the message again
|
// mailbox message but the stored in mailbox case is not expected and the seller would try to send the message again
|
||||||
// in the hope to reach the buyer directly.
|
// in the hope to reach the buyer directly.
|
||||||
private void handle(DepositTxAndDelayedPayoutTxMessage message, NodeAddress peer) {
|
private void handle(DepositTxAndDelayedPayoutTxMessage message, NodeAddress peer) {
|
||||||
fromAny(Trade.Phase.TAKER_FEE_PUBLISHED, Trade.Phase.DEPOSIT_PUBLISHED)
|
expectedPhases(Trade.Phase.TAKER_FEE_PUBLISHED, Trade.Phase.DEPOSIT_PUBLISHED)
|
||||||
.on(message)
|
.on(message)
|
||||||
.from(peer)
|
.from(peer)
|
||||||
.preCondition(trade.getDepositTx() == null || trade.getDelayedPayoutTx() == null,
|
.preCondition(trade.getDepositTx() == null || trade.getDelayedPayoutTx() == null,
|
||||||
|
@ -243,7 +243,7 @@ public class BuyerAsMakerProtocol extends TradeProtocol implements BuyerProtocol
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private void handle(PayoutTxPublishedMessage message, NodeAddress peer) {
|
private void handle(PayoutTxPublishedMessage message, NodeAddress peer) {
|
||||||
fromAny(Trade.Phase.FIAT_SENT, Trade.Phase.PAYOUT_PUBLISHED)
|
expectedPhases(Trade.Phase.FIAT_SENT, Trade.Phase.PAYOUT_PUBLISHED)
|
||||||
.on(message)
|
.on(message)
|
||||||
.from(peer)
|
.from(peer)
|
||||||
.process(() -> {
|
.process(() -> {
|
||||||
|
|
|
@ -200,7 +200,7 @@ public class BuyerAsTakerProtocol extends TradeProtocol implements BuyerProtocol
|
||||||
// mailbox message but the stored in mailbox case is not expected and the seller would try to send the message again
|
// mailbox message but the stored in mailbox case is not expected and the seller would try to send the message again
|
||||||
// in the hope to reach the buyer directly.
|
// in the hope to reach the buyer directly.
|
||||||
private void handle(DepositTxAndDelayedPayoutTxMessage message, NodeAddress peer) {
|
private void handle(DepositTxAndDelayedPayoutTxMessage message, NodeAddress peer) {
|
||||||
fromAny(Trade.Phase.TAKER_FEE_PUBLISHED, Trade.Phase.DEPOSIT_PUBLISHED)
|
expectedPhases(Trade.Phase.TAKER_FEE_PUBLISHED, Trade.Phase.DEPOSIT_PUBLISHED)
|
||||||
.on(message)
|
.on(message)
|
||||||
.from(peer)
|
.from(peer)
|
||||||
.preCondition(trade.getDepositTx() == null || trade.getDelayedPayoutTx() == null,
|
.preCondition(trade.getDepositTx() == null || trade.getDelayedPayoutTx() == null,
|
||||||
|
@ -270,7 +270,7 @@ public class BuyerAsTakerProtocol extends TradeProtocol implements BuyerProtocol
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private void handle(PayoutTxPublishedMessage message, NodeAddress peer) {
|
private void handle(PayoutTxPublishedMessage message, NodeAddress peer) {
|
||||||
fromAny(Trade.Phase.FIAT_SENT, Trade.Phase.PAYOUT_PUBLISHED)
|
expectedPhases(Trade.Phase.FIAT_SENT, Trade.Phase.PAYOUT_PUBLISHED)
|
||||||
.on(message)
|
.on(message)
|
||||||
.from(peer)
|
.from(peer)
|
||||||
.process(() -> {
|
.process(() -> {
|
||||||
|
|
|
@ -444,7 +444,7 @@ public abstract class TradeProtocol {
|
||||||
return new FluentProcess(trade, phase);
|
return new FluentProcess(trade, phase);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FluentProcess fromAny(Trade.Phase... phase) {
|
protected FluentProcess expectedPhases(Trade.Phase... phase) {
|
||||||
return new FluentProcess(trade, phase);
|
return new FluentProcess(trade, phase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue