Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Chop off checksum when using address in core commands #101

@todofixthis

Description

@todofixthis

Example:

In [1]: from iota import Address

In [2]: addy = Address('WLVZXWARPSYCWJMBZJGXHUOVYBVCEKMNQDMXHCAEJZFLFLMHFYYQQSSLVYWAZWESKXZOROLU9OQFRVDEWCHKKXPWGY')

In [3]: api.get_balances([addy])
iota.adapter.BadApiResponse: 400 response from node: Invalid addresses input

Workaround:

In [4]: api.get_balances([addy.address])
Out[4]:
{'balances': [0],
 'duration': 9,
 'milestone': Address(b'GNKYBMEKZFBYEQXINYTUGLGVSYCMRBBYDCWJ9KMJUTVMNDUVZQKGJK9RPBGTLWPYYERSLBPQBUTRZ9999'),
 'milestoneIndex': 286176}

I feel like PyOTA should do this automatically — there are a lot of use cases that involve generating addresses with checksums; it would get pretty unwieldy to have to remember to extract just the address when calling certain commands.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions