-
-
Notifications
You must be signed in to change notification settings - Fork 788
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
Basic type conversions from address
type
#1524
Basic type conversions from address
type
#1524
Conversation
address
type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor note.
vyper/types/convert.py
Outdated
[ | ||
'signextend', | ||
15, | ||
['and', in_arg, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using SizeLimits here would be cleaner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SizeLimits.ADDRSIZE specifically :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacqueswww ah good call! 😅 I had overlooked that that constant existed — will make this change tonight.
@jacqueswww fixed! |
Is uint256 conversion implemented here? I don’t see it; only decimal, int128 and bool. Also, I don’t see these changes in the docs |
I believe it is implemented, yes. Good catch, that should definitely be documented. |
What I did
Implements missing conversions from
address
to other basic types, as specified in #1093 — note conversion fromaddress
tobytes
type has yet to be implemented, but was holding off on this for this specific PR as there are also a handful of other conversions tobytes
type that need to be implemented still and feel that could just be its own PR.How I did it
Updated
convert.py
to support new conversions.How to verify it
Run the tests
make test
Description for the changelog
Add missing conversions from
address
type to other basic typesCute Animal Picture