Run EnforceFilterVersion in protocol

We run the EnforceFilterVersion (TradeTask) when a taker "takes" an
offer and when a maker receives a "take offer" request.
This commit is contained in:
Alva Swanson 2025-02-18 21:43:34 +00:00
parent 54a9fed020
commit 1a083ab246
No known key found for this signature in database
GPG key ID: 004760E77F753090
8 changed files with 16 additions and 0 deletions

View file

@ -27,6 +27,7 @@ import bisq.core.trade.protocol.bisq_v1.messages.PayoutTxPublishedMessage;
import bisq.core.trade.protocol.bisq_v1.tasks.ApplyFilter;
import bisq.core.trade.protocol.bisq_v1.tasks.CheckIfDaoStateIsInSync;
import bisq.core.trade.protocol.bisq_v1.tasks.CheckRestrictions;
import bisq.core.trade.protocol.bisq_v1.tasks.EnforceFilterVersion;
import bisq.core.trade.protocol.bisq_v1.tasks.TradeTask;
import bisq.core.trade.protocol.bisq_v1.tasks.buyer.BuyerFinalizesDelayedPayoutTx;
import bisq.core.trade.protocol.bisq_v1.tasks.buyer.BuyerProcessDelayedPayoutTxSignatureRequest;
@ -73,6 +74,7 @@ public class BuyerAsMakerProtocol extends BuyerProtocol implements MakerProtocol
.with(message)
.from(peer))
.setup(tasks(
EnforceFilterVersion.class,
CheckIfDaoStateIsInSync.class,
MakerProcessesInputsForDepositTxRequest.class,
ApplyFilter.class,

View file

@ -29,6 +29,7 @@ import bisq.core.trade.protocol.bisq_v1.messages.PayoutTxPublishedMessage;
import bisq.core.trade.protocol.bisq_v1.tasks.ApplyFilter;
import bisq.core.trade.protocol.bisq_v1.tasks.CheckIfDaoStateIsInSync;
import bisq.core.trade.protocol.bisq_v1.tasks.CheckRestrictions;
import bisq.core.trade.protocol.bisq_v1.tasks.EnforceFilterVersion;
import bisq.core.trade.protocol.bisq_v1.tasks.TradeTask;
import bisq.core.trade.protocol.bisq_v1.tasks.buyer.BuyerFinalizesDelayedPayoutTx;
import bisq.core.trade.protocol.bisq_v1.tasks.buyer.BuyerProcessDelayedPayoutTxSignatureRequest;
@ -79,6 +80,7 @@ public class BuyerAsTakerProtocol extends BuyerProtocol implements TakerProtocol
expect(phase(Trade.Phase.INIT)
.with(TakerEvent.TAKE_OFFER))
.setup(tasks(
EnforceFilterVersion.class,
CheckIfDaoStateIsInSync.class,
ApplyFilter.class,
CheckRestrictions.class,

View file

@ -29,6 +29,7 @@ import bisq.core.trade.protocol.bisq_v1.messages.InputsForDepositTxRequest;
import bisq.core.trade.protocol.bisq_v1.tasks.ApplyFilter;
import bisq.core.trade.protocol.bisq_v1.tasks.CheckIfDaoStateIsInSync;
import bisq.core.trade.protocol.bisq_v1.tasks.CheckRestrictions;
import bisq.core.trade.protocol.bisq_v1.tasks.EnforceFilterVersion;
import bisq.core.trade.protocol.bisq_v1.tasks.TradeTask;
import bisq.core.trade.protocol.bisq_v1.tasks.maker.MakerCreateAndSignContract;
import bisq.core.trade.protocol.bisq_v1.tasks.maker.MakerProcessesInputsForDepositTxRequest;
@ -75,6 +76,7 @@ public class SellerAsMakerProtocol extends SellerProtocol implements MakerProtoc
.with(message)
.from(peer))
.setup(tasks(
EnforceFilterVersion.class,
CheckIfDaoStateIsInSync.class,
MaybeCreateSubAccount.class,
MakerProcessesInputsForDepositTxRequest.class,

View file

@ -28,6 +28,7 @@ import bisq.core.trade.protocol.bisq_v1.messages.InputsForDepositTxResponse;
import bisq.core.trade.protocol.bisq_v1.tasks.ApplyFilter;
import bisq.core.trade.protocol.bisq_v1.tasks.CheckIfDaoStateIsInSync;
import bisq.core.trade.protocol.bisq_v1.tasks.CheckRestrictions;
import bisq.core.trade.protocol.bisq_v1.tasks.EnforceFilterVersion;
import bisq.core.trade.protocol.bisq_v1.tasks.TradeTask;
import bisq.core.trade.protocol.bisq_v1.tasks.seller.MaybeCreateSubAccount;
import bisq.core.trade.protocol.bisq_v1.tasks.seller.SellerCreatesDelayedPayoutTx;
@ -75,6 +76,7 @@ public class SellerAsTakerProtocol extends SellerProtocol implements TakerProtoc
.with(TakerEvent.TAKE_OFFER)
.from(trade.getTradingPeerNodeAddress()))
.setup(tasks(
EnforceFilterVersion.class,
CheckIfDaoStateIsInSync.class,
MaybeCreateSubAccount.class,
ApplyFilter.class,

View file

@ -21,6 +21,7 @@ package bisq.core.trade.protocol.bsq_swap;
import bisq.core.trade.model.bsq_swap.BsqSwapBuyerAsMakerTrade;
import bisq.core.trade.protocol.TradeMessage;
import bisq.core.trade.protocol.TradeTaskRunner;
import bisq.core.trade.protocol.bisq_v1.tasks.EnforceFilterVersion;
import bisq.core.trade.protocol.bsq_swap.messages.BsqSwapFinalizeTxRequest;
import bisq.core.trade.protocol.bsq_swap.messages.BsqSwapRequest;
import bisq.core.trade.protocol.bsq_swap.messages.SellersBsqSwapRequest;
@ -59,6 +60,7 @@ public class BsqSwapBuyerAsMakerProtocol extends BsqSwapBuyerProtocol implements
.with(request)
.from(sender))
.setup(tasks(
EnforceFilterVersion.class,
ApplyFilter.class,
ProcessSellersBsqSwapRequest.class,
BuyerAsMakerCreatesBsqInputsAndChange.class,

View file

@ -22,6 +22,7 @@ import bisq.core.offer.Offer;
import bisq.core.trade.model.bsq_swap.BsqSwapBuyerAsTakerTrade;
import bisq.core.trade.protocol.TradeMessage;
import bisq.core.trade.protocol.TradeTaskRunner;
import bisq.core.trade.protocol.bisq_v1.tasks.EnforceFilterVersion;
import bisq.core.trade.protocol.bsq_swap.messages.BsqSwapFinalizeTxRequest;
import bisq.core.trade.protocol.bsq_swap.tasks.ApplyFilter;
import bisq.core.trade.protocol.bsq_swap.tasks.buyer.BuyerPublishesTx;
@ -56,6 +57,7 @@ public class BsqSwapBuyerAsTakerProtocol extends BsqSwapBuyerProtocol implements
.with(TAKE_OFFER)
.from(trade.getTradingPeerNodeAddress()))
.setup(tasks(
EnforceFilterVersion.class,
ApplyFilter.class,
BuyerAsTakerCreatesBsqInputsAndChange.class,
SendBuyersBsqSwapRequest.class)

View file

@ -21,6 +21,7 @@ package bisq.core.trade.protocol.bsq_swap;
import bisq.core.trade.model.bsq_swap.BsqSwapSellerAsMakerTrade;
import bisq.core.trade.protocol.TradeMessage;
import bisq.core.trade.protocol.TradeTaskRunner;
import bisq.core.trade.protocol.bisq_v1.tasks.EnforceFilterVersion;
import bisq.core.trade.protocol.bsq_swap.messages.BsqSwapFinalizedTxMessage;
import bisq.core.trade.protocol.bsq_swap.messages.BsqSwapRequest;
import bisq.core.trade.protocol.bsq_swap.messages.BuyersBsqSwapRequest;
@ -57,6 +58,7 @@ public class BsqSwapSellerAsMakerProtocol extends BsqSwapSellerProtocol implemen
.with(request)
.from(sender))
.setup(tasks(
EnforceFilterVersion.class,
ApplyFilter.class,
ProcessBuyersBsqSwapRequest.class,
SellerAsMakerCreatesAndSignsTx.class,

View file

@ -22,6 +22,7 @@ import bisq.core.offer.Offer;
import bisq.core.trade.model.bsq_swap.BsqSwapSellerAsTakerTrade;
import bisq.core.trade.protocol.TradeMessage;
import bisq.core.trade.protocol.TradeTaskRunner;
import bisq.core.trade.protocol.bisq_v1.tasks.EnforceFilterVersion;
import bisq.core.trade.protocol.bsq_swap.messages.BsqSwapFinalizedTxMessage;
import bisq.core.trade.protocol.bsq_swap.messages.BsqSwapTxInputsMessage;
import bisq.core.trade.protocol.bsq_swap.tasks.ApplyFilter;
@ -57,6 +58,7 @@ public class BsqSwapSellerAsTakerProtocol extends BsqSwapSellerProtocol implemen
.with(TAKE_OFFER)
.from(trade.getTradingPeerNodeAddress()))
.setup(tasks(
EnforceFilterVersion.class,
ApplyFilter.class,
SendSellersBsqSwapRequest.class)
.withTimeout(40))