Refactor: Rename fromAny to expectedPhases

This commit is contained in:
chimp1984 2020-09-23 12:14:40 -05:00
parent d91e44c9ab
commit faf07f623f
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
3 changed files with 5 additions and 5 deletions

View file

@ -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
// in the hope to reach the buyer directly.
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)
.from(peer)
.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) {
fromAny(Trade.Phase.FIAT_SENT, Trade.Phase.PAYOUT_PUBLISHED)
expectedPhases(Trade.Phase.FIAT_SENT, Trade.Phase.PAYOUT_PUBLISHED)
.on(message)
.from(peer)
.process(() -> {

View file

@ -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
// in the hope to reach the buyer directly.
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)
.from(peer)
.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) {
fromAny(Trade.Phase.FIAT_SENT, Trade.Phase.PAYOUT_PUBLISHED)
expectedPhases(Trade.Phase.FIAT_SENT, Trade.Phase.PAYOUT_PUBLISHED)
.on(message)
.from(peer)
.process(() -> {

View file

@ -444,7 +444,7 @@ public abstract class TradeProtocol {
return new FluentProcess(trade, phase);
}
protected FluentProcess fromAny(Trade.Phase... phase) {
protected FluentProcess expectedPhases(Trade.Phase... phase) {
return new FluentProcess(trade, phase);
}