Skip to content

Commit

Permalink
chore: delete unnecessary awaiting on web3 calls (#2031)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Apr 26, 2024
1 parent 29ab23d commit eb4c373
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ape_ethereum/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
SourceTraceback,
TraceFrame,
)
from ape.utils import gas_estimation_error_message, run_until_complete, to_int
from ape.utils import gas_estimation_error_message, to_int
from ape.utils.misc import DEFAULT_MAX_RETRIES_TX
from ape_ethereum._print import CONSOLE_CONTRACT_ID, console_contract
from ape_ethereum.transactions import AccessList, AccessListTransaction
Expand Down Expand Up @@ -230,7 +230,7 @@ def is_connected(self) -> bool:
if self._web3 is None:
return False

return run_until_complete(self._web3.is_connected())
return self._web3.is_connected()

@property
def max_gas(self) -> int:
Expand Down Expand Up @@ -1048,8 +1048,7 @@ def _create_trace_frame(self, evm_frame: EvmTraceFrame) -> TraceFrame:

def _make_request(self, endpoint: str, parameters: Optional[List] = None) -> Any:
parameters = parameters or []
coroutine = self.web3.provider.make_request(RPCEndpoint(endpoint), parameters)
result = run_until_complete(coroutine)
result = self.web3.provider.make_request(RPCEndpoint(endpoint), parameters)

if "error" in result:
error = result["error"]
Expand Down

0 comments on commit eb4c373

Please sign in to comment.