-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add ABI support #264
Merged
Merged
Add ABI support #264
Conversation
This file contains 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
* initial commit to be used for reference and comparison * Fmt * move abi to ast * make tuple return the deocded Tuple * rename collections, fixed some of the mypy issues * Fix mypy issues * remove Literal * add str method for abi type names * fix names * make imports nice * make imports nice * make collections generic * rm param spec * lie to mypy * make dynamic array work * [WIP] Make Add and Mul NaryExprs * ABI refactor * Implement decoding * Make arrays encode to a single value * Make types mutable * Proof of concept map implementation * Remove old comment * Update Uint16 limit check Co-authored-by: Giorgio Ciotti <gciotti.dev@gmail.com> * provide a method to know the type name (#176) * Refactor array implementation * Add ComputedType and fix bug in map * Add more int types and bool support * Add string method * Remove files for features that won't make it into this PR * Remove Array.map 😢 * Make decode more powerful * Uint bounds checking and tests * Remove random line * Bool tests and bugfixes * Allow uint and bool set to copy another type * Begin tuple and array tests, improve dynamic tuple encoding, and remove Array.forEach * Test indexTuple and fix bugs * Fix field shadowing * Finish tuple tests and type tests * Implement static and dynamic array tests * Finish testing abi types and fix tuple encoding bug * Add generic param to new instances of arrays * Address feedback * Fix tuple decoding issue * Fix uint64 decoding test * minor improvement to distinguish abi.Byte and abi.Uint8 (#194) * Add docstrings to abi.Type * Respond to feedback * Respond to feedback & fix bug * Fix indexTuple bug * Add docs for TealBlock methods * ABI Array docstrings and comments (#216) Co-authored-by: Jason Paulos <jasonpaulos@users.noreply.github.com> Co-authored-by: Giorgio Ciotti <gciotti.dev@gmail.com> Co-authored-by: Hang Su <87964331+ahangsu@users.noreply.github.com>
* Convert Type and Tuple to indexable types * Convert and combine uint types * Fix type and unit tests * Convert Bool * Fix Tuple getitem * Convert arrays and array tests * Fix tuple tests * [WIP] satisfy mypy * Refactor ABI types * Update docs, add Tuple4 and Tuple5, and change type_spec method name * No longer test on Python 3.6 and 3.7 * No longer test on Python 3.6 and 3.7 * Remove accidentally included file * Add another literal test case * Debugging through CI * blacken * Remove problematic test case * Minor test coverage improvements * Unit test to make sure type_spec_from_annotation always works on all types * Partially address feedback * Make uint8 != byte and use typing.Final in a few constructors * Undo custom set methods * Fix typo Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com> Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
- passing ABI variables into subroutine - subroutine type annotations with ABI types
Encode ABI variable and concat with `RETURN_METHOD_SELECTOR` and log it.
* Fix abi import * ignore flake8
Following major changes: * Merge in Blackbox testing * replace `SubroutineDefinition. _arg_types_and_by_refs()` by `SubroutineDefinition._validate()` * add abi cases to `subroutine_test.py::test_validate()`
* Check transaction type arguments * Rename Transaction.set to be private
* minor fix * minor * per Jason comment * minor, formatting
* Add semantic version dependency * Add `pragma` to enforce compatible compiler versions * Raise `TealInternalError` instead of `TealInputError` * Switch back to `pkg_resources` and convert PEP 440 to semantic version 2.0.0 * Fix linter errors * Make pep 440 converter private * Add `Pragma` expression * Refactor pragma functions from compiler to ast to avoid circular dependencies * Add `is_valid_compiler_version` check helper for the `Pragma` expression * Use `TealProgramError` instead of `TealInternalError` * Test underlying TEAL is unchanged * Refactor underlying pragma methods to parent directory * Inherit from `Expr` instead * Fix unclear docstring * Document init Document init * Add caret compiler version tests * Ignore unused fixture imports
* Consistently use start_ and end_index * format
* allow passing router description to Contract constructor
* Initial commit * Fix abi-docs tests (#402) * Fix abi-docs Sphinx warnings (#401) * Extend abi-docs with experimental design language (#403) * Add type fundamentals section * Add basic type usage and some docstrings for referenced methods * Finish documenting set and fix overloaded method docs * Add docstrings for get and __getitem__ * Add reference type docs * Add txn type examples * Fix errors * Make ComputedValue parameter type covariant * ComputedValue and subroutine sections * ...wasn't included in previous commit * Add bare app call and method registration examples * Add router e2e example and compilation explanation * Fix post-merge linter/test failures * Add calling documentation * Partially address feedback * Respond to feedback * Resolve TODOs * Add pragma references * didn't make it into the previous commit * Fix Bool.__module__ * Mention stack size limit * More pragma documentation * Address other feedback * Warn about reference type limits * **cannot** Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
* Clarify minimum Python version management docs (#435) * Foreign prefix on App and Asset arrays (#440) * replacing foreignapps with applications * fix assets as well * Add Execute Method (#444) * adding execute method to allow omission of begin/submit for common use case * exec docstring * update testcase Co-authored-by: Hang Su <hang.su@algorand.com> Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com> Co-authored-by: Ben Guidarelli <ben.guidarelli@gmail.com> Co-authored-by: Hang Su <hang.su@algorand.com>
* abi.Bool improvements * Don't need Seq anymore * nor its import * No black, that was not a tuple * modify integreation tests * missed one * Missed a file
tzaffi
reviewed
Jul 21, 2022
Merged
tzaffi
approved these changes
Jul 22, 2022
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.
LFGTM
jasonpaulos
approved these changes
Jul 22, 2022
ahangsu
approved these changes
Jul 22, 2022
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.
finally...
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.
Aggregates child PRs providing initial ABI support (https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0004.md).