Skip to content

Commit

Permalink
Include well-known PalletVersion storage function (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanz authored Feb 21, 2023
1 parent c809965 commit b96c612
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ eth_utils>=1.3.0,<3
pycryptodome>=3.11.0,<4
PyNaCl>=1.0.1,<2

scalecodec>=1.2,<1.3
scalecodec>=1.2.1,<1.3
py-sr25519-bindings>=0.2.0,<1
py-ed25519-zebra-bindings>=1.0,<2
py-bip39-bindings>=0.1.9,<1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
'eth_utils>=1.3.0,<3',
'pycryptodome>=3.11.0,<4',
'PyNaCl>=1.0.1,<2',
'scalecodec>=1.2,<1.3',
'scalecodec>=1.2.1,<1.3',
'py-sr25519-bindings>=0.2.0,<1',
'py-ed25519-zebra-bindings>=1.0,<2',
'py-bip39-bindings>=0.1.9,<1'
Expand Down
2 changes: 1 addition & 1 deletion substrateinterface/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ def subscription_handler(obj, update_nr, subscription_id):

storage_hash = self.generate_storage_hash(
storage_module=metadata_module.value['storage']['prefix'],
storage_function=storage_function,
storage_function=storage_item.value['name'],
params=params,
hashers=hashers
)
Expand Down
8 changes: 8 additions & 0 deletions test/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ def test_well_known_keys_not_found(self):
with self.assertRaises(StorageFunctionNotFound):
self.kusama_substrate.query("Substrate", "Unknown")

def test_well_known_pallet_version(self):

sf = self.kusama_substrate.get_metadata_storage_function("System", "PalletVersion")
self.assertEqual(sf.value['name'], ':__STORAGE_VERSION__:')

result = self.kusama_substrate.query("System", "PalletVersion")
self.assertGreaterEqual(result.value, 0)


if __name__ == '__main__':
unittest.main()

0 comments on commit b96c612

Please sign in to comment.