-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support overloaded events when finding event ABI #1705
Conversation
7a4f372
to
62446fc
Compare
62446fc
to
511c09f
Compare
Thanks for the PR! If we don't have a test that includes overloaded events, we ought to include one. If you're up for taking that on, great, otherwise I can take over. |
@marcgarreau please do - this was a very incremental change without broader context! |
I don't think I fully solved the underlying root cause. One observation:
|
Yeah, there's a bit more to the story here. In doing some quick tests, looks like the effects can be seen through more APIs. For example, edit: I guess there's an argument to be made here that that's a desirable response instead of lumping both event's logs together, for example. This events API isn't exactly friendly to overloading. |
A brief scan of our code that handles contract events suggests we have no handling in place for multiple events with the same name. one example here: Lines 231 to 244 in b9d7677
It will take a bit of clever problem solving to improve these APIs to support this, but it should be largely doable.
We already do similar things for functions, but there we have the luxury of always having the arguments and thus only rarely can we not differentiate between functions with duplicate names. But I think with events we have the advantage of not actually ending up in a situation where we cannot do what the user wants, it just might end up containing extra logs that they don't want since we'll over-match on the filter parameters since we'll have to provide multiple topics. |
FWIW, my specific need (that this PR doesn't solve yet) was to get access to an overloaded event's ABI. Seems like neither |
web3.py doesn't support overloaded events: ethereum/web3.py#1705
web3.py doesn't support overloaded events: ethereum/web3.py#1705
Is there a suggested workaround? I'm incurring in this when trying to query the ActionPaused events of Compound Comptroller, which is overloaded |
Here is a further fix of the issue. Change
|
@BZAghalarov thank you for your work on this. A solution is now implemented for all events, functions and the caller API in #3491. Closing this PR and we'll get those updates released very soon! |
What was wrong?
Related to Issue #1704.
How was it fixed?
Make sure event arguments are used to disambiguate events (in addition to names) when overloaded events are present.
Todo:
Cute Animal Picture