Skip to content

Commit

Permalink
renaming func
Browse files Browse the repository at this point in the history
  • Loading branch information
poly-rodr committed Jan 13, 2023
1 parent 7220eb5 commit 3ce45be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/order-builder/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } => {
Expand Down Expand Up @@ -183,7 +183,7 @@ export const buildMarketBuyOrderCreationArgs = async (
signatureType: SignatureType,
userMarketOrder: UserMarketOrder,
): Promise<OrderData> => {
const { rawMakerAmt, rawTakerAmt } = getMarketOrderRawAmounts(
const { rawMakerAmt, rawTakerAmt } = getMarketBuyOrderRawAmounts(
userMarketOrder.amount,
userMarketOrder.price || 1,
);
Expand Down
14 changes: 7 additions & 7 deletions tests/order-builder/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
buildMarketBuyOrderCreationArgs,
createMarketBuyOrder,
getOrderAmounts,
getMarketOrderRawAmounts,
getMarketBuyOrderRawAmounts,
} from "../../src/order-builder/helpers";
import {
OrderData,
Expand Down Expand Up @@ -149,8 +149,8 @@ describe("helpers", () => {
});
});

describe("getOrderAmounts", () => {
it("buy", () => {
describe("getOrderAmounts", async () => {
it("buy", async () => {
const delta = 0.01;
let size = 0.01;

Expand All @@ -168,7 +168,7 @@ describe("helpers", () => {
}
});

it("sell", () => {
it("sell", async () => {
const delta = 0.01;
let size = 0.01;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3ce45be

Please sign in to comment.