Skip to content

Commit

Permalink
Frame Pointer usage in router (#600)
Browse files Browse the repository at this point in the history
* select related files

* or none...

* changelog

* compiler test

* const

* adding comments

* minor

* Update pyteal/ast/router.py

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* renaming i to something meaningful

* build program API change

* remove old comments

* or none

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* taking with minor mods

* renaming and comments

* function bundle things

* type casting

* test _failing_ on master

* wip

* unit test done

* stateful bug

* lint

* is this the bug that's been bugging me for almost a year?

* Update pyteal/ast/router.py

* does finally finally fix the bug?

* lint

* i think this works...

* 🤞

* lint and re-sort imports

* revert

* Update pyteal/ast/router_test.py

* oops - remove integration tests that snuck into unit tests

* hide build program method in router

* fix doc error

* Zeph's sick move

* Refactoring non-idempotent fix with contextmanager a bit (#649)

* minor, refactoring a bit

* renaming

* remove comments

* add 3rd case to test_build_program_clear_state_invalid_config

* Update pyteal/ast/router.py

Co-authored-by: Hang Su <87964331+ahangsu@users.noreply.github.com>

* minor refactoring

* bad merge

* minor, index_start_from

* documentation

* doc for de abify subroutine frame pointer

* doc for de abify subroutine vanilla

* Small tweaks of Router.bare_calls (#659)

* Graviton 4 abi router (#634)

* Tightening up types in 2 subroutine.py invokations (#672)

* Update pyteal/ast/router.py

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* default optimize object

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments and docs

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments and docs

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update router comments

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* default `wrap_to_name`

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments and docs

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments and docs

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments and docs

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments and docs

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments and docs

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments and docs

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* update comments and docs

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* minor

* better yield pattern in context manager

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>

* Merge master fp router (#678)

---------

Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>
Co-authored-by: Zeph Grunschlag <zeph@algorand.com>
  • Loading branch information
3 people committed Feb 23, 2023
1 parent 1973ded commit 134f434
Show file tree
Hide file tree
Showing 26 changed files with 4,929 additions and 1,261 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@

## Added

* Clarify that `Approve` and `Reject` always exit in the documentation. ([#660](https://github.com/algorand/pyteal/pull/660))
* Improved error handling for tuple type mismatch: added information on position and expected type. ([#655](https://github.com/algorand/pyteal/pull/655))
* Added an `asdict()` method to `ast.router.BareCallActions`. ([#656](https://github.com/algorand/pyteal/pull/656))
* Added frame pointer support for router. ([#600](https://github.com/algorand/pyteal/pull/600))
* NOTE: a backwards incompatable change was imposed in this PR: previous `build_program` method in `Router` was exported and public, now this method is hidden. Use `compile_program` only.

## Fixed

Expand Down
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ lint: black flake8 mypy sdist-check
# ---- Unit Tests (no algod) ---- #

# TODO: add blackbox_test.py to multithreaded tests when following issue has been fixed https://github.com/algorand/pyteal/issues/199

NUM_PROCS = auto
test-unit:
pytest -n $(NUM_PROCS) --durations=10 -sv pyteal tests/unit --ignore tests/unit/blackbox_test.py --ignore tests/unit/user_guide_test.py
pytest -n 1 -sv tests/unit/blackbox_test.py tests/unit/user_guide_test.py
test-unit-async:
pytest -n $(NUM_PROCS) --durations=10 -sv pyteal tests/unit -m "not serial"

test-unit-sync:
pytest --durations=10 -sv pyteal tests/unit -m serial

test-unit: test-unit-async test-unit-sync

lint-and-test: check-generate-init lint test-unit

Expand All @@ -64,9 +69,13 @@ lint-and-test: check-generate-init lint test-unit
algod-start:
docker compose up -d algod --wait

algod-version:
docker compose exec algod goal --version

algod-start-report: algod-start algod-version

algod-stop:
docker compose stop algod

integration-run:
pytest -n $(NUM_PROCS) --durations=10 -sv tests/integration -m "not serial"
pytest --durations=10 -sv tests/integration -m serial
Expand Down
2 changes: 1 addition & 1 deletion pyteal/ast/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def __init__(
):
super().__init__()

target_type = inferred_type if inferred_type is not None else TealType.anytype
target_type: TealType = inferred_type or TealType.anytype
require_type(value, target_type)

self.value = value
Expand Down

0 comments on commit 134f434

Please sign in to comment.