Skip to content

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

Merged
fubuloubu merged 1 commit into
vyperlang:masterfrom
iamdefinitelyahuman:fix-bytes-ast
Nov 27, 2020
Merged

fix: convert bytes to hex when generating ast dict#2231
fubuloubu merged 1 commit into
vyperlang:masterfrom
iamdefinitelyahuman:fix-bytes-ast

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
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

codecov-io commented Nov 27, 2020

Copy link
Copy Markdown

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.

@fubuloubu fubuloubu left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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