Skip to content

Commit d2d7762

Browse files
authored
Feat/list decode (#19)
* add initial impl * fmt and clpy * rename args, fmt, and add to stub
1 parent 39d5bf6 commit d2d7762

File tree

5 files changed

+172
-127
lines changed

5 files changed

+172
-127
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bt_decode"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
edition = "2021"
55

66
[lib]

bt_decode.pyi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,22 @@ def decode(
350350
) -> Any:
351351
pass
352352

353+
def decode_list(
354+
list_type_strings: list[str],
355+
portable_registry: PortableRegistry,
356+
list_encoded: list[bytes],
357+
) -> list[Any]:
358+
"""
359+
Decode a list of SCALE-encoded types using a list of their type-strings.
360+
361+
Note: the type-strings are potentially all different.
362+
Note: the order of `list_type_strings` and `list_encoded` must match.
363+
364+
Returns a list of the decoded values as python objects, in the order they were
365+
provided to the function.
366+
"""
367+
pass
368+
353369
def encode(
354370
type_string: str, portable_registry: PortableRegistry, to_encode: Any
355371
) -> list[int]:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "bt-decode"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
description = "A wrapper around the scale-codec crate for fast scale-decoding of Bittensor data structures."
55
readme = "README.md"
66
license = {file = "LICENSE"}

0 commit comments

Comments
 (0)