diff --git a/pyteal/ast/subroutine_test.py b/pyteal/ast/subroutine_test.py index 26c1d9a7a..32c426b09 100644 --- a/pyteal/ast/subroutine_test.py +++ b/pyteal/ast/subroutine_test.py @@ -1,5 +1,6 @@ from itertools import product from typing import Callable, Literal, Optional, cast +from inspect import signature import pytest from dataclasses import dataclass @@ -1326,6 +1327,11 @@ def mySubroutine_arg_10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10): assert len(declaration.body.args) == 2 assert isinstance(declaration.body.args[0], Proto) + + proto_expr = declaration.body.args[0] + assert proto_expr.num_returns == int(return_type != pt.TealType.none) + assert proto_expr.num_args == len(signature(subr).parameters) + assert isinstance(declaration.body.args[1], type(return_value)) options_v8.setSubroutine(definition) @@ -1335,8 +1341,7 @@ def mySubroutine_arg_10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10): actual, _ = declaration.__teal__(options_v8) options_v8.setSubroutine(None) - with pt.TealComponent.Context.ExprEqualityContext(): - assert actual == expected + assert actual == expected def test_docstring_parsing_with_different_format(): diff --git a/pyteal/compiler/compiler_test.py b/pyteal/compiler/compiler_test.py index 3016b8254..d4852bd73 100644 --- a/pyteal/compiler/compiler_test.py +++ b/pyteal/compiler/compiler_test.py @@ -2347,6 +2347,13 @@ def approve_if_odd(condition_encoding: pt.abi.Uint32) -> pt.Expr: clear_state=pt.OnCompleteAction.call_only(pt.Approve()), ) + with pytest.raises(pt.TealInputError) as e: + pt.Router("will-error", on_completion_actions).compile_program( + version=6, frame_pointers=True + ) + + assert "Try to use frame pointer with an insufficient version 6" in str(e) + _router_with_oc = pt.Router( "ASimpleQuestionablyRobustContract", on_completion_actions )