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

Give accounts precedence over address_book entries #3732

Merged
merged 3 commits into from
Dec 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/src/redux/providers/personalActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function personalAccountsInfo (accountsInfo) {

Object.keys(accountsInfo || {})
.map((address) => Object.assign({}, accountsInfo[address], { address }))
.filter((account) => !account.meta.deleted)
.filter((account) => account.uuid || !account.meta.deleted)
.forEach((account) => {
if (account.uuid) {
accounts[account.address] = account;
Expand Down
2 changes: 1 addition & 1 deletion js/src/ui/IdentityName/identityName.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class IdentityName extends Component {
render () {
const { address, accountsInfo, tokens, empty, name, shorten, unknown, className } = this.props;
const account = accountsInfo[address] || tokens[address];
const hasAccount = account && (!account.meta || !account.meta.deleted);
const hasAccount = account && (account.uuid || !account.meta || !account.meta.deleted);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think isAccount would be more intuitive here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hasAccount is perfectly acceptable (as it is in the current codebase) since it indicates that the account is in the acocuntsInfo list.

Wontfix.

Copy link
Contributor Author

@jacogr jacogr Dec 7, 2016

Choose a reason for hiding this comment

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

In addition https://github.com/ethcore/parity/pull/3739 removes the line (in this specific file as well as all the others that has the same hasAccount check & naming completely)


if (!hasAccount && empty) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/impls/parity_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<C: 'static> ParityAccounts for ParityAccountsClient<C> where C: MiningBlock
let info = try!(store.accounts_info().map_err(|e| errors::account("Could not fetch account info.", e)));
let other = store.addresses_info().expect("addresses_info always returns Ok; qed");
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated but this proof seems a bit strange


Ok(info.into_iter().chain(other.into_iter()).map(|(a, v)| {
Ok(other.into_iter().chain(info.into_iter()).map(|(a, v)| {
let m = map![
"name".to_owned() => to_value(&v.name),
"meta".to_owned() => to_value(&v.meta),
Expand Down