Skip to content

Basic type conversions from address type#1524

Merged
jacqueswww merged 9 commits into
vyperlang:masterfrom
jakerockland:conversions-from-address
Jul 16, 2019
Merged

Basic type conversions from address type#1524
jacqueswww merged 9 commits into
vyperlang:masterfrom
jakerockland:conversions-from-address

Conversation

@jakerockland

@jakerockland jakerockland commented Jul 10, 2019

Copy link
Copy Markdown
Contributor

What I did

Implements missing conversions from address to other basic types, as specified in #1093 — note conversion from address to bytes 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 to bytes 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 types

Cute Animal Picture

image

@jakerockland jakerockland changed the title Conversions from address Basic type conversions from address type Jul 11, 2019

@jacqueswww jacqueswww 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.

LGTM, just a minor note.

Comment thread vyper/types/convert.py Outdated
[
'signextend',
15,
['and', in_arg, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF],

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.

I think using SizeLimits here would be cleaner?

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.

SizeLimits.ADDRSIZE specifically :)

Copy link
Copy Markdown
Contributor Author

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.

@jakerockland

jakerockland commented Jul 16, 2019

Copy link
Copy Markdown
Contributor Author

@jacqueswww fixed!

@jacqueswww jacqueswww merged commit 95fa21a into vyperlang:master Jul 16, 2019
@outdoteth

Copy link
Copy Markdown

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

@iamdefinitelyahuman

Copy link
Copy Markdown
Contributor

I believe it is implemented, yes. Good catch, that should definitely be documented.

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.

4 participants