Skip to content

Commit

Permalink
Merge pull request #1145 from palkeo/master
Browse files Browse the repository at this point in the history
Add parity-specific listStorageKeys RPC.
  • Loading branch information
carver authored Nov 27, 2018
2 parents 0cbb1e4 + 5f8198c commit e4cba0e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/integration/parity/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def test_personal_sign_and_ecrecover(


class ParityTraceModuleTest(TraceModuleTest):
def test_list_storage_keys_no_support(self, web3, emitter_contract_address):
super().test_list_storage_keys_no_support(web3, emitter_contract_address)

def test_trace_replay_transaction(self, web3, parity_fixture_data):
super().test_trace_replay_transaction(web3, parity_fixture_data)

Expand Down
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 @@ -11,6 +11,10 @@

class ParityModuleTest:

def test_list_storage_keys_no_support(self, web3, emitter_contract_address):
keys = web3.parity.listStorageKeys(emitter_contract_address, 10, None)
assert keys is None

def test_trace_replay_transaction(self, web3, parity_fixture_data):
trace = web3.parity.traceReplayTransaction(parity_fixture_data['mined_txn_hash'])

Expand Down
2 changes: 2 additions & 0 deletions web3/_utils/rpc_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
'personal_unlockAccount': ['address', None, None],
'personal_sign': [None, 'address', None],
'trace_call': TRACE_PARAMS_ABIS,
# parity
'parity_listStorageKeys': ['address', None, None, None],
}


Expand Down
8 changes: 8 additions & 0 deletions web3/parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ def enode(self):
[],
)

def listStorageKeys(self, address, quantity, hash_, block_identifier=None):
if block_identifier is None:
block_identifier = self.defaultBlock
return self.web3.manager.request_blocking(
"parity_listStorageKeys",
[address, quantity, hash_, block_identifier],
)

def netPeers(self):
return self.web3.manager.request_blocking(
"parity_netPeers",
Expand Down

0 comments on commit e4cba0e

Please sign in to comment.