Closed jordanjambazov closed 6 years ago
Can you expand on what "Not Working:" means. It's not clear to me what is actually broken/failing here.
@pipermerriam What is meant there is that events filtering is not working if EIP checksum address is provided there. The filter always returns empty list on get_new_entries()
invocation. With lower cased address it returns properly the events, with properly checksummed address the result is empty.
Sounds like an issue with Ganache since filtering is done on the backend and all that web3.py is doing is making RPC requests to get whatever entries the backend returns.
@jordanjambazov could you solve this? Maybe by replacing ganache with something else. This is also a very important blocker for me.
@EralpB Unfortunately currently I am using a forked monkey patched version of web3.py: https://github.com/jordanjambazov/web3.py/commit/a61b382dd5c11de1102779868d377408c7590839
@EralpB @jordanjambazov can you help provide the ganache version issue and such on this issue: https://github.com/trufflesuite/ganache-cli/issues/494 ?
@carver I commented on the version of Ganache-CLI, it was reproducible in v6.1.0-beta.2
@jordanjambazov are you getting the same problem when using the new Contract.events.<event name>.createFilter()
method?
If you're dealing with this error consider speaking up in the following github issue in the ganache codebase.
Everyone who ran into this issue, please upgrade and try again. It's believed to be fixed!
Your versions should be:
Please come back and comment if it is still not working as expected.
I'm still having this issue with:
The following filter does not work:
event_filter = web3.eth.filter({
"address": contract.address
})
but this does:
event_filter = web3.eth.filter({
"address": contract.address.lower()
})
Where contract.address
is checksummed.
@kfichter
This was marked resolved in ganache-core@2.1.3 and ganache-cli@6.1.4
Can you upgrade and try again?
@carver Working, thank you!
Me I have Ganache CLI v7.0.0-beta.0 (ganache-core: 3.0.0-beta.0) And I have empty arrays after running truffle test and trying to fetch obliviously made events
Filtering events in ganache from web3 is broken. I submitted a fix and am waiting for it to get merged and included in ganache -> https://github.com/MetaMask/provider-engine/pull/280
What was wrong?
Maybe the issue is not exactly web3.py related, but when using EIP-55 checksum addresses event filtering is not working. My guess is that the reason is that Ganache-CLI is not producing proper addresses.
Event Filter done as follows:
Checking for events
Not Working:
_Working (with monkey patched web3.utils.validation.validateaddress):
The monkey patch is to simply ignore the EIP checksum validation.
How can it be fixed?
Not sure what is the best way to fix it. Simply ignoring checksum validation seems not right. I'm glad to discuss.
_editor: Let's add an optional middleware that can be injected to the innermost layer that forces all hex to lowercase, similar to the
geth_poa_middleware
_