-
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
#1002 Handle error when interacting with a bad contract #3194
base: main
Are you sure you want to change the base?
#1002 Handle error when interacting with a bad contract #3194
Conversation
Created this draft PR to initiate a conversation on this fix. I was able to reproduce the error when connecting to a Base Sepolia test wallet and setting up an invalid contract address. In order to not have the test actually connect to the network, I have mocked the functionalities. This is my first contribution to this repo so any suggestions on contributing and code reviewing are welcome! |
The |
@MRLab12 Thanks for the PR! I haven't had a chance to look at this yet, but I hope to be able to check it out in the next few days. |
What was wrong?
When a contract error happens during a call, usually we let the eth-abi exception raise through. This makes users think that web3.py is broken.
Related to Issue #1002
How was it fixed?
A
ContractLogicError
is now raised incall_contract_function
when a contract has no code.Todo: