Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: front-end type system #2974

Merged
Merged
Show file tree
Hide file tree
Changes from 166 commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
5a395dc
wip - rename BaseTypePrimitive to VyperType, BaseTypeDefinition to Va…
charles-cooper Jul 14, 2022
aa1af24
rework type_from_annotation
charles-cooper Jul 14, 2022
5872c62
wip rework struct types
charles-cooper Jul 14, 2022
0d94be1
wip: rename from_literal
charles-cooper Jul 14, 2022
17b9d38
wip clean up types.bases
charles-cooper Jul 18, 2022
3a00517
merge indexable
charles-cooper Jul 18, 2022
20466ff
merge user types
charles-cooper Jul 18, 2022
0ee6b90
merge value types
charles-cooper Jul 18, 2022
3261317
rename bases to common
charles-cooper Jul 18, 2022
91fd7f4
simplify user types
charles-cooper Jul 18, 2022
a1f23b7
Merge branch 'master' into chore/refactor_type_system
charles-cooper Jul 18, 2022
48fb091
simplify indexable types
charles-cooper Jul 18, 2022
c08d586
simplify value types
charles-cooper Jul 18, 2022
e353198
simplify bytestring types
charles-cooper Jul 18, 2022
53de3d1
rename Indexable to Subscriptable
charles-cooper Jul 18, 2022
516a8f7
small cleanup
charles-cooper Jul 18, 2022
73ff40b
more cleanup, add integer types
charles-cooper Jul 20, 2022
502f7fb
cleanup bytesM types
charles-cooper Jul 20, 2022
18dc991
cleanup AttributableT
charles-cooper Jul 20, 2022
476333a
fix some imports
charles-cooper Jul 21, 2022
28f5395
more import fixes
charles-cooper Jul 21, 2022
f92f222
simplify types/__init__.py
charles-cooper Jul 21, 2022
a508336
more simplification
charles-cooper Jul 21, 2022
6941ff7
even more simplification
charles-cooper Jul 21, 2022
091f054
add GenericTypeAcceptor
charles-cooper Jul 21, 2022
00dfa85
update types in builtins
charles-cooper Jul 21, 2022
b959f9e
fix some more bad references
charles-cooper Jul 21, 2022
60e856b
fix namespace assignments
charles-cooper Jul 21, 2022
fc0a7f5
wip namespace assignments
charles-cooper Jul 21, 2022
9b39fd4
refactor environment vars
charles-cooper Jul 22, 2022
4ab0559
it compiles
charles-cooper Jul 22, 2022
34c216e
fix some bugs
charles-cooper Jul 22, 2022
73f193f
a couple more bugs
charles-cooper Jul 22, 2022
31c8b36
fix some lint
charles-cooper Jul 22, 2022
f23f661
fix lint
charles-cooper Jul 22, 2022
65cc4ad
break a couple dependency cycles
charles-cooper Jul 22, 2022
e410e1f
break more deps cycles
charles-cooper Jul 23, 2022
30d06d5
fix more lint
charles-cooper Jul 23, 2022
e754352
fix msg.data
charles-cooper Jul 23, 2022
c827b63
Merge commit 'c3e43d7b8a2e2236e236b9f23c3a8f9a96de349c' into chore/re…
charles-cooper Aug 14, 2022
a503cbc
Merge tag 'v0.3.4' into chore/refactor_type_system
charles-cooper Aug 14, 2022
b54369d
Merge tag 'v0.3.5' into chore/refactor_type_system
charles-cooper Aug 14, 2022
1dd1102
Merge tag 'v0.3.6' into chore/refactor_type_system
charles-cooper Aug 14, 2022
bc3a9fd
Merge branch 'master' into chore/refactor_type_system
charles-cooper Aug 14, 2022
4cbc652
small fixes
charles-cooper Aug 14, 2022
2395cc0
fix an import
charles-cooper Aug 14, 2022
e3fac68
wip: rename ExprTypeChecker to ExprAnalyser,
charles-cooper Aug 16, 2022
4a5f491
add ExprInfo.from_varinfo
charles-cooper Aug 16, 2022
2fa2883
rename validation -> analysis
charles-cooper Aug 17, 2022
ed2d9a9
split out vyper.semantics.analysis.base from vyper.semantics.types.base
charles-cooper Aug 17, 2022
595095b
fix get_expr_info for Attributes
charles-cooper Aug 17, 2022
4523ad2
fix validate_modification
charles-cooper Aug 17, 2022
c401ce8
wip - exprinfo
charles-cooper Aug 20, 2022
3b04db5
remove dead code
charles-cooper Aug 21, 2022
e4b8d1b
get storage positions down into codegen
charles-cooper Aug 21, 2022
5b5fb48
get immutables to work
charles-cooper Aug 21, 2022
044b488
more fixes
charles-cooper Aug 22, 2022
439677b
fix TupleT and SArrayT dependency cycle
charles-cooper Aug 22, 2022
44c819e
fix validate_implements and several other helpers
charles-cooper Aug 23, 2022
ff8f2db
fix compare_type for bytesM, ints
charles-cooper Aug 23, 2022
0bd19df
fix size_in_bytes prop
charles-cooper Aug 23, 2022
278d0f4
fix ast expansion - getter_signature
charles-cooper Aug 23, 2022
2cdcf84
fix prim types
charles-cooper Aug 23, 2022
f56fcd1
Merge commit '55f31f8bc1444aaf2ad65ade45be6900b6212506' into chore/re…
charles-cooper Sep 9, 2022
0355104
Merge commit '5195f64aa8f45e2e65eba2ba15c97118f2aad238' into chore/re…
charles-cooper Sep 9, 2022
732e7d0
Merge commit '915d430525ab6d83b11d45754b5bc6cc1f8f49f9' into chore/re…
charles-cooper Sep 9, 2022
10a0ac1
Merge commit 'be2b7f427bf980a0baf52cdd010d83231824ad3a' into chore/re…
charles-cooper Sep 9, 2022
e7951fe
refactor from_literal
charles-cooper Sep 9, 2022
6f2fda2
refine inheritance hierarchy for vy_ast nodes
charles-cooper Sep 9, 2022
81bea65
fix function arg visitation
charles-cooper Sep 9, 2022
f0c03ad
fix structs
charles-cooper Sep 9, 2022
5d82e3d
format
charles-cooper Sep 9, 2022
d6ba48e
fix lint
charles-cooper Sep 10, 2022
80f3bf0
fix lgtm warnings
charles-cooper Sep 10, 2022
d9f1843
remove dead code
charles-cooper Sep 10, 2022
ec46fd7
fix lint
charles-cooper Sep 10, 2022
ca387b5
rewrite validate_method_ids so it is O(n)
charles-cooper Sep 10, 2022
cf667d6
break a dependency cycle
charles-cooper Sep 10, 2022
4c1f4fd
fix an import
charles-cooper Sep 10, 2022
ebfce57
simplify type_from_annotation logic
charles-cooper Sep 10, 2022
ad4eec0
fix test_pure_types
charles-cooper Sep 10, 2022
3ad9d7b
rename a test directory to match source structure
charles-cooper Sep 10, 2022
6e992d2
fix test_size_in_bytes
charles-cooper Sep 10, 2022
c6c8f5e
fix test_type_from_abi
charles-cooper Sep 10, 2022
0422932
fix test_type_from_annotation
charles-cooper Sep 10, 2022
2e1b3b3
remove dead code
charles-cooper Sep 10, 2022
6936d50
rename tests/functions to tests/builtins
charles-cooper Sep 10, 2022
1de2923
rename tests/.../validation to tests/.../analysis
charles-cooper Sep 10, 2022
f425a67
mark dead code
charles-cooper Sep 10, 2022
d028371
fix some tests in test_potential_types
charles-cooper Sep 10, 2022
028c037
fix test_potential_types
charles-cooper Sep 10, 2022
ae7790e
fix a test
charles-cooper Sep 11, 2022
f525c9a
fix InterfaceT.to_abi_dict
charles-cooper Sep 11, 2022
2bbad3a
fix some tests
charles-cooper Sep 11, 2022
49e319c
fix a couple more tests
charles-cooper Sep 11, 2022
a4babfa
add missing module
charles-cooper Sep 11, 2022
e0ac8c2
separate to_abi_arg and to_toplevel_abi_dict
charles-cooper Sep 12, 2022
8f974b5
couple small fixes
charles-cooper Sep 12, 2022
ab604f3
fix equality checking on user types
charles-cooper Sep 13, 2022
b174d1d
roll back changes to validate_implements
charles-cooper Sep 13, 2022
6f2083f
small fix
charles-cooper Sep 13, 2022
85cf412
fix some bugs around namespacing
charles-cooper Sep 13, 2022
234f692
fix member function validate_modification
charles-cooper Sep 13, 2022
a0f3575
fix a builtin signature
charles-cooper Sep 13, 2022
b42a877
fix minmaxvalue
charles-cooper Sep 13, 2022
212ed12
fix check_kwargable
charles-cooper Sep 13, 2022
430d2b7
fix lint
charles-cooper Sep 13, 2022
93edecb
fix visit_Subscript
charles-cooper Sep 13, 2022
945cb9e
fix some tests
charles-cooper Sep 13, 2022
2fde3f4
fix some bugs
charles-cooper Sep 13, 2022
861dbc3
move some keywords to RESERVED KEYWORDS
charles-cooper Sep 14, 2022
0664f55
wip: fix get_possible_types_from_node semantics
charles-cooper Sep 14, 2022
2fe5c4d
small fixes
charles-cooper Sep 15, 2022
34ea32d
fix get_possible_types_from_node unit tests
charles-cooper Sep 15, 2022
270b6c8
wip: add a comment
charles-cooper Sep 15, 2022
407fee8
wip: fix types_from_Attribute
charles-cooper Sep 15, 2022
7703bbe
fix a bad test
charles-cooper Sep 15, 2022
5e40b1a
fix keccak256 sig
charles-cooper Sep 15, 2022
b6496b6
fix slice signature
charles-cooper Sep 15, 2022
508e8e2
fix tuple repr
charles-cooper Sep 15, 2022
80891d6
fix extract32 sig
charles-cooper Sep 15, 2022
489d864
fix type_from_abi for bytes
charles-cooper Sep 15, 2022
6b6657e
make a type error more specific
charles-cooper Sep 15, 2022
238ce00
fixed a test
charles-cooper Sep 15, 2022
90eae45
fixed some more built-in sigs
charles-cooper Sep 15, 2022
6af88df
fix lint
charles-cooper Sep 15, 2022
ab3e675
wip dead code
charles-cooper Sep 21, 2022
00abef3
Merge branch 'master' into chore/refactor_type_system
z80dev Nov 22, 2022
7ed53a6
fix import and remove usage of abstract type in raw_revert
z80dev Nov 22, 2022
8566ea6
Merge remote-tracking branch 'z80dev/chore/refactor_type_system' into…
charles-cooper Nov 22, 2022
3f95042
remove bad imports
charles-cooper Nov 22, 2022
c76e400
ecrecover bug fix
z80dev Nov 22, 2022
e9718e4
Use TYPE_T when dealing with type-types
z80dev Nov 22, 2022
62969f1
clarify semantics of exprs which are types & ctor semantics
z80dev Nov 23, 2022
63b9595
implement get_member on TYPE_T
z80dev Nov 23, 2022
5798bc5
remove extraneous else
z80dev Nov 23, 2022
c4e7f4e
Change get_member error message
z80dev Nov 23, 2022
cda042b
add _ctor fn to EventT
z80dev Nov 23, 2022
a0ff99f
implement EventT support
z80dev Nov 23, 2022
1483ae2
rename is_typet to is_type_t
z80dev Nov 23, 2022
da84898
update callers of is_typet
z80dev Nov 23, 2022
3304982
fix import
z80dev Nov 23, 2022
9c6dfda
fix some tests
charles-cooper Nov 23, 2022
127c510
fix a missing validation
charles-cooper Nov 25, 2022
34583a7
add include_type_exprs guard back in
charles-cooper Nov 25, 2022
be404a2
fix a test
charles-cooper Nov 25, 2022
cae61c5
fix interface properties
charles-cooper Nov 25, 2022
a8efa8d
add proper indexing exception
charles-cooper Nov 25, 2022
a8d1fd1
fix as_wei_value
charles-cooper Nov 25, 2022
7c00054
fix some tests
charles-cooper Nov 25, 2022
3a3b8b4
fix strict namespace validation
charles-cooper Nov 25, 2022
676c8ba
fix exprinfo for tuples
charles-cooper Nov 25, 2022
8baa3a0
fix struct validation
charles-cooper Nov 25, 2022
893ad54
fix sqrt
charles-cooper Nov 26, 2022
7559e32
fix some lint
charles-cooper Nov 26, 2022
2546c05
fix more lint
charles-cooper Nov 26, 2022
c35e356
fix all mypy and lint
charles-cooper Nov 26, 2022
b006dd9
fix typo
charles-cooper Nov 26, 2022
17eebf0
Merge branch 'master' into chore/refactor_type_system
charles-cooper Nov 26, 2022
e799e5a
fix LGTM complaints
charles-cooper Nov 27, 2022
2d2214e
fix parsing of address literals which are ambiguous with bytes20
charles-cooper Nov 27, 2022
a20bc2e
fix lgtm again
charles-cooper Nov 27, 2022
5857917
fix lint again
charles-cooper Nov 27, 2022
b54dc0c
add a note
charles-cooper Nov 27, 2022
1e10958
refactor builtins directory structure
charles-cooper Nov 27, 2022
7e565bd
fix lgtm lint
charles-cooper Nov 27, 2022
f4816c5
small cleanup
charles-cooper Nov 27, 2022
20f631d
clean up an import
charles-cooper Nov 27, 2022
f65ac28
add a couple notes
charles-cooper Nov 27, 2022
e591c2c
clean up an import
charles-cooper Nov 27, 2022
7e55118
add some notes
charles-cooper Nov 27, 2022
f1f0efa
notes, clean up imports
charles-cooper Nov 27, 2022
7a7a339
fix imports
charles-cooper Nov 27, 2022
789b3ea
add a note
charles-cooper Nov 27, 2022
4faee19
fix an import
charles-cooper Nov 27, 2022
045c37d
add notes
charles-cooper Nov 27, 2022
6303fc2
remove a bad util
charles-cooper Nov 27, 2022
c7e23c4
add a note
charles-cooper Nov 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Vyper includes common built-in interfaces such as `ERC20 <https://eips.ethereum.

implements: ERC20

You can see all the available built-in interfaces in the `Vyper GitHub <https://github.com/vyperlang/vyper/tree/master/vyper/builtin_interfaces>`_ repo.
You can see all the available built-in interfaces in the `Vyper GitHub <https://github.com/vyperlang/vyper/tree/master/vyper/builtins/interfaces>`_ repo.


Implementing an Interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from hypothesis import strategies as st

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn
from vyper.exceptions import OverflowException


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from hypothesis import strategies as st

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn

st_uint256 = st.integers(min_value=0, max_value=2 ** 256 - 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from hypothesis import strategies as st

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn

st_uint256 = st.integers(min_value=0, max_value=2 ** 256 - 1)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn


@pytest.mark.parametrize("typ_name", ["decimal"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from hypothesis import strategies as st

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn

st_decimals = st.decimals(
min_value=-(2 ** 32), max_value=2 ** 32, allow_nan=False, allow_infinity=False, places=10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from hypothesis import strategies as st

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn

denoms = [x for k in vy_fn.AsWeiValue.wei_denoms.keys() for x in k]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from hypothesis import strategies as st

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn

alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()*+,-./:;<=>?@[]^_`{|}~' # NOQA: E501

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn


@pytest.mark.parametrize("length", [0, 1, 32, 33, 64, 65, 1024])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from hypothesis import strategies as st

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn

st_decimals = st.decimals(
min_value=-(2 ** 32), max_value=2 ** 32, allow_nan=False, allow_infinity=False, places=10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from hypothesis import strategies as st

from vyper import ast as vy_ast
from vyper import builtin_functions as vy_fn
from vyper.builtins import functions as vy_fn

st_uint256 = st.integers(min_value=0, max_value=256)

Expand Down
122 changes: 0 additions & 122 deletions tests/functional/context/types/test_pure_types.py

This file was deleted.

59 changes: 0 additions & 59 deletions tests/functional/context/types/test_size_in_bytes.py

This file was deleted.

47 changes: 0 additions & 47 deletions tests/functional/context/types/test_type_from_abi.py

This file was deleted.

Loading