Skip to content
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

allow underscores or other separators in coin denominations in CLI #3874

Closed
4 tasks
kevlubkcm opened this issue Mar 13, 2019 · 8 comments
Closed
4 tasks

allow underscores or other separators in coin denominations in CLI #3874

kevlubkcm opened this issue Mar 13, 2019 · 8 comments

Comments

@kevlubkcm
Copy link
Contributor

kevlubkcm commented Mar 13, 2019

Summary

Since the base unit is micro-atom, we frequently need to type very large numbers into the CLI which is error prone. Allowing separators will make this easier (a la PEP 515)

Think this is really only necessary in the raw gaiacli interface; could be as simple as as strreplace('_', '') in the argument parser


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

alexanderbez commented Mar 14, 2019

Thing is we cannot use , as a separator because this is used to separate coins. Otherwise, we can do this in ParseCoin/s.

@kevlubkcm
Copy link
Contributor Author

I see. then how about _ like 1_000_000?

@alexanderbez
Copy link
Contributor

We can really use whatever we want really, as in ParseCoin will just strip everything that is not a digit.

@rigelrozanski
Copy link
Contributor

Wait is this already resolved?

@alexanderbez
Copy link
Contributor

I believe from convos I had w/ @jaekwon, we only want to support , and ; (in rare circumstances).

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@tac0turtle
Copy link
Member

_ seems useful for UX in the cli and possibly elsewhere.

@odeke-em
Copy link
Collaborator

Now that Go has since 2019 supported underscores in Go1.13, strconv.ParseInt https://pkg.go.dev/strconv#ParseInt and also after @aaronc's PR #9699 which permitted _ in coin denominations in July 2021
per https://github.com/cosmos/cosmos-sdk/blame/bafe5040f22c55f5053b34bc0d8095b566022f20/types/coin.go#L831 or

reDnmString = `[a-zA-Z][a-zA-Z0-9/:._-]{2,127}`

I think that this issue can now be closed. Kindly pinging @elias-orijtech, could you help quarterback the closing and any related changes for this issue? Thank you

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

No branches or pull requests

5 participants