From 6dcb4df09beb555e956e2d8c3d73a02bd2db2ac8 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 28 Dec 2023 07:59:55 -0500 Subject: [PATCH] set balance context if undefined --- src/HavenoClient.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HavenoClient.test.ts b/src/HavenoClient.test.ts index f77e5277..d86a7130 100644 --- a/src/HavenoClient.test.ts +++ b/src/HavenoClient.test.ts @@ -2683,7 +2683,7 @@ async function takeOffer(ctxP: Partial): Promise { await ctx.taker.havenod!.addNotificationListener(notification => { takerNotifications.push(notification); }); // record balances before offer taken, once - if (!ctx.taker.balancesBeforeTake) { + if (ctx.taker.balancesBeforeTake === undefined) { ctx.maker.balancesBeforeTake = await ctx.maker.havenod?.getBalances(); ctx.taker.balancesBeforeTake = await ctx.taker.havenod?.getBalances(); } @@ -2704,7 +2704,7 @@ async function takeOffer(ctxP: Partial): Promise { expect(tradeNotifications[0].getMessage()).toEqual("Your offer " + ctx.offerId + " has been accepted"); // record context after offer taken, once - if (!ctx.getBuyer().balancesAfterTake) { + if (ctx.getBuyer().balancesAfterTake === undefined) { ctx.tradeAmount = BigInt(trade.getAmount()); // re-assign trade amount which could be adjusted ctx.arbitrator.trade = await ctx.arbitrator.havenod!.getTrade(ctx.offerId!); ctx.maker.trade = await ctx.maker.havenod!.getTrade(ctx.offerId!);