diff --git a/src/HavenoClient.test.ts b/src/HavenoClient.test.ts index aad1b337..eefd28f2 100644 --- a/src/HavenoClient.test.ts +++ b/src/HavenoClient.test.ts @@ -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) { 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});