Skip to content

Commit

Permalink
Support AVM v9 (#707)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Guidarelli <ben.guidarelli@gmail.com>
  • Loading branch information
jasonpaulos and barnjamin authored Jun 2, 2023
1 parent 81cb5fa commit a36c7ff
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Added

* Support for compiling AVM v9 programs. ([#707](https://github.com/algorand/pyteal/pull/707))

## Fixed

## Changed
Expand Down
1 change: 1 addition & 0 deletions docs/versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ AVM Version PyTeal Version
6 >= 0.10.0
7 >= 0.15.0
8 >= 0.20.0
9 >= 0.25.0
============ ==============

.. _version pragmas:
Expand Down
2 changes: 1 addition & 1 deletion pyteal/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from pyteal.util import algod_with_assertion


MAX_PROGRAM_VERSION = 8
MAX_PROGRAM_VERSION = 9
FRAME_POINTERS_VERSION = 8
DEFAULT_SCRATCH_SLOT_OPTIMIZE_VERSION = 9
MIN_PROGRAM_VERSION = 2
Expand Down
4 changes: 3 additions & 1 deletion pyteal/compiler/compiler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def test_compile_version_invalid():
pt.compileTeal(expr, pt.Mode.Signature, version=1) # too small

with pytest.raises(pt.TealInputError):
pt.compileTeal(expr, pt.Mode.Signature, version=9) # too large
pt.compileTeal(
expr, pt.Mode.Signature, version=pt.MAX_PROGRAM_VERSION + 1
) # too large

with pytest.raises(pt.TealInputError):
pt.compileTeal(expr, pt.Mode.Signature, version=2.0) # decimal
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/sourcemap_constructs311_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def big_opups_example(pt):
)


CONSTRUCTS_LATEST_VERSION = 8
CONSTRUCTS_LATEST_VERSION = 9


def test_constructs_handles_latest_pyteal():
Expand Down Expand Up @@ -2235,9 +2235,9 @@ def constructs_test(i, test_case, mode, version):
fixed_mode = test_case[3]
if mode != fixed_mode:
return
optimize = None
optimize = pt.OptimizeOptions(scratch_slots=False)
if len(test_case) > 4:
optimize = pt.OptimizeOptions(**test_case[4])
optimize = pt.OptimizeOptions(scratch_slots=False, **test_case[4])

mode = getattr(pt.Mode, mode)
if isinstance(expr, pt.Router):
Expand Down

0 comments on commit a36c7ff

Please sign in to comment.