Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0237h committed May 3, 2024
1 parent 5c622fe commit cd8082c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/queries.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ test("addTimestampBlockFilter", () => {
});
addTimestampBlockFilter(searchParams, where);

expect(where).toContain("block_number >= 123");
expect(where).toContain("block_number <= 123");
expect(where).toContain("block_num >= 123");
expect(where).toContain("block_num <= 123");
expect(where).toContain("toUnixTimestamp(timestamp) >= 1697587200");
expect(where).toContain("toUnixTimestamp(timestamp) <= 1697587100");
});
Expand All @@ -57,13 +57,13 @@ test("getTotalSupply", () => {
const parameters = new URLSearchParams({ contract });
const query = formatSQL(getTotalSupply(parameters));

expect(query).toContain(formatSQL('SELECT *, updated_at_block_num AS block_number, updated_at_timestamp AS timestamp FROM token_supplies'));
expect(query).toContain(formatSQL('SELECT *, updated_at_block_num AS block_num, updated_at_timestamp AS timestamp FROM token_supplies'));
expect(query).toContain(
formatSQL(
`WHERE(contract == '${contract}')`
)
);
expect(query).toContain(formatSQL(`ORDER BY block_number DESC`));
expect(query).toContain(formatSQL(`ORDER BY block_num DESC`));
expect(query).toContain(formatSQL(`LIMIT 1`));
});

Expand Down Expand Up @@ -91,13 +91,13 @@ test("getBalanceChange", () => {
const parameters = new URLSearchParams({ account, contract });
const query = formatSQL(getBalanceChanges(parameters));

expect(query).toContain(formatSQL(`SELECT *, updated_at_block_num AS block_number, updated_at_timestamp AS timestamp FROM account_balances`));
expect(query).toContain(formatSQL(`SELECT *, updated_at_block_num AS block_num, updated_at_timestamp AS timestamp FROM account_balances`));
expect(query).toContain(
formatSQL(
`WHERE(account == '${account}' AND contract == '${contract}')`
)
);
expect(query).toContain(formatSQL(`ORDER BY timestamp DESC`));
expect(query).toContain(formatSQL(`ORDER BY block_num DESC`));
expect(query).toContain(formatSQL(`LIMIT 1`));
});

Expand Down Expand Up @@ -129,7 +129,7 @@ test("getTransfers", () => {
expect(query).toContain(
formatSQL(
`WHERE(contract == '${contract}'
AND from == '${account}' AND to == '${account}' AND transaction == '${transaction_id}')`
AND from == '${account}' AND to == '${account}' AND trx_id == '${transaction_id}')`
)
);
expect(query).toContain(formatSQL(`ORDER BY block_num DESC`));
Expand Down

0 comments on commit cd8082c

Please sign in to comment.