From 3ec397b9958dc736292be490521e3de62e308f77 Mon Sep 17 00:00:00 2001 From: Ben Guidarelli Date: Sat, 11 Dec 2021 16:11:31 -0500 Subject: [PATCH 1/5] up max teal version --- pyteal/compiler/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyteal/compiler/compiler.py b/pyteal/compiler/compiler.py index 1644e8343..dc1199e45 100644 --- a/pyteal/compiler/compiler.py +++ b/pyteal/compiler/compiler.py @@ -22,7 +22,7 @@ ) from .constants import createConstantBlocks -MAX_TEAL_VERSION = 5 +MAX_TEAL_VERSION = 6 MIN_TEAL_VERSION = 2 DEFAULT_TEAL_VERSION = MIN_TEAL_VERSION From d08347bcdcd2518e9e1b7a89c9c2dc7c663d4074 Mon Sep 17 00:00:00 2001 From: Ben Guidarelli Date: Mon, 20 Dec 2021 11:39:41 -0500 Subject: [PATCH 2/5] make test fail if its greater than version defined as MAX_TEAL_VERSION --- pyteal/compiler/compiler_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyteal/compiler/compiler_test.py b/pyteal/compiler/compiler_test.py index 3679be27b..b52035f83 100644 --- a/pyteal/compiler/compiler_test.py +++ b/pyteal/compiler/compiler_test.py @@ -134,7 +134,7 @@ def test_compile_version_invalid(): compileTeal(expr, Mode.Signature, version=1) # too small with pytest.raises(TealInputError): - compileTeal(expr, Mode.Signature, version=6) # too large + compileTeal(expr, Mode.Signature, version=MAX_TEAL_VERSION+1) # too large with pytest.raises(TealInputError): compileTeal(expr, Mode.Signature, version=2.0) # decimal From d9eb977ae558a62f6616322f2704433aa48467c5 Mon Sep 17 00:00:00 2001 From: Ben Guidarelli Date: Mon, 20 Dec 2021 11:48:40 -0500 Subject: [PATCH 3/5] Fmt --- pyteal/compiler/compiler_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyteal/compiler/compiler_test.py b/pyteal/compiler/compiler_test.py index b52035f83..8381959b9 100644 --- a/pyteal/compiler/compiler_test.py +++ b/pyteal/compiler/compiler_test.py @@ -134,7 +134,7 @@ def test_compile_version_invalid(): compileTeal(expr, Mode.Signature, version=1) # too small with pytest.raises(TealInputError): - compileTeal(expr, Mode.Signature, version=MAX_TEAL_VERSION+1) # too large + compileTeal(expr, Mode.Signature, version=MAX_TEAL_VERSION + 1) # too large with pytest.raises(TealInputError): compileTeal(expr, Mode.Signature, version=2.0) # decimal From f22f38ae294b68105b5afc08a0f076a6d6b40130 Mon Sep 17 00:00:00 2001 From: Ben Guidarelli Date: Mon, 20 Dec 2021 12:07:01 -0500 Subject: [PATCH 4/5] hardcode to 7 --- pyteal/compiler/compiler_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyteal/compiler/compiler_test.py b/pyteal/compiler/compiler_test.py index 8381959b9..236e36617 100644 --- a/pyteal/compiler/compiler_test.py +++ b/pyteal/compiler/compiler_test.py @@ -134,7 +134,7 @@ def test_compile_version_invalid(): compileTeal(expr, Mode.Signature, version=1) # too small with pytest.raises(TealInputError): - compileTeal(expr, Mode.Signature, version=MAX_TEAL_VERSION + 1) # too large + compileTeal(expr, Mode.Signature, version=7) # too large with pytest.raises(TealInputError): compileTeal(expr, Mode.Signature, version=2.0) # decimal From 49bce106682749fa995b3be750fbf21d5cd3995d Mon Sep 17 00:00:00 2001 From: Ben Guidarelli Date: Mon, 20 Dec 2021 12:52:36 -0500 Subject: [PATCH 5/5] Add version 6 test --- pyteal/compiler/compiler_test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyteal/compiler/compiler_test.py b/pyteal/compiler/compiler_test.py index 236e36617..815117337 100644 --- a/pyteal/compiler/compiler_test.py +++ b/pyteal/compiler/compiler_test.py @@ -195,6 +195,17 @@ def test_compile_version_5(): assert actual == expected +def test_compile_version_6(): + expr = Int(1) + expected = """ +#pragma version 6 +int 1 +return +""".strip() + actual = compileTeal(expr, Mode.Signature, version=6) + assert actual == expected + + def test_slot_load_before_store(): program = AssetHolding.balance(Int(0), Int(0)).value()