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

Add ABI support #264

Merged
merged 76 commits into from
Jul 22, 2022
Merged

Add ABI support #264

merged 76 commits into from
Jul 22, 2022

Conversation

michaeldiamant
Copy link
Contributor

@michaeldiamant michaeldiamant commented Apr 1, 2022

Aggregates child PRs providing initial ABI support (https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0004.md).

barnjamin and others added 30 commits March 1, 2022 14:36
* 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>
* Fix build script invocation (#223)

* Regen __init__.pyi

* Reorder CI build steps to change source files before running tests (#225)

Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
* Fix build script invocation (#223)

* Bring #225 to master (#227)

* Ignore tests generating TEAL file outputs used for expected comparisons (#228)

* Fix typo in CONTRIBUTING.md (#229)

Co-authored-by: Jason Paulos <jasonpaulos@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.
)

* update minor support for setting ComputedType

* minor tweak

* backwards for 3.8 on subscriptable type

* attempt to test uint set

* minor

* cleanup

* update arrays, tuple to test

* tuple testing

* update documents

* resolving comments

* py3.10 less go

* python typing annotations
* 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()`
jasonpaulos and others added 9 commits June 29, 2022 08:35
* 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>
@michaeldiamant michaeldiamant changed the title Merge feature/abi into master Add ABI support Jul 20, 2022
@michaeldiamant michaeldiamant marked this pull request as ready for review July 20, 2022 20:34
jasonpaulos and others added 3 commits July 21, 2022 09:18
* 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
@jasonpaulos jasonpaulos mentioned this pull request Jul 21, 2022
Copy link
Contributor

@tzaffi tzaffi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFGTM

Copy link
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finally...

@jasonpaulos jasonpaulos merged commit 82dbe2e into master Jul 22, 2022
@jasonpaulos jasonpaulos deleted the feature/abi branch July 22, 2022 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants