Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Oct 25, 2023
1 parent 07dd842 commit c78ba3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/queries.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { getBlock, getChain } from "./queries";

test("getBlock", () => {
expect(getBlock(new URLSearchParams({ chain: "eth", block_number: "123" })))
.toBe(`SELECT * FROM block WHERE (chain == 'eth' AND block_number == '123') ORDER BY block_number DESC LIMIT 1`);
.toBe(`SELECT * FROM blocks WHERE (chain == 'eth' AND block_number == '123') ORDER BY block_number DESC LIMIT 1`);

expect(getBlock(new URLSearchParams({ chain: "eth", greater_or_equals_by_timestamp: '1438270048', less_or_equals_by_timestamp: '1438270083', limit: '3' })))
.toBe(`SELECT * FROM block WHERE (toUnixTimestamp(timestamp) >= 1438270048 AND toUnixTimestamp(timestamp) <= 1438270083 AND chain == 'eth') ORDER BY block_number DESC LIMIT 3`);
.toBe(`SELECT * FROM blocks WHERE (toUnixTimestamp(timestamp) >= 1438270048 AND toUnixTimestamp(timestamp) <= 1438270083 AND chain == 'eth') ORDER BY block_number DESC LIMIT 3`);
});

test("getChain", () => {
expect(getChain()).toBe(`SELECT DISTINCT chain FROM block`);
expect(getChain()).toBe(`SELECT DISTINCT chain FROM module_hashes`);
});

0 comments on commit c78ba3e

Please sign in to comment.