Add a way to fetch all contract events#222
Conversation
|
@alisinabh Hey, love the library, I keep running into having to create a bunch of filters to ingest manually multiple events of the same contract, this aims to fix this, feel free to close it if you don't think it belongs here. |
Add a way to fetch all contract events
5cbd5d0 to
b5ee972
Compare
b5ee972 to
efecb06
Compare
alisinabh
left a comment
There was a problem hiding this comment.
Thanks for the addition.
Upon first look I added one comment.
Also Im not sure a function in Ethers module is the best answer here. My initial thought is to have a function (maybe in Utils) that returns all event filters of a contract then the result of that can be used with the same get_logs function.
That sounds reasonable, could adapt the get_logs function to allow for multiple event filters, something like:
Or allow a list in the same function and have Let me know what you think. |
|
Yeah I think One caveat is that we should ensure that if there are more than one event filter with a default address they must be the same. Otherwise we should require an explicit |
Description
Using
get_logsbecomes tedious when ingesting all of a contract events. This creates a way to ingest and decode all of the events emitted from a contract instance to reduce the need to get logs using multiple event filters.Details
get_logs_for_contractfunction which receives all of a contract event filters along with an addressEvents. find_and_decodeChecklist
get_logs_for_contractfunction using the same pattern asget_logs