Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add net_peers, deprecate netPeers #1946

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/1946.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add net_peers deprecate netPeers
2 changes: 1 addition & 1 deletion tests/integration/generate_fixtures/parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def generate_parity_fixture(destination_dir):


def connect_nodes(w3_parity, w3_secondary):
parity_peers = w3_parity.parity.netPeers()
parity_peers = w3_parity.parity.net_peers()
parity_enode = w3_parity.parity.enode()
secondary_node_info = w3_secondary.geth.admin.node_info()
if secondary_node_info['id'] not in (node.get('id', tuple()) for node in parity_peers['peers']):
Expand Down
6 changes: 5 additions & 1 deletion web3/parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
RPC,
)
from web3.method import (
DeprecatedMethod,
Method,
default_root_munger,
)
Expand Down Expand Up @@ -138,7 +139,7 @@ def list_storage_keys_munger(
mungers=[list_storage_keys_munger],
)

netPeers: Method[Callable[[], ParityNetPeers]] = Method(
net_peers: Method[Callable[[], ParityNetPeers]] = Method(
RPC.parity_netPeers,
mungers=None
)
Expand Down Expand Up @@ -218,3 +219,6 @@ def trace_transactions_munger(
RPC.parity_mode,
mungers=None
)

# Deprecated Methods
netPeers = DeprecatedMethod(net_peers, 'netPeers', 'net_peers')