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: get topics from correct event contract abi #677

Merged
merged 2 commits into from
May 27, 2024

Conversation

platonfloria
Copy link
Collaborator

No description provided.

@platonfloria platonfloria changed the base branch from develop to release-candidate May 27, 2024 12:09
Copy link
Collaborator

@barakman barakman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we can (and probably should) change the whole scheme to use contract.events.MyEvent.getLogs, so we get rid of the topics input parameter altogether, and revert back to a method which looks similar to the one previous used (taking only from_block and to_block as input parameters). Technically, you'll need pass a contract.events.MyEventinstance to theget_eventsfunction, and that function will call functiongetLogs` on that instance).

fastlane_bot/events/exchanges/base.py Show resolved Hide resolved
@platonfloria
Copy link
Collaborator Author

I think that we can (and probably should) change the whole scheme to use contract.events.MyEvent.getLogs, so we get rid of the topics input parameter altogether, and revert back to a method which looks similar to the one previous used (taking only from_block and to_block as input parameters). Technically, you'll need pass a contract.events.MyEventinstance to theget_eventsfunction, and that function will call functiongetLogs` on that instance).

Perhaps, but definitely this is outside of the scope of this PR

@barakman
Copy link
Collaborator

I think that we can (and probably should) change the whole scheme to use contract.events.MyEvent.getLogs, so we get rid of the topics input parameter altogether, and revert back to a method which looks similar to the one previous used (taking only from_block and to_block as input parameters). Technically, you'll need pass a contract.events.MyEventinstance to theget_eventsfunction, and that function will call functiongetLogs` on that instance).

Perhaps, but definitely this is outside of the scope of this PR

In a way it is, because you're already working hard in this PR to create the contracts and their list of events, so you can just replace the topic in the Subscription class with the actual event instance.

@platonfloria
Copy link
Collaborator Author

I think that we can (and probably should) change the whole scheme to use contract.events.MyEvent.getLogs, so we get rid of the topics input parameter altogether, and revert back to a method which looks similar to the one previous used (taking only from_block and to_block as input parameters). Technically, you'll need pass a contract.events.MyEventinstance to theget_eventsfunction, and that function will call functiongetLogs` on that instance).

Perhaps, but definitely this is outside of the scope of this PR

In a way it is, because you're already working hard in this PR to create the contracts and their list of events, so you can just replace the topic in the Subscription class with the actual event instance.

In future I want to try fetching all topics within a single request. Event.get_logs will not work with that.
That is another reason to solve this in a separate PR

@barakman barakman self-requested a review May 27, 2024 13:13
@zavelevsky zavelevsky merged commit b21a264 into release-candidate May 27, 2024
3 checks passed
@zavelevsky zavelevsky deleted the event-contract-fix branch May 27, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants