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

Support overloaded events when finding event ABI #1705

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions web3/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,13 +1122,18 @@ def __init__(self, *argument_names: Tuple[str]) -> None:
else:
self.argument_names = argument_names

self.abi = self._get_event_abi()
self.abi = self._get_event_abi(argument_names)

@classmethod
def _get_event_abi(cls) -> ABIEvent:
def _get_event_abi(cls, argument_names: Optional[Tuple[str]]=None) -> ABIEvent:
if argument_names is None:
return find_matching_event_abi(
cls.contract_abi,
event_name=cls.event_name)
return find_matching_event_abi(
cls.contract_abi,
event_name=cls.event_name)
event_name=cls.event_name,
argument_names=argument_names)

@combomethod
def processReceipt(
Expand Down