Skip to content

Commit

Permalink
Add doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes committed Nov 8, 2019
1 parent 23d540d commit 507f537
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/middleware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,17 @@ Locally Managed Log and Block Filters

This middleware provides an alternative to ethereum node managed filters. When used, Log and
Block filter logic are handled locally while using the same web3 filter api. Filter results are
retrieved using JSON-RPC endpoints that don't rely on server state.
retrieved using JSON-RPC endpoints that don't rely on server state.

.. code-block:: python
.. doctest::

>>> from web3 import Web3, EthereumTesterProvider
>>> w3 = Web3(EthereumTesterProvider())
>>> from web3.middleware import local_filter_middleware
>>> w3.middleware_onion.add(local_filter_middleware)

.. code-block:: python
# Normal block and log filter apis behave as before.
>>> block_filter = w3.eth.filter("latest")
Expand All @@ -396,7 +398,7 @@ Signing
.. py:method:: web3.middleware.construct_sign_and_send_raw_middleware(private_key_or_account)
This middleware automatically captures transactions, signs them, and sends them as raw transactions. The from field on the transaction, or ``w3.eth.defaultAccount`` must be set to the address of the private key for this middleware to have any effect.

* ``private_key_or_account`` A single private key or a tuple, list or set of private keys.

Keys can be in any of the following formats:
Expand Down

0 comments on commit 507f537

Please sign in to comment.