Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
rpc: fix address formatting in TransactionRequest Display (#8786)
Browse files Browse the repository at this point in the history
* rpc: fix address formatting in TransactionRequest Display

* rpc: use unwrap_or_else when no to address provided
  • Loading branch information
andresilva authored and 5chdn committed Jun 5, 2018
1 parent e2a90ce commit b3ea766
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rpc/src/v1/types/transaction_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,20 @@ impl fmt::Display for TransactionRequest {
f,
"{} ETH from {} to 0x{:?}",
Colour::White.bold().paint(format_ether(eth)),
Colour::White.bold().paint(format!("0x{:?}", self.from)),
Colour::White.bold().paint(
self.from.as_ref()
.map(|f| format!("0x{:?}", f))
.unwrap_or_else(|| "?".to_string())),
to
),
None => write!(
f,
"{} ETH from {} for contract creation",
Colour::White.bold().paint(format_ether(eth)),
Colour::White.bold().paint(format!("0x{:?}", self.from)),
Colour::White.bold().paint(
self.from.as_ref()
.map(|f| format!("0x{:?}", f))
.unwrap_or_else(|| "?".to_string())),
),
}
}
Expand Down

0 comments on commit b3ea766

Please sign in to comment.