feat: add bech32-convert to gaia #1788
Labels
good first issue
Good for newcomers
help wanted
Open for all. You do not need permission to work on these.
nice to have
Summary
Add the
bech32-convert
subcommand todebug
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
Should natively convert any valid bech32 address to a cosmos prefixed address
Input:
gaiad debug bech32-convert akash1a6zlyvpnksx8wr6wz8wemur2xe8zyh0ytz6d88
Output:
cosmos1a6zlyvpnksx8wr6wz8wemur2xe8zyh0yxeh27a
Should convert any valid bech32 address to the prefixed address
Input:
gaiad debug bech32-convert cosmos1a6zlyvpnksx8wr6wz8wemur2xe8zyh0yxeh27a --prefix osmo
Output:
osmo1a6zlyvpnksx8wr6wz8wemur2xe8zyh0ywzy6g0
Should return the same address if converting a native address
Input:
gaiad debug bech32-convert cosmos1a6zlyvpnksx8wr6wz8wemur2xe8zyh0yxeh27a
Output:
cosmos1a6zlyvpnksx8wr6wz8wemur2xe8zyh0yxeh27a
For Admin Use
The text was updated successfully, but these errors were encountered: