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

Alternate infrastructure for testing event filters #1635

Open
pipermerriam opened this issue Apr 30, 2020 · 2 comments
Open

Alternate infrastructure for testing event filters #1635

pipermerriam opened this issue Apr 30, 2020 · 2 comments

Comments

@pipermerriam
Copy link
Member

What was wrong?

Testing event filters sucks. Either we depend on eth-tester which probably/maybe implements the filter logic correctly, or we use geth which results in flaky tests and the bad kind of black-box testing since when things fail we don't really have any good way to know why...

How can it be fixed?

I recently wrote this: https://github.com/ethereum/cthaeh

The most relevant parts are:

If we were to extract these two bits plus some other support code into something stand-alone that is more like a library then we should be able to use this for testing our log filter code.

@pipermerriam
Copy link
Member Author

Explicitely what I think is needed is:

Then in our tests we can use a middleware to intercept JSON-RPC filter requests and serve them using the core library API.

@wolovim
Copy link
Member

wolovim commented Apr 30, 2020

is sqlite what you had in mind?

import sqlite3
conn = sqlite3.connect(':memory:')

update: we chatted, am spiking on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants