-
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
Is the ContractEvent type bugged? #1646
Comments
Confirmed the suggested fix addresses the issue. Will get a PR going.
|
closed via #1651 |
Nothing really besides finding a way to test it.
It's totally possible that this is broken too, yes. I suspect you're right! |
(Sorry if this was closed prematurely.) re: 1, The eth-utils examples are interesting. Will explore this more when I get a chance. Would be great to have programmatic confidence that types are accurate. re: 3, Ah, I did test some ContractFunction functionality, but didn't get any warnings. That'd explain it. |
@carver the testing approaches you listed are the only ones I know from the top of my head. Generally, a high profit gain should also come from working towards strict mypy checking. There is still room in the |
What was wrong?
When calling
contract.events.Event()
, mypy warns thatContractEvent
is not callable.How can it be fixed?
After digging a little deeper, it seems that these three annotations should probably be
Type[ContractEvent]
instead:web3.py/web3/contract.py
Lines 246 to 263 in 92cf641
The text was updated successfully, but these errors were encountered: