Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Event filter of transactions #330

Closed
ayeteng opened this issue Jun 10, 2020 · 4 comments · Fixed by #308
Closed

Event filter of transactions #330

ayeteng opened this issue Jun 10, 2020 · 4 comments · Fixed by #308
Assignees

Comments

@ayeteng
Copy link

ayeteng commented Jun 10, 2020

Proposal: [Description of the feature]
Implement the event filter to get the relevant block by filtering the required condition

Current behavior: [What currently happens]

event_filter = getattr(store_var_contract.events, 'MyEvent').createFilter(fromBlock=0, toBlock='latest')
all_entries = event_filter.get_all_entries()
print(all_entries)
>[]

Desired behavior: [What you would like to happen]
Filters provide notifications of certain events taking place in the Ethereum network.
Look forward to find event filter function enabled.
https://web3py.readthedocs.io/en/stable/filters.html

Use case: [Why is this important (helps with prioritizing requests)]
If you want to find the transaction on the chain, you need to use filter function.
Requests may be closed if we're not actively planning to work on them.

@fedekunze
Copy link
Contributor

hi @ayeteng, this is currently being worked on #308

@noot
Copy link
Contributor

noot commented Jun 16, 2020

@fedekunze I think this is more related to the eth_newFilter function, which is implemented.

@ayeteng could you confirm that there are in fact logs being created by using eth_getTransactionLogs or eth_getTransactionReceipt? if there are logs and the filter isn't picking them up could you please post your contract?

@ayeteng
Copy link
Author

ayeteng commented Jun 17, 2020

This is my test contract and test code.
The smart contract setVar function will emit the event when setVar.
https://gist.github.com/ayeteng/48bc63d5b7500f94901389b888912a7b
The function can get the event log by receipt. But it cannot get the event log by event filter
https://gist.github.com/ayeteng/ca3df35d550c2a054ebc95f2ff013df0

@noot
Copy link
Contributor

noot commented Jun 17, 2020

thanks! I'll take a look soon

@noot noot self-assigned this Jun 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants