Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Annotation Wrong on StakeInfo.list_of_tuple_from_vec_u8 #1845

Closed
thewhaleking opened this issue May 6, 2024 · 2 comments
Closed

Type Annotation Wrong on StakeInfo.list_of_tuple_from_vec_u8 #1845

thewhaleking opened this issue May 6, 2024 · 2 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@thewhaleking
Copy link
Contributor

Describe the bug

There is a type annotation error in StakeInfo.list_of_tuple_from_vec_u8:

    @classmethod
    def list_of_tuple_from_vec_u8(
        cls, vec_u8: List[int]
    ) -> Dict[str, List["StakeInfo"]]:
        r"""Returns a list of StakeInfo objects from a ``vec_u8``."""
        decoded: Optional[
            List[Tuple(str, List[object])]
        ] = from_scale_encoding_using_type_string(
            input=vec_u8, type_string="Vec<(AccountId, Vec<StakeInfo>)>"
        )
        ...

Specifically: List[Tuple(str, List[object])].

This should be fixed, and would be a good first issue.

To Reproduce

Look at line 832 of chain_data.py.

Expected behavior

List[Tuple[str, List[object]]]

Screenshots

No response

Environment

Any

Additional context

No response

@thewhaleking thewhaleking added the good first issue Good for newcomers label May 6, 2024
@opendansor opendansor self-assigned this May 14, 2024
@opendansor
Copy link
Contributor

opendansor commented May 15, 2024

commit 29efad2 has already addressed this change.

https://github.com/opentensor/bittensor/pull/1840/files#diff-dc51391a180335c2350c6f5bcb125fc905cb18ee2abece7ff01ce32ccc1f58acL832

We can go ahead and close the issue.

@thewhaleking
Copy link
Contributor Author

Fixed by #1840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants