Repository: algorand/pyteal (language: python)

Issue:
ABI Strings
Adding Address and String that subclass other Array types with hardcoded type specs

Closes #280 

- [x] Address type def
- [x] Address Testing
- [x] String type def
- [x] String testing

Follow up PR should implement setting directly from a byte string and mayybee a slice overload for __getitem__ on string?


Discussion / hints:

Fix patch:
diff --git a/pyteal/__init__.pyi b/pyteal/__init__.pyi
index 1e1d18553..1373403bd 100644
--- a/pyteal/__init__.pyi
+++ b/pyteal/__init__.pyi
@@ -140,6 +140,7 @@ __all__ = [
     "RETURN_METHOD_SELECTOR",
     "Reject",
     "Return",
+    "Router",
     "ScratchIndex",
     "ScratchLoad",
     "ScratchSlot",
diff --git a/pyteal/ast/__init__.py b/pyteal/ast/__init__.py
index 43efc9004..342e73d44 100644
--- a/pyteal/ast/__init__.py
+++ b/pyteal/ast/__init__.py
@@ -136,6 +136,8 @@
 from pyteal.ast.maybe import MaybeValue
 from pyteal.ast.multi import MultiValue
 
+from pyteal.ast.router import Router
+
 # abi
 import pyteal.ast.abi as abi  # noqa: I250
 
@@ -273,5 +275,6 @@
     "For",
     "Break",
     "Continue",
+    "Router",
     "abi",
 ]
diff --git a/pyteal/ast/abi/router.py b/pyteal/ast/router.py
similarity index 100%
rename from pyteal/ast/abi/router.py
rename to pyteal/ast/router.py
index 375820eca..ca1364282 100644
--- a/pyteal/ast/abi/router.py
+++ b/pyteal/ast/router.py
@@ -4,12 +4,12 @@
 from pyteal.config import METHOD_ARG_NUM_LIMIT
 from pyteal.errors import TealInputError
 from pyteal.types import TealType
+from pyteal.ast.subroutine import SubroutineFnWrapper
 from pyteal.ast.cond import Cond
 from pyteal.ast.expr import Expr
 from pyteal.ast.app import OnComplete, EnumInt
 from pyteal.ast.int import Int
 from pyteal.ast.seq import Seq
-from pyteal.ast.subroutine import SubroutineFnWrapper
 from pyteal.ast.methodsig import MethodSignature
 from pyteal.ast.naryexpr import And, Or
 from pyteal.ast.txn import Txn


Test patch:
diff --git a/pyteal/ast/abi/router_test.py b/pyteal/ast/router_test.py
similarity index 100%
rename from pyteal/ast/abi/router_test.py
rename to pyteal/ast/router_test.py