Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ABI Router
implementation and test (#170)
* init commit * minor * minor * rm decorator * update ABI router design, seems we are still working on previous design * minor * update condition parser here * skeleton for handler wrapping, need to tweak on subroutine to expose more message * module * use subroutine fn wrapper * update dummy method return class * unify ast construct way * minor * update notes for tasks and todos * update handler wrapping for bare app call * minor * update redirecting args to method registered * minor * minor * update router src * update program node * add questions in build prog * update executing method branch * minor * minor * minor * hide other methods, set MethodAppArgNumLimit, keyword args on exposed register func, skeleton for arg de-tuple * minor * update notes * update * add a default for no registered ast gen * update ast construction to conds * need some documentations * move abi-router in abi dir * minor * wtf * update * update to f-str * define void type * update instantiated computed type returnedType for ABI return in subroutine * minor * update stuffs to help infer type annotation of return ABI * minor * minor * minor * minor * minor * try my best to save stuffs * simplify decorator to single function * tear it down * minor * sheeeesh emacs * update with latest abi impl * minors * minor * updates * minor, renaming something * new design, start over * updates * abi fn wrapper for now * minor * minor update on subroutine def * minor fixes * minor fixes * changes * more constraint on void ret * update comment examples * import from abi * update some error msg and comments * testcases partial * upgrade testscripts * merging feature/abi to abi-router (#305) * merging feature/abi * missed one * make router use absolute imports * linter happy? * Export Router (#306) * Merge branch 'master' into feature/abi (#284) * Move to pyteal as pt in ABI tests with concise prefix (#286) * ABI Strings (#278) * Move to pyteal as pt in #278 (#287) * Merge absolute imports into feature/abi (#288) * Remove temporary I252 ignore on pyteal.ast.abi (#290) * Fix abi import (#303) * Fix abi import * ignore flake8 * move router to ast Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com> Co-authored-by: Jason Paulos <jasonpaulos@users.noreply.github.com> * fix spacing issue * Bundle optional refactorings to subroutine.py (#308) * Bundle optional refactorings to subroutine.py * Refactor to remove branching * storing local changes * pr review partly * pr review partly * update test script * Abi subroutine feature merge (#315) * resolve conflicts * lint * minor reconstruct * missing imports * missing requirements from bad merge * cooperate with typespec n var def change * update comments * some comments resolving? * trim * update some comments * bring testcase back * restriction on output kwarg name * stop ci! i am reformatting * squash merge abi subroutine atm, merge again after abi subroutine into feature/abi * conform to pep8, reconstructing * update json generator * simplify name constrain * resolving comments * Use deferred subroutine expression for ABI returns (#328) * Add subroutine deferred expr * Allow multiple deferred blocks * Remove error * flake8 * Make test more realistic * Add second test * clean up code and comments * remove deferred blocks function * Add coverage for multiple ops in block error * updating wrap handler * change how to de-tuple args * update checkbox * minor * bug fixes * Method sig for router (#340) * adding method_signature to ABIReturnSubroutine * minor, renaming * minor * simplify * compiler test adding... * documentation * start testcases * update router testcase * docstring tweak * update testcases * update testcases * formatting * branch cond testing * router contract test * subroutine branch wrapper bare call case tested * more testcases to barecall * minor, need to work on method call wrapper * half done on method call wrapper * update on abi method wrapper with return * detuple testcase * compiler test need to see csp * rm redundant type annotation * more error msg * renaming * renaming is_registrable -> is_abi_routable * reording imports, eliminate anti patterns * remove anti-pattern * section it out * non_empty_power_set -> power_set * add conflict detection to protect AST from overshadowing * error message * shrinked commits on pr review * add compile_program * fixup subroutine testcase * remove method signature specifying, directly infer from ABIReturnSubroutine * remove method sign field, directly infer from ABIReturnSubroutine * relaxation of bare app call arg num restriction * add barecall class, api change following * rename barecall to OnCompleteAction * remove outdated comments * start changing router api * eliminate contradiction for oc and creation * remove restriction on cond * new interface: add bare-calls on init, register method-call more fine-grained * documentation for new interface from last discussion * Refactor #170 to reduce visibility and mutation (#362) * Refactor to use partition * Designate _oc_under_call_config as private * hide wrap handler method * adding comment changes * pr review partly * partition into two methods * hide all these methods * arc4 compliant CallConfigs classmethod * arc4 compliant CallConfigs documentation * disclaimer comments * update new abi return hash prefix * review comments partly * OnCompleteActions -> BareCallActions * disclaimer change, rename CallConfigs -> MethodConfig * disclaimer move to docstring * better naming for naming prefix * new ast builder * review comments * An attempt to add decorator syntax to abi-router (#370) * an attempt to use decorator * no return, or we will have python-level issue? * minor fix * per pr comment on on-complete-action * eliminate potential issue * update call config testcase * add testcase for on complete action * per comments * Add a check in `method_signature` to disallow reference return types (#368) * new ast builder * adding check in method_signature to raise error if its attempted to be called on method with reference type as return value * use type spec instead of str * adding recursive type checking method and using it in subroutine method signature * Adding one more test case for extra nesting * appease the linter Co-authored-by: Hang Su <hang.su@algorand.com> * add new compiler tests for router * fix one test for wrapping bare calls * comments fixing * simplified oc-action post_init check * naming variables * comments * comments * testcase for method config update * add router method only in clearstate prog * closeout -> clearstate * removing is_arc4_compliant * update add method handler and method interface * remove arc4_compliant * Add manual test for 15+ args in abi router (#375) Co-authored-by: Ben Guidarelli <ben.guidarelli@gmail.com> Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com> Co-authored-by: Jason Paulos <jasonpaulos@users.noreply.github.com> Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com> Co-authored-by: Zeph Grunschlag <zeph@algorand.com>
- Loading branch information