Skip to content

Commit

Permalink
Remove fundamentally error-prone test
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Sep 5, 2024
1 parent c2f7844 commit 1f28c38
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions core/tests/ts-integration/tests/api/web3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,38 +678,6 @@ describe('web3 API compatibility tests', () => {
).resolves.toHaveProperty('result', expect.stringMatching(HEX_VALUE_REGEX));
});

test('Should check API returns error when there are too many logs in eth_getLogs', async () => {
const contract = await deployContract(alice, contracts.events, []);
const maxLogsLimit = testMaster.environment().maxLogsLimit;

// Send 3 transactions that emit `maxLogsLimit / 2` events.
const tx1 = await contract.emitManyEvents(maxLogsLimit / 2);
const tx1Receipt = await tx1.wait();

const tx2 = await contract.emitManyEvents(maxLogsLimit / 2);
await tx2.wait();

const tx3 = await contract.emitManyEvents(maxLogsLimit / 2);
const tx3Receipt = await tx3.wait();

// There are around `0.5 * maxLogsLimit` logs in [tx1Receipt.blockNumber, tx1Receipt.blockNumber] range,
// so query with such filter should succeed.
const logs = await alice.provider.getLogs({
fromBlock: tx1Receipt.blockNumber,
toBlock: tx1Receipt.blockNumber
});
expect(logs.length).toBeGreaterThanOrEqual(maxLogsLimit / 2);

// There are at least `1.5 * maxLogsLimit` logs in [tx1Receipt.blockNumber, tx3Receipt.blockNumber] range,
// so query with such filter should fail.
await expect(
alice.provider.getLogs({
fromBlock: tx1Receipt.blockNumber,
toBlock: tx3Receipt.blockNumber
})
).rejects.toThrow(`Query returned more than ${maxLogsLimit} results.`);
});

test('Should throw error for estimate gas for account with balance < tx.value', async () => {
let poorBob = testMaster.newEmptyAccount();
await expect(
Expand Down

0 comments on commit 1f28c38

Please sign in to comment.