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

Added address hrp as a config entry #458

Merged
merged 3 commits into from
Dec 2, 2024
Merged

Added address hrp as a config entry #458

merged 3 commits into from
Dec 2, 2024

Conversation

popenta
Copy link
Contributor

@popenta popenta commented Nov 29, 2024

This is needed for sovereign chains where address hrp can be modified.

The hrp can be passed as a command line arg to some commands, but it can also be set by overwriting the default value in the config.

mxpy config set default_address_hrp <new-hrp>

@popenta popenta self-assigned this Nov 29, 2024
@popenta popenta marked this pull request as draft November 29, 2024 13:00
@popenta popenta marked this pull request as ready for review December 2, 2024 09:24
andreibancioiu
andreibancioiu previously approved these changes Dec 2, 2024
@@ -288,7 +290,8 @@ def do_bech32(args: Any):
value = args.value

if encode:
address = Address.new_from_hex(value, DEFAULT_HRP)
hrp = args.hrp if args.hrp else get_address_hrp()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking, else get_address_hrp() might not be necessary. Since we have default=get_address_hrp(). I did not double check, though, can stay as it is 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, it was not specified as a default value, but that is a better idea.

@popenta popenta merged commit e467c0e into main Dec 2, 2024
10 checks passed
@popenta popenta deleted the TOOL-379-custom-hrp branch December 2, 2024 10:30
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.

3 participants