Skip to content

Commit

Permalink
Updated after conflicts with #3393
Browse files Browse the repository at this point in the history
  • Loading branch information
hansieodendaal committed Sep 30, 2021
1 parent c51fe94 commit db07817
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,13 @@ impl TransactionsTab {
};
let direction = Span::styled(format!("{}", tx.direction), Style::default().fg(Color::White));
let amount = Span::styled(format!("{}", tx.amount), Style::default().fg(Color::White));
let fee_details = if tx.is_coinbase() {
let fee_details = if tx.is_coinbase {
Span::raw("")
} else {
Span::styled(
format!(
" (weight: {}g, #inputs: {}, #outputs: {})",
tx.transaction.calculate_weight(),
tx.transaction.body.inputs().len(),
tx.transaction.body.outputs().len()
tx.weight, tx.inputs_count, tx.outputs_count
),
Style::default().fg(Color::Gray),
)
Expand Down
18 changes: 13 additions & 5 deletions applications/tari_console_wallet/src/ui/state/app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,10 @@ pub struct CompletedTransactionInfo {
pub direction: TransactionDirection,
pub valid: bool,
pub mined_height: Option<u64>,
pub is_coinbase: bool,
pub weight: u64,
pub inputs_count: usize,
pub outputs_count: usize,
}

impl From<CompletedTransaction> for CompletedTransactionInfo {
Expand All @@ -892,8 +896,8 @@ impl From<CompletedTransaction> for CompletedTransactionInfo {

Self {
tx_id: completed_transaction.tx_id,
source_public_key: completed_transaction.source_public_key,
destination_public_key: completed_transaction.destination_public_key,
source_public_key: completed_transaction.source_public_key.clone(),
destination_public_key: completed_transaction.destination_public_key.clone(),
amount: completed_transaction.amount,
fee: completed_transaction.fee,
excess_signature,
Expand All @@ -904,13 +908,17 @@ impl From<CompletedTransaction> for CompletedTransactionInfo {
.first()
.map(|o| o.features.maturity)
.unwrap_or_else(|| 0),
status: completed_transaction.status,
message: completed_transaction.message,
status: completed_transaction.status.clone(),
message: completed_transaction.message.clone(),
timestamp: completed_transaction.timestamp,
cancelled: completed_transaction.cancelled,
direction: completed_transaction.direction,
direction: completed_transaction.direction.clone(),
valid: completed_transaction.valid,
mined_height: completed_transaction.mined_height,
is_coinbase: completed_transaction.is_coinbase(),
weight: completed_transaction.transaction.calculate_weight(),
inputs_count: completed_transaction.transaction.body.inputs().len(),
outputs_count: completed_transaction.transaction.body.outputs().len(),
}
}
}
Expand Down

0 comments on commit db07817

Please sign in to comment.