-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
except HTTPError as err: | ||
response_data = err.response.json() if err.response else {} | ||
if "error" not in response_data: | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. bugfix here, does the same as ape-ethereum, thus causing There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
return res | ||
|
||
return result | ||
|
||
def send_private_transaction(self, txn: TransactionAPI, **kwargs) -> ReceiptAPI: | ||
""" | ||
See `Alchemy's guide <https://www.alchemy.com/overviews/ethereum-private-transactions>`__ | ||
|
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!