Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes committed Nov 11, 2019
1 parent 41d6b2a commit 3b62fb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web3/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def request_blocking(self, method, params, error_formatters=None):
Make a synchronous request using the provider
"""
response = self._make_request(method, params)
apply_error_formatters(error_formatters, response)

if "error" in response:
apply_error_formatters(error_formatters, response)
raise ValueError(response["error"])

return response['result']
Expand All @@ -116,9 +116,9 @@ async def coro_request(self, method, params, error_formatters=None):
Couroutine for making a request using the provider
"""
response = await self._coro_make_request(method, params)
apply_error_formatters(error_formatters, response)

if "error" in response:
apply_error_formatters(error_formatters, response)
raise ValueError(response["error"])

if response['result'] is None:
Expand Down
7 changes: 7 additions & 0 deletions web3/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ def method_selector_fn(self):
raise ValueError("``json_rpc_method`` config invalid. May be a string or function")

def input_munger(self, module, args, kwargs):
# This function takes the "root_munger" - the first munger in
# the list of mungers) and then pipes the return value of the
# previous munger as an argument to the next munger to return
# an array of arguments that have been formatted.
# See the test_process_params test
# in tests/core/method-class/test_method.py for an example
# with multiple mungers.
# TODO: Create friendly error output.
mungers_iter = iter(self.mungers)
root_munger = next(mungers_iter)
Expand Down

0 comments on commit 3b62fb3

Please sign in to comment.