Merged
Conversation
ibraheem-abe
approved these changes
Jun 27, 2025
basfroman
approved these changes
Jun 27, 2025
Comment on lines
+1005
to
+1013
| if self.decode_ss58: | ||
| try: | ||
| type_str_int = int(type_string.split("::")[1]) | ||
| decoded_type_str = runtime.type_id_to_name[type_str_int] | ||
| obj = convert_account_ids( | ||
| obj, decoded_type_str, runtime.ss58_format | ||
| ) | ||
| except (ValueError, KeyError): | ||
| pass |
Collaborator
Author
There was a problem hiding this comment.
It's not elegant, but it works. I've not actually found any situation in which it would actually raise these, but it's possible.
…eking/python-ss58-conversion # Conflicts: # tests/unit_tests/asyncio_/test_substrate_interface.py # tests/unit_tests/sync/test_substrate_interface.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is not a breaking change, as we only do the convesion if
SubstrateInterface.decode_ss58is set toTrue(it isFalseby default)Converts all AccountID bytes tuples to SS58.
Resolves #61
Based on #141
Speed concerns: when tested with the following:
Results were 107 seconds for
decode_ss58=Trueand 111 seconds fordecode_ss58=False. I don't think the added SS58 decoding makes it slower, and I think the minor difference in time can be explained by network imperfection. However, I will say this shows it should not run any slower (real world).