Skip to content

Commit 48e9991

Browse files
committed
Remove unnecessary changes
1 parent 37c26d5 commit 48e9991

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

ens/async_ens.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@
7272
AsyncContract,
7373
AsyncContractFunction,
7474
)
75-
from web3.main import AsyncWeb3 # noqa: F401
75+
from web3.main import ( # noqa: F401
76+
AsyncWeb3,
77+
)
7678
from web3.middleware.base import ( # noqa: F401
7779
Middleware,
7880
)
@@ -100,8 +102,8 @@ class AsyncENS(BaseENS):
100102

101103
def __init__(
102104
self,
103-
provider: "AsyncBaseProvider" = None,
104-
addr: ChecksumAddress = None,
105+
provider: Optional["AsyncBaseProvider"] = None,
106+
addr: Optional[ChecksumAddress] = None,
105107
middleware: Optional[Sequence[Tuple["Middleware", str]]] = None,
106108
) -> None:
107109
"""

web3/_utils/abi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@
101101
)
102102

103103
if TYPE_CHECKING:
104-
from web3.main import AsyncWeb3 # noqa: F401
104+
from web3 import ( # noqa: F401
105+
AsyncWeb3,
106+
)
105107

106108

107109
def fallback_func_abi_exists(contract_abi: ABI) -> Sequence[ABIFallback]:

web3/_utils/batching.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ def __exit__(
167167
async def async_execute(self) -> List["RPCResponse"]:
168168
self._validate_is_batching()
169169
if self._provider.has_persistent_connection:
170-
responses = await cast(
171-
"AsyncWeb3[Any]", self.web3
172-
).manager._async_make_socket_batch_request(self._async_requests_info)
170+
responses = await self.web3.manager._async_make_socket_batch_request(
171+
self._async_requests_info
172+
)
173173
else:
174174
responses = await self.web3.manager._async_make_batch_request(
175175
self._async_requests_info

web3/_utils/module_testing/web3_module.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -717,9 +717,7 @@ async def test_batch_requests_clear(self, async_w3: AsyncWeb3[Any]) -> None:
717717
assert cast(BlockData, r3)["number"] == 6
718718

719719
@pytest.mark.asyncio
720-
async def test_batch_requests_cancel(
721-
self, async_w3: AsyncWeb3[Any]
722-
) -> None: # noqa: E501
720+
async def test_batch_requests_cancel(self, async_w3: AsyncWeb3[Any]) -> None:
723721
# as context manager
724722
async with async_w3.batch_requests() as batch:
725723
batch.add(async_w3.eth.get_block(1))
@@ -759,10 +757,10 @@ async def test_batch_requests_cancel(
759757
assert isinstance(block_num, int)
760758

761759
@pytest.mark.asyncio
762-
async def test_batch_requests_raises_for_common_unsupported_methods( # noqa: E501
760+
async def test_batch_requests_raises_for_common_unsupported_methods(
763761
self,
764762
async_w3: AsyncWeb3[Any],
765-
async_math_contract: "AsyncContract", # noqa: E501
763+
async_math_contract: "AsyncContract",
766764
) -> None:
767765
async with async_w3.batch_requests() as batch:
768766
with pytest.raises(MethodNotSupported, match="eth_sendTransaction"):
@@ -785,7 +783,7 @@ async def test_batch_requests_raises_for_common_unsupported_methods( # noqa: E5
785783
await batch.async_execute()
786784

787785
@pytest.mark.asyncio
788-
async def test_batch_requests_concurrently_with_regular_requests( # noqa: E501
786+
async def test_batch_requests_concurrently_with_regular_requests(
789787
self, async_w3: AsyncWeb3[Any]
790788
) -> None:
791789
responses = []

web3/providers/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ def batch_request_func(
192192
# type ignore bc in order to wrap the method, we have to call
193193
# `wrap_make_batch_request` with the accumulator_fn as the argument
194194
# which breaks the type hinting for this particular case.
195-
accumulator_fn = initialized.wrap_make_batch_request(
195+
accumulator_fn = initialized.wrap_make_batch_request( # type: ignore
196196
accumulator_fn
197-
) # type: ignore
197+
)
198198
self._batch_request_func_cache = (middleware, accumulator_fn)
199199

200200
return self._batch_request_func_cache[-1]

0 commit comments

Comments
 (0)