Skip to content

Commit

Permalink
pcli: display ics20 withdrawals in pcli v tx
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence committed Sep 30, 2023
1 parent 3b50080 commit de3a20e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions crates/bin/pcli/src/command/view/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,19 @@ impl TxCmd {
"Claim Liquidity Position Reward".to_string(),
"".to_string(),
],
penumbra_transaction::ActionView::Ics20Withdrawal(_) => {
["Ics20 Withdrawal".to_string(), "".to_string()]
penumbra_transaction::ActionView::Ics20Withdrawal(w) => {
let unit = w.denom.best_unit_for(w.amount);
[
"Ics20 Withdrawal".to_string(),
// TODO: why doesn't format_value include the unit?
format!(
"{}{} via {} to {}",
unit.format_value(w.amount),
unit,
w.source_channel,
w.destination_chain_address,
),
]
}
penumbra_transaction::ActionView::DaoDeposit(_) => {
["Dao Deposit".to_string(), "".to_string()]
Expand Down
1 change: 1 addition & 0 deletions crates/core/component/ibc/src/ics20_withdrawal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub struct Ics20Withdrawal {
// the source channel used for the withdrawal
pub source_channel: ChannelId,
}

impl Ics20Withdrawal {
pub fn value(&self) -> Value {
Value {
Expand Down

0 comments on commit de3a20e

Please sign in to comment.