Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): commenting out getFilterChanges test until fix is ready #3582

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 49 additions & 49 deletions core/tests/ts-integration/tests/api/web3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,55 +277,55 @@ describe('web3 API compatibility tests', () => {
expect(eip1559ApiReceipt.maxPriorityFeePerGas).toEqual(0n);
});

test('Should test getFilterChanges for pending transactions', async () => {
EmilLuta marked this conversation as resolved.
Show resolved Hide resolved
if (testMaster.environment().nodeMode === NodeMode.External) {
// Pending transactions logic doesn't work on EN since we don't have a proper mempool -
// transactions only appear in the DB after they are included in the block.
return;
}

// We will need to wait until the mempool cache on the server is updated.
// The default update period is 50 ms, so we will wait for 75 ms to be sure.
const MEMPOOL_CACHE_WAIT = 50 + 25;

const filterId = await alice.provider.send('eth_newPendingTransactionFilter', []);
let changes: string[] = await alice.provider.send('eth_getFilterChanges', [filterId]);

const tx1 = await alice.sendTransaction({
to: alice.address
});
testMaster.reporter.debug(`Sent a transaction ${tx1.hash}`);

while (!changes.includes(tx1.hash)) {
await zksync.utils.sleep(MEMPOOL_CACHE_WAIT);
changes = await alice.provider.send('eth_getFilterChanges', [filterId]);
testMaster.reporter.debug('Received filter changes', changes);
}
expect(changes).toContain(tx1.hash);

const tx2 = await alice.sendTransaction({
to: alice.address
});
const tx3 = await alice.sendTransaction({
to: alice.address
});
const tx4 = await alice.sendTransaction({
to: alice.address
});
const remainingHashes = new Set([tx2.hash, tx3.hash, tx4.hash]);
testMaster.reporter.debug('Sent new transactions with hashes', remainingHashes);

while (remainingHashes.size > 0) {
await zksync.utils.sleep(MEMPOOL_CACHE_WAIT);
changes = await alice.provider.send('eth_getFilterChanges', [filterId]);
testMaster.reporter.debug('Received filter changes', changes);

expect(changes).not.toContain(tx1.hash);
for (const receivedHash of changes) {
remainingHashes.delete(receivedHash);
}
}
});
// test('Should test getFilterChanges for pending transactions', async () => {
// if (testMaster.environment().nodeMode === NodeMode.External) {
// // Pending transactions logic doesn't work on EN since we don't have a proper mempool -
// // transactions only appear in the DB after they are included in the block.
// return;
// }
//
// // We will need to wait until the mempool cache on the server is updated.
// // The default update period is 50 ms, so we will wait for 75 ms to be sure.
// const MEMPOOL_CACHE_WAIT = 50 + 25;
//
// const filterId = await alice.provider.send('eth_newPendingTransactionFilter', []);
// let changes: string[] = await alice.provider.send('eth_getFilterChanges', [filterId]);
//
// const tx1 = await alice.sendTransaction({
// to: alice.address
// });
// testMaster.reporter.debug(`Sent a transaction ${tx1.hash}`);
//
// while (!changes.includes(tx1.hash)) {
// await zksync.utils.sleep(MEMPOOL_CACHE_WAIT);
// changes = await alice.provider.send('eth_getFilterChanges', [filterId]);
// testMaster.reporter.debug('Received filter changes', changes);
// }
// expect(changes).toContain(tx1.hash);
//
// const tx2 = await alice.sendTransaction({
// to: alice.address
// });
// const tx3 = await alice.sendTransaction({
// to: alice.address
// });
// const tx4 = await alice.sendTransaction({
// to: alice.address
// });
// const remainingHashes = new Set([tx2.hash, tx3.hash, tx4.hash]);
// testMaster.reporter.debug('Sent new transactions with hashes', remainingHashes);
//
// while (remainingHashes.size > 0) {
// await zksync.utils.sleep(MEMPOOL_CACHE_WAIT);
// changes = await alice.provider.send('eth_getFilterChanges', [filterId]);
// testMaster.reporter.debug('Received filter changes', changes);
//
// expect(changes).not.toContain(tx1.hash);
// for (const receivedHash of changes) {
// remainingHashes.delete(receivedHash);
// }
// }
// });

test('Should test pub-sub API: blocks', async () => {
// Checks that we can receive an event for new block being created.
Expand Down
Loading