Skip to content

Commit

Permalink
Make ABI types fully specified (#222)
Browse files Browse the repository at this point in the history
* Convert Type and Tuple to indexable types

* Convert and combine uint types

* Fix type and unit tests

* Convert Bool

* Fix Tuple getitem

* Convert arrays and array tests

* Fix tuple tests

* [WIP] satisfy mypy

* Refactor ABI types

* Update docs, add Tuple4 and Tuple5, and change type_spec method name

* No longer test on Python 3.6 and 3.7

* No longer test on Python 3.6 and 3.7

* Remove accidentally included file

* Add another literal test case

* Debugging through CI

* blacken

* Remove problematic test case

* Minor test coverage improvements

* Unit test to make sure type_spec_from_annotation always works on all types

* Partially address feedback

* Make uint8 != byte and use typing.Final in a few constructors

* Undo custom set methods

* Fix typo

Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>

Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
  • Loading branch information
jasonpaulos and michaeldiamant authored Mar 18, 2022
1 parent 0ff98a8 commit bfaf1c1
Show file tree
Hide file tree
Showing 20 changed files with 2,670 additions and 1,825 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
container: python:${{ matrix.python }}-slim
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
python: ['3.8', '3.9', '3.10']
steps:
- run: python3 --version
- name: Check out code
Expand Down
60 changes: 54 additions & 6 deletions pyteal/ast/abi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,68 @@
from .type import Type, ComputedType
from .bool import Bool
from .uint import Uint, Byte, Uint8, Uint16, Uint32, Uint64
from .tuple import Tuple
from .array import StaticArray, DynamicArray
from .type import TypeSpec, BaseType, ComputedType
from .bool import BoolTypeSpec, Bool
from .uint import (
UintTypeSpec,
Uint,
ByteTypeSpec,
Byte,
Uint8TypeSpec,
Uint8,
Uint16TypeSpec,
Uint16,
Uint32TypeSpec,
Uint32,
Uint64TypeSpec,
Uint64,
)
from .tuple import (
TupleTypeSpec,
Tuple,
TupleElement,
Tuple0,
Tuple1,
Tuple2,
Tuple3,
Tuple4,
Tuple5,
)
from .array_base import ArrayTypeSpec, Array, ArrayElement
from .array_static import StaticArrayTypeSpec, StaticArray
from .array_dynamic import DynamicArrayTypeSpec, DynamicArray
from .util import type_spec_from_annotation

__all__ = [
"Type",
"TypeSpec",
"BaseType",
"ComputedType",
"BoolTypeSpec",
"Bool",
"UintTypeSpec",
"Uint",
"ByteTypeSpec",
"Byte",
"Uint8TypeSpec",
"Uint8",
"Uint16TypeSpec",
"Uint16",
"Uint32TypeSpec",
"Uint32",
"Uint64TypeSpec",
"Uint64",
"TupleTypeSpec",
"Tuple",
"TupleElement",
"Tuple0",
"Tuple1",
"Tuple2",
"Tuple3",
"Tuple4",
"Tuple5",
"ArrayTypeSpec",
"Array",
"ArrayElement",
"StaticArrayTypeSpec",
"StaticArray",
"DynamicArrayTypeSpec",
"DynamicArray",
"type_spec_from_annotation",
]
Loading

0 comments on commit bfaf1c1

Please sign in to comment.