Repository: ethereum/web3.py

Issue:
bug: Async contract event get_logs broken
* Version: 6.2.0
* Python: 3.10

### What was wrong?

Forgot to change type check when migrating to asyncio here: https://github.com/ethereum/web3.py/blob/v6.2.0/web3/_utils/events.py#L450

```python
w3 = web3.AsyncWeb3(web3.AsyncWeb3.AsyncHTTPProvider(NODE_URL))
CONTRACT = w3.eth.contract(address=CT_ADDR, abi=ABI)
event_filter = await CONTRACT.events.MyEvent.create_filter(fromBlock='latest')
```
```python
File ~\miniconda3\envs\py39\lib\site-packages\web3\contract\async_contract.py:539, in AsyncContractEvent.create_filter(self, argument_filters, fromBlock, toBlock, address, topics)
    530 filter_builder = AsyncEventFilterBuilder(self._get_event_abi(), self.w3.codec)
    531 self._set_up_filter_builder(
    532     argument_filters,
    533     fromBlock,
   (...)
    537     filter_builder,
    538 )
--> 539 log_filter = await filter_builder.deploy(self.w3)
    540 log_filter.log_entry_formatter = get_event_data(
    541     self.w3.codec, self._get_event_abi()
    542 )
    543 log_filter.builder = filter_builder

File ~\miniconda3\envs\py39\lib\site-packages\web3\_utils\events.py:451, in AsyncEventFilterBuilder.deploy(self, async_w3)
    449 async def deploy(self, async_w3: "AsyncWeb3") -> "AsyncLogFilter":
    450     if not isinstance(async_w3, web3.Web3):
--> 451         raise ValueError(f"Invalid web3 argument: got: {async_w3!r}")
    453     for arg in AttributeDict.values(self.args):
    454         arg._immutable = True

ValueError: Invalid web3 argument: got: <web3.main.AsyncWeb3 object at 0x0000025EAAC14070>
```





Discussion:

Resolving patch:
diff --git a/web3/_utils/events.py b/web3/_utils/events.py
--- a/web3/_utils/events.py
+++ b/web3/_utils/events.py
@@ -447,7 +447,7 @@ def deploy(self, w3: "Web3") -> "LogFilter":
 
 class AsyncEventFilterBuilder(BaseEventFilterBuilder):
     async def deploy(self, async_w3: "AsyncWeb3") -> "AsyncLogFilter":
-        if not isinstance(async_w3, web3.Web3):
+        if not isinstance(async_w3, web3.AsyncWeb3):
             raise ValueError(f"Invalid web3 argument: got: {async_w3!r}")
 
         for arg in AttributeDict.values(self.args):
@@ -455,6 +455,7 @@ async def deploy(self, async_w3: "AsyncWeb3") -> "AsyncLogFilter":
         self._immutable = True
 
         log_filter = await async_w3.eth.filter(self.filter_params)
+        log_filter = cast("AsyncLogFilter", log_filter)
         log_filter.filter_params = self.filter_params
         log_filter.set_data_filters(self.data_argument_values)
         log_filter.builder = self


Test patch:
diff --git a/tests/core/filtering/utils.py b/tests/core/filtering/utils.py
--- a/tests/core/filtering/utils.py
+++ b/tests/core/filtering/utils.py
@@ -1,4 +1,5 @@
 from web3 import (
+    AsyncWeb3,
     Web3,
 )
 from web3.eth import (
@@ -48,7 +49,7 @@ def _emitter_fixture_logic(
 def _async_w3_fixture_logic(request):
     use_filter_middleware = request.param
     provider = AsyncEthereumTesterProvider()
-    async_w3 = Web3(provider, modules={"eth": [AsyncEth]}, middlewares=[])
+    async_w3 = AsyncWeb3(provider, modules={"eth": [AsyncEth]}, middlewares=[])
 
     if use_filter_middleware:
         async_w3.middleware_onion.add(async_local_filter_middleware)