From adb0f6a5691d0229626bfbc9bc073a990347a668 Mon Sep 17 00:00:00 2001 From: woodser <13068859+woodser@users.noreply.github.com> Date: Wed, 22 Oct 2025 20:52:22 -0400 Subject: [PATCH] test waits for arbitrator to start idle wallet when buyer offline --- src/HavenoClient.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/HavenoClient.test.ts b/src/HavenoClient.test.ts index 60a46f71..63ccf328 100644 --- a/src/HavenoClient.test.ts +++ b/src/HavenoClient.test.ts @@ -3008,7 +3008,8 @@ async function executeTrade(ctxP: Partial): Promise { ctx.isPaymentReceived = true; fetchedTrade = await ctx.getSeller().havenod!.getTrade(trade.getTradeId()); expect(fetchedTrade.getPhase()).toEqual("PAYMENT_RECEIVED"); - await wait(ctx.walletSyncPeriodMs * 2); // buyer or arbitrator will sign and publish payout tx + let isBuyerOffline = ctx.getBuyer().havenod === undefined; + await wait((isBuyerOffline ? TestConfig.maxWalletStartupMs : 0) + ctx.walletSyncPeriodMs * 2); // buyer or arbitrator will sign and publish payout tx (arbitrator is idling) await testTradeState(await ctx.getSeller().havenod!.getTrade(trade.getTradeId()), {phase: ["PAYMENT_RECEIVED"], payoutState: ["PAYOUT_PUBLISHED", "PAYOUT_CONFIRMED", "PAYOUT_UNLOCKED", "PAYOUT_FINALIZED"], isCompleted: false, isPayoutPublished: true}); }