8000 [account address] Cleanup multiple to string & from string implementations · Issue #53 · move-language/move · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 4, 2024. It is now read-only.

[account address] Cleanup multiple to string & from string implementations #53

Open
gregnazario opened this issue Apr 18, 2022 · 3 comments
Open
8000

Comments

@gregnazario
Copy link
Collaborator

I made the previous change to make 0x more prevalent in the account address outputs, but it's clear to me that there are too many ways to display the account addresses and it adds a lot of confusion.

I'm going to clean it up so that there are less implementations and that it's straightforward at that point.

@gregnazario
Copy link
Collaborator Author

cc @areshand I'm working on this right now

@gregnazario
Copy link
Collaborator Author

Seems to me there are currently 3 use cases:

for 0x00000000abcd

(to & from hex_literal and also display/debug) To & From Hex -> 0xabcd
(short_str_lossless) To short str as identifier -> abcd
(a currently non existent function) And for some time fuzzy matching back to address without 0x -> abcd

One I want to remove which is confusing is (to_hex, from_hex), which doesn't take a 0x, and has to be exactly the right length number of bytes

@tnowacki would you agree with me? So, I can move forward on this?

Also, what's your opinion on lowercase vs uppercase, since short_str_lossless is lowercase and display is uppercase

@tnowacki
Copy link
Member

Thanks for looking at this! It has always annoyed me, which is partially why the source language's parsing/rendering is its own thing :P

I think I agree with the setup you have described with to/from hex and short_str_lossless and maybe this "fuzzy" matching back. But it will be easier for me to know for sure when I see the code.

And I would love to do uppercase by default if we don't already! I think both @sblackshear and myself tried to do that on separate occasions but got frustrated with the amount of breakages

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0