Skip to content

Commit

Permalink
feat(cli): adds hex version of address to addresses command (#960)
Browse files Browse the repository at this point in the history
* feat: add hex version of address to `addresses` output
  • Loading branch information
qrayven authored Jul 28, 2023
1 parent 67cb327 commit 83a8c12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

`WalletCommand::Accounts` variant to list all available accounts in a wallet;
- `WalletCommand::Accounts` variant to list all available accounts in a wallet;
- `addresses` now additionally prints the hex version of the address;

## 1.0.0 - 2023-07-27

Expand Down
9 changes: 8 additions & 1 deletion cli/src/command/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,14 @@ pub async fn voting_output_command(account: &Account) -> Result<(), Error> {
}

async fn print_address(account: &Account, address: &AccountAddress) -> Result<(), Error> {
let mut log = format!("Address {}: {}", address.key_index(), address.address());
let mut log = format!(
"Address {}:\n {:<10}{}\n {:<10}{:?}",
address.key_index(),
"Bech32:",
address.address(),
"Hex:",
address.address().inner()
);

if *address.internal() {
log = format!("{log}\nChange address");
Expand Down

0 comments on commit 83a8c12

Please sign in to comment.