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

Adds support for Parity addReservedPeer for Management of PoA Parity Clusters #1311

Merged
merged 5 commits into from
Apr 8, 2019
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
4 changes: 4 additions & 0 deletions web3/_utils/module_testing/parity_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,7 @@ def test_trace_filter(self, web3, txn_filter_params, parity_fixture_data):
trace = web3.parity.traceFilter(txn_filter_params)
assert isinstance(trace, list)
assert trace[0]['action']['from'] == add_0x_prefix(parity_fixture_data['coinbase'])

def test_add_reserved_peer(self, web3):
peer_addr = 'enode://f1a6b0bdbf014355587c3018454d070ac57801f05d3b39fe85da574f002a32e929f683d72aa5a8318382e4d3c7a05c9b91687b0d997a39619fb8a6e7ad88e512@1.1.1.1:30300' # noqa: E501
assert web3.parity.addReservedPeer(peer_addr)
6 changes: 6 additions & 0 deletions web3/parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ def netPeers(self):
[],
)

def addReservedPeer(self, url):
return self.web3.manager.request_blocking(
"parity_addReservedPeer",
[url],
)

def traceReplayTransaction(self, transaction_hash, mode=['trace']):
return self.web3.manager.request_blocking(
"trace_replayTransaction",
Expand Down