Skip to content

Commit b3ee29d

Browse files
committed
Update documentation for AsyncHTTPProvider instantiation.
1 parent 1ce6351 commit b3ee29d

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

docs/providers.rst

+4-12
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,10 @@ AsyncHTTPProvider
282282
>>> from web3.net import AsyncNet
283283
>>> from web3.geth import Geth, AsyncGethTxPool
284284
285-
>>> w3 = Web3(
286-
... AsyncHTTPProvider(endpoint_uri),
287-
... modules={'eth': (AsyncEth,),
288-
... 'net': (AsyncNet,),
289-
... 'geth': (Geth,
290-
... {'txpool': (AsyncGethTxPool,),
291-
... 'personal': (AsyncGethPersonal,),
292-
... 'admin' : (AsyncGethAdmin,)})
293-
... },
294-
... middlewares=[] # See supported middleware section below for middleware options
295-
... )
296-
>>> custom_session = ClientSession() # If you want to pass in your own session
285+
>>> w3 = Web3(AsyncHTTPProvider(endpoint_uri))
286+
287+
>>> # If you want to pass in your own session:
288+
>>> custom_session = ClientSession()
297289
>>> await w3.provider.cache_async_session(custom_session) # This method is an async method so it needs to be handled accordingly
298290
299291
Under the hood, the ``AsyncHTTPProvider`` uses the python

web3/manager.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ def default_middlewares(w3: "Web3") -> List[Tuple[Middleware, str]]:
149149
@staticmethod
150150
def async_default_middlewares(w3: "Web3") -> List[Tuple[Middleware, str]]:
151151
"""
152-
List the default middlewares for the request manager.
153-
Leaving ens unspecified will prevent the middleware from resolving names.
152+
List the default async middlewares for the request manager.
154153
"""
155154
return [
156155
(async_gas_price_strategy_middleware, "gas_price_strategy"),

0 commit comments

Comments
 (0)