-
Notifications
You must be signed in to change notification settings - Fork 143
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
ABI Type encoding support #238
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current structure looks a bit redundant, e.g. you have to from algosdk.abi.type import UintType
. I wonder if I should go back to putting this in algosdk/abi.py
or a different approach in packaging this -- any thoughts are appreciated.
If the But, what I think should actually happen is that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, I really like the use of an abstract base class for Type
and the encode
and decode
methods on each type.
My comments are mainly about implementation and some minor interface improvements.
Additionally, could you add docstring comments to the encode
and decode
methods of each subclass? The reason being each subclass accepts and returns different types for these methods, so it would be good if we can document them all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I left a few nits which you can choose to accept or not. Pending tests, this looks good to merge
* Add initial support for ABI types * Finish up abi types and values * Add doc strings * Refactor and finish encoding functions * More cleanup * Fix minor bugs and add number decoding * Bump version to 1.8.0 and add changelog * Add change to changelog * Add decoding for arrays and dynamic types * Add more unit tests * Minor change from PR comment * Another small PR comment change * Split up files and remove circular imports * Address PR comments * Have arrays accept bytes and add docstrings * Minor clean up * Fix error messages for negative uint * Remove unnecessary imports * Refactor out abi_types since it is implicit by the class * Tuples don't need static lengths... * Address PR comments 1 * Fix head encoding placeholders * Fix the tuple docstring * Formatting fixes Co-authored-by: Brice Rising <[email protected]>
This PR adds ABI encoding support for the Python SDK:
abi
support for types, e.g.from algosdk.abi import UintType
Closes #228