Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
poly-rodr committed Sep 24, 2024
1 parent 75703fb commit 0f383ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ export interface OrderMarketCancelParams {
export interface OrderBookSummary {
market: string;
asset_id: string;
hash: string;
timestamp: string;
bids: OrderSummary[];
asks: OrderSummary[];
hash: string;
}

export interface OrderSummary {
Expand Down
22 changes: 11 additions & 11 deletions tests/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5538,10 +5538,11 @@ describe("utilities", () => {
expect(roundDown(0.57, 4)).to.equal(0.57);
});

it("generateOrderBookSummaryHash", () => {
it.only("generateOrderBookSummaryHash", () => {
let orderbook = {
market: "0xaabbcc",
asset_id: "100",
timestamp: "123456789",
bids: [
{ price: "0.3", size: "100" },
{ price: "0.4", size: "100" },
Expand All @@ -5551,18 +5552,18 @@ describe("utilities", () => {
{ price: "0.7", size: "100" },
],
hash: "",
timestamp: "123456789",
} as OrderBookSummary;

expect(generateOrderBookSummaryHash(orderbook)).to.equal(
"a2e42a1dc528c65bb927faef7539ffef1b9484de",
"5489da29343426f88622d61044975dc5fd828a27",
);
expect(orderbook.hash).to.equal("a2e42a1dc528c65bb927faef7539ffef1b9484de");
expect(orderbook.hash).to.equal("5489da29343426f88622d61044975dc5fd828a27");

// -
orderbook = {
market: "0xaabbcc",
asset_id: "100",
timestamp: "123456789",
bids: [
{ price: "0.3", size: "100" },
{ price: "0.4", size: "100" },
Expand All @@ -5571,29 +5572,28 @@ describe("utilities", () => {
{ price: "0.6", size: "100" },
{ price: "0.7", size: "100" },
],
hash: "a2e42a1dc528c65bb927faef7539ffef1b9484de",
timestamp: "123456789",
hash: "5489da29343426f88622d61044975dc5fd828a27",
} as OrderBookSummary;

expect(generateOrderBookSummaryHash(orderbook)).to.equal(
"a2e42a1dc528c65bb927faef7539ffef1b9484de",
"5489da29343426f88622d61044975dc5fd828a27",
);
expect(orderbook.hash).to.equal("a2e42a1dc528c65bb927faef7539ffef1b9484de");
expect(orderbook.hash).to.equal("5489da29343426f88622d61044975dc5fd828a27");

// -
orderbook = {
market: "0xaabbcc",
asset_id: "100",
timestamp: "",
bids: [],
asks: [],
hash: "",
timestamp: "",
} as OrderBookSummary;

expect(generateOrderBookSummaryHash(orderbook)).to.equal(
"9da2ac9109ceed8d754f9a5f7a06998d8d3aa0af",
"6d754a2f0304a83544f91a076fa3faa9cbfb9f63",
);
expect(orderbook.hash).to.equal("9da2ac9109ceed8d754f9a5f7a06998d8d3aa0af");
expect(orderbook.hash).to.equal("6d754a2f0304a83544f91a076fa3faa9cbfb9f63");
});

it("isTickSizeSmaller", () => {
Expand Down

0 comments on commit 0f383ac

Please sign in to comment.