diff --git a/tests/integration/parity/common.py b/tests/integration/parity/common.py index 284ea4c9b5..b0918e7336 100644 --- a/tests/integration/parity/common.py +++ b/tests/integration/parity/common.py @@ -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) diff --git a/web3/_utils/module_testing/parity_module.py b/web3/_utils/module_testing/parity_module.py index a6b25f45f9..75eeb5f4f5 100644 --- a/web3/_utils/module_testing/parity_module.py +++ b/web3/_utils/module_testing/parity_module.py @@ -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']) diff --git a/web3/_utils/rpc_abi.py b/web3/_utils/rpc_abi.py index 602cb2bd04..40eccb0bff 100644 --- a/web3/_utils/rpc_abi.py +++ b/web3/_utils/rpc_abi.py @@ -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], } diff --git a/web3/parity.py b/web3/parity.py index 3b37908d1d..6078cda348 100644 --- a/web3/parity.py +++ b/web3/parity.py @@ -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",