Skip to content

Commit 5a76a89

Browse files
committed
Lint
1 parent ab914a7 commit 5a76a89

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

tests/integration/go_ethereum/test_goethereum_http.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
get_open_port,
55
)
66
from web3 import Web3
7+
from web3.eth import (
8+
AsyncEth,
9+
)
10+
from web3.providers.rpc import (
11+
AsyncHTTPProvider,
12+
)
713

814
from .common import (
915
GoEthereumAdminModuleTest,
@@ -15,14 +21,8 @@
1521
GoEthereumVersionModuleTest,
1622
)
1723
from .utils import (
18-
wait_for_http,
1924
wait_for_aiohttp,
20-
)
21-
from web3.providers.rpc import (
22-
AsyncHTTPProvider,
23-
)
24-
from web3.eth import (
25-
AsyncEth,
25+
wait_for_http,
2626
)
2727

2828

tests/integration/go_ethereum/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import aiohttp
21
import signal
32
import socket
43
import time
54

5+
import aiohttp
66
import requests
77

88

web3/eth.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from typing import (
22
Any,
3+
Awaitable,
34
Callable,
5+
Coroutine,
46
List,
57
NoReturn,
68
Optional,
@@ -105,21 +107,21 @@
105107

106108

107109
class BaseEth(Module):
108-
_gas_price: Method[Callable[[], Wei]] = Method(
110+
_gas_price: Method[Callable[[], Union[Wei, Awaitable[Any]]]] = Method(
109111
RPC.eth_gasPrice,
110112
mungers=None,
111113
)
112114

113115
@property
114-
def gas_price(self) -> Wei:
116+
def gas_price(self) -> Union[Coroutine[Any, Any, Wei], Wei]:
115117
return self._gas_price()
116118

117119

118120
class AsyncEth(BaseEth):
119121
is_async = True
120122

121123
@property
122-
async def gas_price(self) -> Wei:
124+
async def gas_price(self) -> Coroutine[Any, Any, Wei]:
123125
return await self._gas_price()
124126

125127

web3/providers/async_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from typing import (
33
TYPE_CHECKING,
44
Any,
5+
Awaitable,
56
Callable,
7+
Coroutine,
68
Tuple,
79
cast,
810
)
@@ -44,7 +46,7 @@ def middlewares(
4446

4547
def request_func(
4648
self, web3: "Web3", outer_middlewares: MiddlewareOnion
47-
) -> Callable[..., RPCResponse]:
49+
) -> Coroutine[Any, Any, RPCResponse]:
4850
# Placeholder - manager calls self.provider.request_func
4951
# Eventually this will handle caching and return make_request
5052
# along with all the middleware
@@ -75,7 +77,7 @@ async def decode_rpc_response(self, raw_response: bytes) -> RPCResponse:
7577
text_response = to_text(raw_response)
7678
return cast(RPCResponse, FriendlyJsonSerde().json_decode(text_response))
7779

78-
async def isConnected(self) -> bool:
80+
async def isConnected(self) -> Awaitable[Any]:
7981
try:
8082
response = await self.make_request(RPCEndpoint('web3_clientVersion'), [])
8183
except IOError:

0 commit comments

Comments
 (0)