Skip to content

Address checksum validation#2229

Merged
iamdefinitelyahuman merged 3 commits into
vyperlang:masterfrom
iamdefinitelyahuman:fix-address-checksum
Nov 27, 2020
Merged

Address checksum validation#2229
iamdefinitelyahuman merged 3 commits into
vyperlang:masterfrom
iamdefinitelyahuman:fix-address-checksum

Conversation

@iamdefinitelyahuman

@iamdefinitelyahuman iamdefinitelyahuman commented Nov 27, 2020

Copy link
Copy Markdown
Contributor

What I did

Validate address checksums during AST generation.

Closes #2216

How I did it

Since we only use Hex for address and bytes32, I've moved the checksum validation into Hex.validate. This is the earliest point we can catch the issue, and ensures it can't be missed in one of several spots within type checking.

How to verify it

Run the tests. I've added some cases to verify this.

Cute Animal Picture

image

@codecov-io

codecov-io commented Nov 27, 2020

Copy link
Copy Markdown

Codecov Report

Merging #2229 (284c6f3) into master (3f7b622) will increase coverage by 0.00%.
The diff coverage is 85.71%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2229   +/-   ##
=======================================
  Coverage   85.36%   85.36%           
=======================================
  Files          84       84           
  Lines        8541     8544    +3     
  Branches     2064     2065    +1     
=======================================
+ Hits         7291     7294    +3     
  Misses        744      744           
  Partials      506      506           
Impacted Files Coverage Δ
vyper/context/types/value/address.py 91.66% <50.00%> (ø)
vyper/ast/nodes.py 93.49% <100.00%> (+0.03%) ⬆️

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 3f7b622...284c6f3. Read the comment docs.

@iamdefinitelyahuman iamdefinitelyahuman merged commit 2e0d83e into vyperlang:master Nov 27, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-address-checksum branch November 27, 2020 17:16
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.

Non-checksummed address within literal array produces unexpected error

3 participants