-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: handle result from make_request()
#78
Conversation
@@ -203,6 +203,11 @@ def make_request(self, rpc: str, parameters: Optional[Iterable] = None) -> Any: | |||
) | |||
raise cls(message) from err | |||
|
|||
if isinstance(result, dict) and (res := result.get("result")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bugfix here, does the same as ape-ethereum, thus causing eth_call
(and other RPCs) to function correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnson2427 it processes it here (like ape core does) and returns the extracted value
this was kind of a regression because as part of the optimizations in core, switched the base class to use make_request more, causing us to reach this bug
@@ -184,7 +184,7 @@ def create_access_list( | |||
def make_request(self, rpc: str, parameters: Optional[Iterable] = None) -> Any: | |||
parameters = parameters or [] | |||
try: | |||
return self.web3.provider.make_request(RPCEndpoint(rpc), parameters) | |||
result = self.web3.provider.make_request(RPCEndpoint(rpc), parameters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't want this result, I'll approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the result is returned later on after some processing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't want that returned, and you just want that RPC endpoint to be called, then you can merge. Just want to make sure that's what you want to do
What I did
I tried simply connecting to base sepolia using alchemy but I was unable to make calls on contracts because it was trying to turn HexBytes(dict)
realized it was because ape-alchemy overrides make_request and does different stuff
How I did it
How to verify it
should get this know:
Checklist