def make_request(self, method, params): if self.provider: response = self.provider.make_request(method, params) if response is None: return {'error': 'Empty response received'} return response raise CannotHandleRequest('No underlying provider is available')
def _proxy_request(self, method, params, use_cache=True): provider = self._get_active_provider(use_cache) if provider is None: raise CannotHandleRequest( "Could not discover provider while making request: " "method:{0}\n" "params:{1}\n".format(method, params)) return provider.make_request(method, params)
def _proxy_request(self, method: RPCEndpoint, params: Any, use_cache: bool = True) -> RPCResponse: provider = self._get_active_provider(use_cache) if provider is None: raise CannotHandleRequest( "Could not discover provider while making request: " f"method:{method}\nparams:{params}\n") return provider.make_request(method, params)
def _proxy_request(self, method, params, use_cache=True): provider = self._get_active_provider(use_cache) if provider is None: raise CannotHandleRequest("Could not discover provider") return provider.make_request(method, params)