From 05320b4e6e6241fd93dbe0070a5d72c9b3f3156b Mon Sep 17 00:00:00 2001 From: woodser <13068859+woodser@users.noreply.github.com> Date: Mon, 2 Jun 2025 07:59:29 -0400 Subject: [PATCH] randomize no deposit offers in bootstrap test --- 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 dad0f069..4e6daafe 100644 --- a/src/HavenoClient.test.ts +++ b/src/HavenoClient.test.ts @@ -2435,6 +2435,7 @@ test("Can bootstrap a network", async () => { if (ctxP.offerAmount === undefined) ctxP.offerAmount = getRandomBigIntWithinPercent(HavenoUtils.xmrToAtomicUnits(1), 0.15); if (isRangeOffer && ctxP.offerMinAmount === undefined) ctxP.offerMinAmount = getRandomBigIntWithinPercent(HavenoUtils.xmrToAtomicUnits(0.3), 0.15); if (ctxP.reserveExactAmount === undefined) ctxP.reserveExactAmount = getRandomOutcome(3/4); + if (ctxP.buyerAsTakerWithoutDeposit === undefined) ctxP.buyerAsTakerWithoutDeposit = getRandomOutcome(1/3); // randomize payment method and asset code if (ctxP.assetCode && (!ctxP.makerPaymentAccountId || !ctxP.paymentMethodId)) throw new Error("Cannot specify asset code without payment account or method ID"); @@ -2445,7 +2446,7 @@ test("Can bootstrap a network", async () => { if (await isFixedPrice(ctxP)) ctxP.price = 142.23; // randomize trade config - if (ctxP.takeOffer === undefined) ctxP.takeOffer = getRandomOutcome(2/3); + if (ctxP.takeOffer === undefined) ctxP.takeOffer = getRandomOutcome(3/5); if (ctxP.tradeAmount === undefined) ctxP.tradeAmount = isRangeOffer ? getRandomBigIntWithinRange(ctxP.offerMinAmount!, ctxP.offerAmount) : ctxP.offerAmount; if (ctxP.buyerSendsPayment === undefined) ctxP.buyerSendsPayment = getRandomOutcome(1/2); if (ctxP.priceMargin === undefined && ctxP.price === undefined) ctxP.priceMargin = parseFloat(getRandomFloat(0, .3).toFixed(10));