From 3dd3238f22b77aae94b4cc20cc8d4ed36f12c08d Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Thu, 30 Jan 2025 21:33:23 +0200 Subject: [PATCH 1/4] Fix return type --- async_substrate_interface/async_substrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/async_substrate_interface/async_substrate.py b/async_substrate_interface/async_substrate.py index 01889ac..da067d8 100644 --- a/async_substrate_interface/async_substrate.py +++ b/async_substrate_interface/async_substrate.py @@ -2493,7 +2493,7 @@ async def runtime_call( method: str, params: Optional[Union[list, dict]] = None, block_hash: Optional[str] = None, - ) -> ScaleType: + ) -> ScaleObj: """ Calls a runtime API method From b4e6630f0404244110d263e2cf59333a849be17d Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Thu, 30 Jan 2025 22:07:33 +0200 Subject: [PATCH 2/4] Fix typing --- async_substrate_interface/async_substrate.py | 2 +- async_substrate_interface/sync_substrate.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/async_substrate_interface/async_substrate.py b/async_substrate_interface/async_substrate.py index da067d8..767f966 100644 --- a/async_substrate_interface/async_substrate.py +++ b/async_substrate_interface/async_substrate.py @@ -2628,7 +2628,7 @@ async def get_constant( constant_name: str, block_hash: Optional[str] = None, reuse_block_hash: bool = False, - ) -> Optional["ScaleType"]: + ) -> Optional[ScaleObj]: """ Returns the decoded `ScaleType` object of the constant for given module name, call function name and block_hash (or chaintip if block_hash is omitted) diff --git a/async_substrate_interface/sync_substrate.py b/async_substrate_interface/sync_substrate.py index c018a18..3c3d772 100644 --- a/async_substrate_interface/sync_substrate.py +++ b/async_substrate_interface/sync_substrate.py @@ -598,7 +598,7 @@ def decode_scale( type_string: str, scale_bytes: bytes, return_scale_obj=False, - ) -> Any: + ) -> Union[ScaleObj, Any]: """ Helper function to decode arbitrary SCALE-bytes (e.g. 0x02000000) according to given RUST type_string (e.g. BlockNumber). The relevant versioning information of the type (if defined) will be applied if block_hash @@ -2334,7 +2334,7 @@ def get_constant( constant_name: str, block_hash: Optional[str] = None, reuse_block_hash: bool = False, - ) -> Optional["ScaleType"]: + ) -> Optional[ScaleObj]: """ Returns the decoded `ScaleType` object of the constant for given module name, call function name and block_hash (or chaintip if block_hash is omitted) From d1e657aac9f0c454099b4dd103c3a6f9aad15197 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Thu, 30 Jan 2025 22:19:26 +0200 Subject: [PATCH 3/4] Wrong var used. --- async_substrate_interface/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/async_substrate_interface/types.py b/async_substrate_interface/types.py index a2237f3..b4c38ed 100644 --- a/async_substrate_interface/types.py +++ b/async_substrate_interface/types.py @@ -743,7 +743,7 @@ def _encode_scale(self, type_string, value: Any) -> bytes: result += account # Already encoded else: result += bytes.fromhex( - ss58_decode(value, SS58_FORMAT) + ss58_decode(account, SS58_FORMAT) ) # SS58 string return result From 54bbdfbf83b5eb02536e2e765995db9a92389be4 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Thu, 30 Jan 2025 13:21:40 -0800 Subject: [PATCH 4/4] Bumps version and changelog --- CHANGELOG.md | 3 +++ pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0a92ff..5d13c55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.0.0rc8 /2025-01-30 +* Minor bug fixes + ## 1.0.0rc7 /2025-01-29 ## What's Changed diff --git a/pyproject.toml b/pyproject.toml index 4d981ea..8116899 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "async-substrate-interface" -version = "1.0.0rc7" +version = "1.0.0rc8" description = "Asyncio library for interacting with substrate. Mostly API-compatible with py-substrate-interface" readme = "README.md" license = { file = "LICENSE" }