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

feat: add bech32-convert to gaia #1788

Closed
5 tasks
glnro opened this issue Oct 5, 2022 · 2 comments
Closed
5 tasks

feat: add bech32-convert to gaia #1788

glnro opened this issue Oct 5, 2022 · 2 comments
Labels
good first issue Good for newcomers help wanted Open for all. You do not need permission to work on these. nice to have

Comments

@glnro
Copy link
Contributor

glnro commented Oct 5, 2022

Summary

Add the bech32-convert subcommand to debug that is currently implemented in osmosis. This would serve as a general UX improvement as well as prepare for future roadmap features like bech32 forwarding.

Problem Definition

If a user wishes to convert a bech32 address to the equivalent on another chain, there is currently no way to do this via the gaia cli.

Proposal

Implement ConvertBech32Cmd in gaia according to osmosis' command. Nice to have implementation could also include abstracting the logic out into a separate helper function.

The command should natively convert any address to the cosmos prefix, and accept a flag for an alternative chain prefix.

Acceptance Criteria

  1. Should natively convert any valid bech32 address to a cosmos prefixed address
    Input:
    gaiad debug bech32-convert akash1a6zlyvpnksx8wr6wz8wemur2xe8zyh0ytz6d88
    Output:
    cosmos1a6zlyvpnksx8wr6wz8wemur2xe8zyh0yxeh27a

  2. Should convert any valid bech32 address to the prefixed address
    Input:
    gaiad debug bech32-convert cosmos1a6zlyvpnksx8wr6wz8wemur2xe8zyh0yxeh27a --prefix osmo
    Output:
    osmo1a6zlyvpnksx8wr6wz8wemur2xe8zyh0ywzy6g0

  3. Should return the same address if converting a native address
    Input:
    gaiad debug bech32-convert cosmos1a6zlyvpnksx8wr6wz8wemur2xe8zyh0yxeh27a
    Output:
    cosmos1a6zlyvpnksx8wr6wz8wemur2xe8zyh0yxeh27a


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
  • Is a spike necessary to map out how the issue should be approached?
@glnro glnro added help wanted Open for all. You do not need permission to work on these. good first issue Good for newcomers nice to have labels Oct 5, 2022
@ivanovpetr
Copy link
Contributor

Would be happy to work on it!

@okwme
Copy link
Contributor

okwme commented Oct 31, 2022

thank you @ivanovpetr !!!

@okwme okwme closed this as completed Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Open for all. You do not need permission to work on these. nice to have
Projects
None yet
Development

No branches or pull requests

3 participants