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

rpc: fix address formatting in TransactionRequest Display #8786

Merged
merged 2 commits into from Jun 5, 2018

Conversation

andresilva
Copy link
Contributor

@andresilva andresilva commented Jun 4, 2018

This is how the from address looked using the signer cli:

❯ ./target/debug/parity signer sign
Password:

#1: 1 ETH from 0xSome(00a329c0648769a73afac7f9381e08fb43dbea72) to 0x00a329c0648769a73afac7f9381e08fb43dbea72 coming from http://127.0.0.1:8180 via UI (session: bd..74)
Sign this transaction? (y)es/(N)o/(r)eject: y

@andresilva andresilva added A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). M6-rpcapi 📣 RPC API. M7-signer 🔏 Trusted signer. labels Jun 4, 2018
Copy link
Contributor

@ascjones ascjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@5chdn 5chdn added this to the 1.12 milestone Jun 4, 2018
@@ -69,14 +69,16 @@ 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("?".to_string())),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unwrap_or_else(|| "?".into())

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("?".to_string())),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unwrap_or_else(|| "?".into())

Copy link
Collaborator

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just replace unwrap_or with unwrap_or_else and it's good!

@niklasad1 niklasad1 added the A8-looksgood 🦄 Pull request is reviewed well. label Jun 4, 2018
@5chdn 5chdn merged commit b3ea766 into master Jun 5, 2018
@5chdn 5chdn deleted the andre/fix-tx-request-display-fmt branch June 5, 2018 07:58
ordian added a commit to ordian/parity that referenced this pull request Jun 6, 2018
…rp_sync_on_light_client

* 'master' of https://github.com/paritytech/parity:
  Remove UI related settings from CLI (openethereum#8783)
  Remove windows tray and installer (openethereum#8778)
  docs: add changelogs for 1.10.6 and 1.11.3 (openethereum#8810)
  Fix ancient blocks queue deadlock (openethereum#8751)
  Disallow unsigned transactions in case EIP-86 is disabled (openethereum#8802)
  Fix evmbin compilation (openethereum#8795)
  Have space between feature cfg flag (openethereum#8791)
  rpc: fix address formatting in TransactionRequest Display (openethereum#8786)
dvdplm added a commit that referenced this pull request Jun 7, 2018
…eric

* origin/master:
  ethcore: fix ancient block error msg handling (#8832)
  CI: Fix docker tags (#8822)
  parity: fix indentation in sync logging (#8794)
  Removed obsolete IpcMode enum (#8819)
  Remove UI related settings from CLI (#8783)
  Remove windows tray and installer (#8778)
  docs: add changelogs for 1.10.6 and 1.11.3 (#8810)
  Fix ancient blocks queue deadlock (#8751)
  Disallow unsigned transactions in case EIP-86 is disabled (#8802)
  Fix evmbin compilation (#8795)
  Have space between feature cfg flag (#8791)
  rpc: fix address formatting in TransactionRequest Display (#8786)
  Conditionally compile ethcore public test helpers (#8743)
  Remove Result wrapper from AccountProvider in RPC impls (#8763)
  Update `license header` and `scripts` (#8666)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). A8-looksgood 🦄 Pull request is reviewed well. M6-rpcapi 📣 RPC API. M7-signer 🔏 Trusted signer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants