mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2024-12-24 23:09:26 -05:00
await deferral of publishing dispute payout tx
This commit is contained in:
parent
bedf3e767a
commit
305606a3c3
@ -354,6 +354,7 @@ const TestConfig = {
|
||||
networkType: getBaseCurrencyNetwork() == BaseCurrencyNetwork.XMR_MAINNET ? moneroTs.MoneroNetworkType.MAINNET : getBaseCurrencyNetwork() == BaseCurrencyNetwork.XMR_LOCAL ? moneroTs.MoneroNetworkType.TESTNET : moneroTs.MoneroNetworkType.STAGENET,
|
||||
moneroBinsDir: "../haveno/.localnet",
|
||||
testDataDir: "./testdata",
|
||||
deferralMs: 25000,
|
||||
haveno: {
|
||||
path: "../haveno",
|
||||
version: "1.0.14"
|
||||
@ -3179,6 +3180,12 @@ async function resolveDispute(ctxP: Partial<TradeContext>) {
|
||||
assert(dispute.getIsClosed(), "Dispute is not closed for opener's peer, trade " + ctx.offerId);
|
||||
}
|
||||
|
||||
// wait for deferral of payout publish if applicable
|
||||
if (ctx.getDisputeOpener() && ctx.disputeWinner === DisputeResult.Winner.SELLER && ctx.sellerOfflineAfterDisputeOpened || ctx.disputeWinner === DisputeResult.Winner.BUYER && ctx.buyerOfflineAfterDisputeOpened) {
|
||||
HavenoUtils.log(0, "Awaiting deferral of publishing dispute payout tx");
|
||||
await wait(TestConfig.deferralMs); // wait for deferral
|
||||
}
|
||||
|
||||
// test trade state
|
||||
if (ctx.getBuyer().havenod) await testTradeState(await ctx.getBuyer().havenod!.getTrade(ctx.offerId!), {phase: ctx.getPhase(), payoutState: ["PAYOUT_PUBLISHED", "PAYOUT_CONFIRMED", "PAYOUT_UNLOCKED"], disputeState: "DISPUTE_CLOSED", isCompleted: true, isPayoutPublished: true});
|
||||
if (ctx.getSeller().havenod) await testTradeState(await ctx.getSeller().havenod!.getTrade(ctx.offerId!), {phase: ctx.getPhase(), payoutState: ["PAYOUT_PUBLISHED", "PAYOUT_CONFIRMED", "PAYOUT_UNLOCKED"], disputeState: "DISPUTE_CLOSED", isCompleted: true, isPayoutPublished: true});
|
||||
|
Loading…
Reference in New Issue
Block a user