From f5acab14115daed03aed1dffd98fe27444031cba Mon Sep 17 00:00:00 2001 From: Aleksandr Karbyshev Date: Wed, 31 Jan 2024 15:29:29 +0100 Subject: [PATCH 1/2] Print generated payment address --- crates/apps/src/lib/cli/wallet.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/apps/src/lib/cli/wallet.rs b/crates/apps/src/lib/cli/wallet.rs index 3ce69521e4..7366cab806 100644 --- a/crates/apps/src/lib/cli/wallet.rs +++ b/crates/apps/src/lib/cli/wallet.rs @@ -317,15 +317,12 @@ 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); @@ -333,7 +330,8 @@ fn payment_address_gen( 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, ); } From 9d25ee872a1623ab88e82ef632a5d19c0ffda045 Mon Sep 17 00:00:00 2001 From: Aleksandr Karbyshev Date: Wed, 31 Jan 2024 15:40:42 +0100 Subject: [PATCH 2/2] Add changelog --- .../improvements/2490-wallet-display-gen-payment-addr.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/unreleased/improvements/2490-wallet-display-gen-payment-addr.md diff --git a/.changelog/unreleased/improvements/2490-wallet-display-gen-payment-addr.md b/.changelog/unreleased/improvements/2490-wallet-display-gen-payment-addr.md new file mode 100644 index 0000000000..5c203dc020 --- /dev/null +++ b/.changelog/unreleased/improvements/2490-wallet-display-gen-payment-addr.md @@ -0,0 +1,2 @@ +- Wallet: print the generated payment address. + ([\#2490](https://github.com/anoma/namada/pull/2490)) \ No newline at end of file