-
-
Notifications
You must be signed in to change notification settings - Fork 808
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
chore: improve error message for invalid address literal #3621
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3621 +/- ##
===========================================
- Coverage 85.19% 68.77% -16.43%
===========================================
Files 92 92
Lines 13916 13923 +7
Branches 3118 3119 +1
===========================================
- Hits 11856 9575 -2281
- Misses 1565 3629 +2064
- Partials 495 719 +224 ☔ View full report in Codecov by Sentry. |
interesting .. did vyper/tests/ast/nodes/test_hex.py Line 9 in 7b9d159
also, is vyper/vyper/semantics/types/primitives.py Line 339 in 7b9d159
|
It's actually not dead code, because On second thought, I think a better way is to add an early return for Also, the AST test still passes because I had |
discussed offline -- it's a bit weird as there are actually two (three?) different places which construct similar error messages |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as spam.
This comment was marked as spam.
another issue is the literal check will fail even if the user doesn't want an address, e.x.: vyper.exceptions.BadChecksumAddress: Address checksum mismatch. If you are sure this is the right address, the correct checksummed form is: 0x5124fcC2B3F99F571AD67D075643C743F38f1C34
contract "tmp/repro2.vy:4", function "foo", line 4:15
3 def foo():
---> 4 x: uint8 = 0x5124fcc2b3f99f571ad67d075643c743f38f1C34
----------------------^
5 |
What I did
Fix #3611
How I did it
Add
BadChecksumAddress
exception and catch it.How to verify it
See tests.
Commit message
chore: improve error message for address literal
Description for the changelog
Improve error mesage for address literal that is not checksummed
Cute Animal Picture