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

add all integer and bytes types #2705

Merged
merged 17 commits into from
Mar 18, 2022

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Mar 17, 2022

What I did

resolves #2559

Commit message

This commit adds all intN/uintN/bytesM types, bringing vyper to full
implementation of ABIv2 (technically in line with solidity as they do
not have fixedMxN/ufixedMxN types). Practically speaking, these are the
types that people will expect to be able to use.

The implementation is a first pass. It generates the new types with
Python dynamic class generation since the vyper/semantics type system
has a 1:1 correspondence between Vyper and Python types. Future work
should include a generous refactoring of the approach. Before release,
we need to add more tests of arithmetic, and any builtin functions which
accept integers and bytesM types.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2022

Codecov Report

Merging #2705 (5c2d279) into master (a125a88) will decrease coverage by 0.81%.
The diff coverage is 95.77%.

❗ Current head 5c2d279 differs from pull request most recent head 488ed40. Consider uploading reports for the commit 488ed40 to get more accurate results

@@            Coverage Diff             @@
##           master    #2705      +/-   ##
==========================================
- Coverage   86.98%   86.17%   -0.82%     
==========================================
  Files          91       91              
  Lines        9846     9845       -1     
  Branches     2469     2465       -4     
==========================================
- Hits         8565     8484      -81     
- Misses        798      871      +73     
- Partials      483      490       +7     
Impacted Files Coverage Δ
vyper/semantics/types/value/array_value.py 92.94% <ø> (ø)
vyper/codegen/core.py 83.26% <57.14%> (-0.32%) ⬇️
vyper/builtin_functions/functions.py 83.11% <100.00%> (-6.14%) ⬇️
vyper/builtin_functions/signatures.py 73.91% <100.00%> (+2.17%) ⬆️
vyper/codegen/types/convert.py 88.23% <100.00%> (+0.35%) ⬆️
vyper/codegen/types/types.py 86.73% <100.00%> (ø)
vyper/semantics/environment.py 100.00% <100.00%> (ø)
vyper/semantics/types/__init__.py 100.00% <100.00%> (ø)
vyper/semantics/types/abstract.py 100.00% <100.00%> (ø)
vyper/semantics/types/function.py 84.92% <100.00%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a125a88...488ed40. Read the comment docs.

@charles-cooper charles-cooper changed the title More types add all integer and bytes types Mar 18, 2022
@charles-cooper charles-cooper force-pushed the more_types branch 2 times, most recently from 550c4c1 to bc6e7bd Compare March 18, 2022 18:35
@charles-cooper charles-cooper marked this pull request as ready for review March 18, 2022 18:50
Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of so many type in gore's is a bit of an issue for me, but can be refactored later

vyper/codegen/types/types.py Show resolved Hide resolved
vyper/semantics/types/value/numeric.py Show resolved Hide resolved
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Mar 18, 2022

This pull request introduces 1 alert when merging d1d09bf into a125a88 - view on LGTM.com

new alerts:

  • 1 for Duplicate key in dict literal

This commit adds all intN/uintN/bytesM types, bringing Vyper to full
implementation of ABIv2 (technically in line with solidity as they do
not have fixedMxN/ufixedMxN types). Practically speaking, these are the
types that people will expect to be able to use.

The implementation is a first pass. It generates the new types with
Python dynamic class generation since the vyper/semantics type system
has a 1:1 correspondence between Vyper and Python types. Future work
should include a generous refactoring of the approach. Before release,
we need to add more tests of arithmetic, and any builtin functions which
accept integers and bytesM types.
@charles-cooper charles-cooper merged commit 7b2397b into vyperlang:master Mar 18, 2022
@charles-cooper charles-cooper deleted the more_types branch March 18, 2022 23:04
@charles-cooper charles-cooper mentioned this pull request Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VIP: more integer and bytes types
3 participants