Skip to content

Commit 67e0d77

Browse files
committed
bumped torustrateinterface version
1 parent 8685ac8 commit 67e0d77

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "torusdk"
3-
version = "0.2.4.1"
3+
version = "0.2.4.2"
44
description = "Torus network official CLI"
55
authors = ["renlabs <[email protected]>"]
66
license = "MIT"
@@ -24,7 +24,7 @@ ignore = [
2424
[tool.poetry.dependencies]
2525
python = ">=3.10,<4.0"
2626

27-
torustrateinterface = "^0.1.0"
27+
torustrateinterface = "0.1.2"
2828
# Substrate
2929
# substrate-interface = "^1.7.4"
3030
scalecodec = "^1.2.7"

src/torusdk/client.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,9 @@ def concat_hash_len(key_hasher: str) -> int:
652652
return result_dict
653653

654654
def query_batch(
655-
self, functions: dict[str, list[tuple[str, list[Any]]]]
655+
self,
656+
functions: dict[str, list[tuple[str, list[Any]]]],
657+
block_hash: str | None = None,
656658
) -> dict[str, str]:
657659
"""
658660
Executes batch queries on a substrate and returns results in a dictionary format.
@@ -683,8 +685,8 @@ def query_batch(
683685
pallet=module, storage_function=fn, params=params
684686
)
685687
storage_keys.append(storage_function)
686-
687-
block_hash = substrate.get_block_hash()
688+
if not block_hash:
689+
block_hash = substrate.get_block_hash()
688690
responses: list[Any] = substrate.query_multi( # type: ignore
689691
storage_keys=storage_keys, block_hash=block_hash
690692
)
@@ -799,7 +801,9 @@ def query(
799801
NetworkQueryError: If the query fails or is invalid.
800802
"""
801803

802-
result = self.query_batch({module: [(name, params)]})
804+
result = self.query_batch(
805+
{module: [(name, params)]}, block_hash=block_hash
806+
)
803807

804808
return result[name]
805809

0 commit comments

Comments
 (0)