From a041ea453bd630ce121d3a2797ce78e37dcef97c Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Mon, 13 Nov 2023 16:25:21 -0800 Subject: [PATCH] pcli: show sender and memo in list-tx-hashes In the future, once the MemoView has an AddressView, we can change this to show the AddressView and show the address structure. --- .../bin/pcli/src/command/view/transaction_hashes.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/bin/pcli/src/command/view/transaction_hashes.rs b/crates/bin/pcli/src/command/view/transaction_hashes.rs index c8557746c5..7b04c1f776 100644 --- a/crates/bin/pcli/src/command/view/transaction_hashes.rs +++ b/crates/bin/pcli/src/command/view/transaction_hashes.rs @@ -1,6 +1,7 @@ use anyhow::Result; use comfy_table::{presets, Table}; use penumbra_keys::FullViewingKey; +use penumbra_transaction::MemoView; use penumbra_view::ViewClient; #[derive(Debug, clap::Args)] @@ -26,12 +27,20 @@ impl TransactionHashesCmd { .transaction_info(self.start_height, self.end_height) .await?; - table.set_header(vec!["Block Height", "Transaction Hash"]); + table.set_header(vec!["Height", "Transaction Hash", "Sender", "Memo"]); for tx_info in txs { + let (sender, memo) = match tx_info.view.body_view.memo_view { + Some(MemoView::Visible { plaintext, .. }) => { + (plaintext.sender.display_short_form(), plaintext.text) + } + _ => (String::new(), String::new()), + }; table.add_row(vec![ format!("{}", tx_info.height), format!("{}", hex::encode(tx_info.id)), + format!("{}", sender), + format!("{}", memo), ]); }