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

Issue1560 #1594

Merged
merged 2 commits into from
Mar 31, 2020
Merged

Issue1560 #1594

merged 2 commits into from
Mar 31, 2020

Conversation

realjohnward
Copy link
Contributor

@realjohnward realjohnward commented Mar 3, 2020

What was wrong?

The hasattr method wasn't working for the ContractEvent object (wasn't returning True or False)
AttributeError wasn't being raised in the ContractEvent's getattr method.

Related to Issue #1560

How was it fixed?

Added hasattr overloader to ContractEvent class which returns False if an AttributeError is raised during the getattr call.
Added exception class called ABIEventFunctionNotFound, which inherits from AttributeError and MismatchedABI.

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

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

Thanks @realjohnward! This is looking good to me! Just added a few comments, mostly around testing.

@pipermerriam do you have any feedback?

tests/core/contracts/test_contract_events_getattr.py Outdated Show resolved Hide resolved
tests/core/contracts/test_contract_events_getattr.py Outdated Show resolved Hide resolved
tests/core/contracts/test_contract_events_hasattr.py Outdated Show resolved Hide resolved
web3/exceptions.py Outdated Show resolved Hide resolved
@realjohnward
Copy link
Contributor Author

No problem @kclowes . Thank you for reviewing this and making adjustments!

@kclowes kclowes force-pushed the issue1560 branch 2 times, most recently from 2e11b33 to 4588481 Compare March 31, 2020 20:03
@kclowes kclowes merged commit 79a661d into ethereum:master Mar 31, 2020
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.

2 participants