Skip to content

Commit

Permalink
Merge branch 'aleks/wallet-display-gen-payment-addr' (#2490)
Browse files Browse the repository at this point in the history
* origin/aleks/wallet-display-gen-payment-addr:
  Add changelog
  Print generated payment address
  • Loading branch information
brentstone committed Feb 2, 2024
2 parents 89d080f + 9d25ee8 commit b7f083d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Wallet: print the generated payment address.
([\#2490](https://github.com/anoma/namada/pull/2490))
12 changes: 5 additions & 7 deletions crates/apps/src/lib/cli/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,23 +319,21 @@ fn payment_address_gen(
let alias = alias.to_lowercase();
let viewing_key = ExtendedFullViewingKey::from(viewing_key).fvk.vk;
let (div, _g_d) = find_valid_diversifier(&mut OsRng);
let payment_addr = viewing_key
let masp_payment_addr = viewing_key
.to_payment_address(div)
.expect("a PaymentAddress");
let payment_addr = PaymentAddress::from(masp_payment_addr).pinned(pin);
let alias = wallet
.insert_payment_addr(
alias,
PaymentAddress::from(payment_addr).pinned(pin),
alias_force,
)
.insert_payment_addr(alias, payment_addr, alias_force)
.unwrap_or_else(|| {
edisplay_line!(io, "Payment address not added");
cli::safe_exit(1);
});
wallet.save().unwrap_or_else(|err| eprintln!("{}", err));
display_line!(
io,
"Successfully generated a payment address with the following alias: {}",
"Successfully generated payment address {} with alias {}",
payment_addr,
alias,
);
}
Expand Down

0 comments on commit b7f083d

Please sign in to comment.