diff --git a/src/order-builder/helpers.ts b/src/order-builder/helpers.ts index 3c4d939..1bfac4c 100644 --- a/src/order-builder/helpers.ts +++ b/src/order-builder/helpers.ts @@ -152,7 +152,7 @@ export const createOrder = async ( return buildOrder(eoaSigner, clobContracts.Exchange, chainId, orderData); }; -export const getMarketOrderRawAmounts = ( +export const getMarketBuyOrderRawAmounts = ( amount: number, price: number, ): { rawMakerAmt: number; rawTakerAmt: number } => { @@ -183,7 +183,7 @@ export const buildMarketBuyOrderCreationArgs = async ( signatureType: SignatureType, userMarketOrder: UserMarketOrder, ): Promise => { - const { rawMakerAmt, rawTakerAmt } = getMarketOrderRawAmounts( + const { rawMakerAmt, rawTakerAmt } = getMarketBuyOrderRawAmounts( userMarketOrder.amount, userMarketOrder.price || 1, ); diff --git a/tests/order-builder/helpers.test.ts b/tests/order-builder/helpers.test.ts index c9a8842..4c1ef4c 100644 --- a/tests/order-builder/helpers.test.ts +++ b/tests/order-builder/helpers.test.ts @@ -8,7 +8,7 @@ import { buildMarketBuyOrderCreationArgs, createMarketBuyOrder, getOrderAmounts, - getMarketOrderRawAmounts, + getMarketBuyOrderRawAmounts, } from "../../src/order-builder/helpers"; import { OrderData, @@ -149,8 +149,8 @@ describe("helpers", () => { }); }); - describe("getOrderAmounts", () => { - it("buy", () => { + describe("getOrderAmounts", async () => { + it("buy", async () => { const delta = 0.01; let size = 0.01; @@ -168,7 +168,7 @@ describe("helpers", () => { } }); - it("sell", () => { + it("sell", async () => { const delta = 0.01; let size = 0.01; @@ -503,15 +503,15 @@ describe("helpers", () => { }); }); - describe("getMarketOrderAmounts", () => { - it("market buy", () => { + describe("getMarketBuyOrderRawAmounts", async () => { + it("market buy", async () => { const delta = 0.01; let size = 0.01; for (; size <= 100; ) { let price = 0.01; for (; price <= 1; ) { - const { rawMakerAmt, rawTakerAmt } = getMarketOrderRawAmounts(size, price); + const { rawMakerAmt, rawTakerAmt } = getMarketBuyOrderRawAmounts(size, price); expect(decimalPlaces(rawMakerAmt)).to.lte(2); expect(decimalPlaces(rawTakerAmt)).to.lte(4);