Skip to content

Commit e4cba0e

Browse files
authored
Merge pull request #1145 from palkeo/master
Add parity-specific listStorageKeys RPC.
2 parents 0cbb1e4 + 5f8198c commit e4cba0e

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

tests/integration/parity/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ def test_personal_sign_and_ecrecover(
169169

170170

171171
class ParityTraceModuleTest(TraceModuleTest):
172+
def test_list_storage_keys_no_support(self, web3, emitter_contract_address):
173+
super().test_list_storage_keys_no_support(web3, emitter_contract_address)
174+
172175
def test_trace_replay_transaction(self, web3, parity_fixture_data):
173176
super().test_trace_replay_transaction(web3, parity_fixture_data)
174177

web3/_utils/module_testing/parity_module.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
class ParityModuleTest:
1313

14+
def test_list_storage_keys_no_support(self, web3, emitter_contract_address):
15+
keys = web3.parity.listStorageKeys(emitter_contract_address, 10, None)
16+
assert keys is None
17+
1418
def test_trace_replay_transaction(self, web3, parity_fixture_data):
1519
trace = web3.parity.traceReplayTransaction(parity_fixture_data['mined_txn_hash'])
1620

web3/_utils/rpc_abi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
'personal_unlockAccount': ['address', None, None],
5858
'personal_sign': [None, 'address', None],
5959
'trace_call': TRACE_PARAMS_ABIS,
60+
# parity
61+
'parity_listStorageKeys': ['address', None, None, None],
6062
}
6163

6264

web3/parity.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ def enode(self):
2222
[],
2323
)
2424

25+
def listStorageKeys(self, address, quantity, hash_, block_identifier=None):
26+
if block_identifier is None:
27+
block_identifier = self.defaultBlock
28+
return self.web3.manager.request_blocking(
29+
"parity_listStorageKeys",
30+
[address, quantity, hash_, block_identifier],
31+
)
32+
2533
def netPeers(self):
2634
return self.web3.manager.request_blocking(
2735
"parity_netPeers",

0 commit comments

Comments
 (0)