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

fix: convert bytes to hex when generating ast dict #2231

Merged
merged 1 commit into from
Nov 27, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

Represent bytes as hex in the AST output. This fixes an issue where some bytestrings produce compilable code, but cannot be serialized as the AST dict.

Closes #2163

How I did it

See code, pretty self explanatory.

How to verify it

Run tests.

Cute Animal Picture

image

@codecov-io
Copy link

codecov-io commented Nov 27, 2020

Codecov Report

Merging #2231 (9bc71c5) into master (2e0d83e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2231   +/-   ##
=======================================
  Coverage   85.36%   85.37%           
=======================================
  Files          84       84           
  Lines        8544     8545    +1     
  Branches     2065     2065           
=======================================
+ Hits         7294     7295    +1     
  Misses        744      744           
  Partials      506      506           
Impacted Files Coverage Δ
vyper/ast/nodes.py 93.51% <100.00%> (+0.01%) ⬆️

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 2e0d83e...9bc71c5. Read the comment docs.

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.

Test case?

@iamdefinitelyahuman
Copy link
Contributor Author

It's already covered in tests/parser/ast_utils/test_ast_dict.py

@fubuloubu fubuloubu merged commit af27512 into vyperlang:master Nov 27, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-bytes-ast branch December 4, 2020 10:32
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.

Issue generating AST from bytes literal
3 participants