From 87e02c9181bd9233caec3e58e23dcd2b76f4ca77 Mon Sep 17 00:00:00 2001 From: woodser <13068859+woodser@users.noreply.github.com> Date: Fri, 18 Jul 2025 07:54:45 -0400 Subject: [PATCH] test setting trigger price for fixed price offers --- src/HavenoClient.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/HavenoClient.test.ts b/src/HavenoClient.test.ts index 144919de..820afe63 100644 --- a/src/HavenoClient.test.ts +++ b/src/HavenoClient.test.ts @@ -1836,6 +1836,22 @@ test("Cannot post offer outside of trade limits (Test, CI, sanity check)", async if (err.message.indexOf("must be above minimum") < 0) throw err; } + // test setting trigger price for fixed price offer + try { + await executeTrade({ + price: 142.23, + triggerPrice: 150.0, + offerAmount: TestConfig.minAmount, + direction: OfferDirection.SELL, + assetCode: assetCode, + makerPaymentAccountId: account.getId(), + takeOffer: false + }); + throw new Error("Should have rejected posting offer with fixed price and trigger price") + } catch (err: any) { + if (err.message.toLowerCase().indexOf("cannot set trigger price for fixed price offers.") < 0) throw err; + } + // test minimum offer limit let offerId = await executeTrade({ offerAmount: TestConfig.minAmount,