Skip to content

Commit ced9cbd

Browse files
committed
Use more consistent geth_poa_middleware name
1 parent edc1c11 commit ced9cbd

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

docs/middleware.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,16 @@ For example, to connect to a local ``geth --dev`` instance on Linux:
331331
# connect to the default geth --dev IPC location
332332
>>> w3 = Web3(IPCProvider('/tmp/geth.ipc'))
333333
334-
>>> from web3.middleware import geth_poa_compatibility
334+
>>> from web3.middleware import geth_poa_middleware
335335
336336
# inject the poa compatibility middleware to the innermost layer
337-
>>> w3.middleware_stack.inject(geth_poa_compatibility, layer=0)
337+
>>> w3.middleware_stack.inject(geth_poa_middleware, layer=0)
338338
339339
# confirm that the connection succeeded
340340
>>> w3.version.node
341341
'Geth/v1.7.3-stable-4bb3c89d/linux-amd64/go1.9'
342342
343-
Why is ``geth_poa_compatibility`` necessary?
343+
Why is ``geth_poa_middleware`` necessary?
344344
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
345345

346346
There is no strong community consensus on a single Proof-of-Authority (PoA) standard yet.

tests/core/eth-module/test_poa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from web3.middleware import (
44
construct_fixture_middleware,
5-
geth_poa_compatibility,
5+
geth_poa_middleware,
66
)
77

88

@@ -29,7 +29,7 @@ def test_geth_proof_of_authority(web3):
2929
return_block_with_long_extra_data = construct_fixture_middleware({
3030
'eth_getBlockByNumber': {'extraData': '0x' + 'ff' * 33},
3131
})
32-
web3.middleware_stack.inject(geth_poa_compatibility, layer=0)
32+
web3.middleware_stack.inject(geth_poa_middleware, layer=0)
3333
web3.middleware_stack.inject(return_block_with_long_extra_data, layer=0)
3434
block = web3.eth.getBlock('latest')
3535
assert 'extraData' not in block

web3/middleware/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
)
4444

4545
from .geth_poa import ( # noqa: F401
46-
geth_poa_compatibility,
46+
geth_poa_middleware,
4747
)
4848

4949
from .validation import ( # noqa: F401

web3/middleware/geth_poa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
geth_poa_cleanup = compose(pythonic_geth_poa, remap_geth_poa_fields)
2525

26-
geth_poa_compatibility = construct_formatting_middleware(
26+
geth_poa_middleware = construct_formatting_middleware(
2727
result_formatters={
2828
'eth_getBlockByHash': geth_poa_cleanup,
2929
'eth_getBlockByNumber': geth_poa_cleanup,

0 commit comments

Comments
 (0)