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

Display readable names for known addresses #2816

Merged
merged 6 commits into from
Oct 14, 2021
Merged

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Oct 11, 2021

What it solves

Resolves #1866 (showing names in transaction lists)

How this PR fixes it

Instead of the default text (now used as fallback), the name/logoUri in each transaction is displayed in the transaction list. If a name is present in the address book, that takes priority.

How to test it

Open historical/queued transactions and check that there are names/logos.

Screenshots

image

@iamacook iamacook marked this pull request as draft October 11, 2021 15:19
@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Oct 11, 2021

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 1 0
Ignored 0 N/A
  • Result: ✅ success

  • Annotations: 1 total


[warning] react-hooks/exhaustive-deps

verifies the list of dependencies for Hooks like useEffect and similar


Report generated by eslint-plus-action

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

github-actions bot commented Oct 11, 2021

E2E Tests Passed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1332675576

@iamacook iamacook marked this pull request as ready for review October 12, 2021 09:21
setType({ icon: isSendTx ? OutgoingTxIcon : IncomingTxIcon, text: isSendTx ? 'Send' : 'Receive' })

const icon = isSendTx ? OutgoingTxIcon : IncomingTxIcon
const text = toAddress?.name ?? isSendTx ? 'Send' : 'Receive'
Copy link
Member

Choose a reason for hiding this comment

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

So if there's no name it won't display anything?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will show 'Send' or 'Receive' as it was before.

const icon = knownAddress.isAddressBook
? CustomTxIcon
: knownAddress.image ?? toAddress?.logoUri ?? CustomTxIcon
const text = knownAddress.isAddressBook ? knownAddress.name : toAddress?.name ?? 'Contract interaction'
Copy link
Member

@katspaugh katspaugh Oct 12, 2021

Choose a reason for hiding this comment

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

Why not just

const text = knownAddress.name || toAddress?.name || 'Contract interaction'

?

@iamacook iamacook requested a review from katspaugh October 12, 2021 09:53
Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Looketh Goode!


setType({
icon: isSendTx ? OutgoingTxIcon : IncomingTxIcon,
text: knownAddressBookAddress.name || toAddress?.name || isSendTx ? 'Send' : 'Receive',
Copy link
Member

@katspaugh katspaugh Oct 12, 2021

Choose a reason for hiding this comment

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

I think you might need a set of parens here
Screenshot 2021-10-12 at 11 56 41

@francovenica
Copy link
Contributor

Notes:
Since I don't have a safe with tx from "known" names that I know of and I don't have control over the known safes list, I just took the list we already have here and made tx to them or with them as recipient

Also I cannot use mainnet prod and this mainnet prod because its services are different, therefore they might show different names, like this:
10-12-2021_x(3147)


The following is a comparison between this PR and pr2793 that doesn't have this fix. First is shown how in the Other PR the name is "Sent" and in this new one the name is the "known name".
10-12-2021_x(3149)

Here I was only able to check it by sending funds to those known addresses, but any type of "contract interaction" type of tx were, in both PRs, have the name recognized just fine
The safes:
https://pr2816--safereact.review.gnosisdev.com/rinkeby/app/#/safes/0x9913B9180C20C6b0F21B6480c84422F6ebc4B808/balances
https://pr2793--safereact.review.gnosisdev.com/rinkeby/app/#/safes/0x9913B9180C20C6b0F21B6480c84422F6ebc4B808/transactions

So far it looks fine, but I'll check with Liliya if she has a safe where we can see something in the history where those known

@iamacook
Copy link
Member Author

Notes: Since I don't have a safe with tx from "known" names that I know of and I don't have control over the known safes list, I just took the list we already have here and made tx to them or with them as recipient

Also I cannot use mainnet prod and this mainnet prod because its services are different, therefore they might show different names, like this: 10-12-2021_x(3147)

The following is a comparison between this PR and pr2793 that doesn't have this fix. First is shown how in the Other PR the name is "Sent" and in this new one the name is the "known name". 10-12-2021_x(3149)

Here I was only able to check it by sending funds to those known addresses, but any type of "contract interaction" type of tx were, in both PRs, have the name recognized just fine The safes: https://pr2816--safereact.review.gnosisdev.com/rinkeby/app/#/safes/0x9913B9180C20C6b0F21B6480c84422F6ebc4B808/balances https://pr2793--safereact.review.gnosisdev.com/rinkeby/app/#/safes/0x9913B9180C20C6b0F21B6480c84422F6ebc4B808/transactions

So far it looks fine, but I'll check with Liliya if she has a safe where we can see something in the history where those known

This is a safe with named transactions. I believe it's Liliya's.

@francovenica
Copy link
Contributor

Checked that safe, and yes, it shows known addresses as well, (mostly a lili's safe that was added to the list)

Looks good to me

@francovenica
Copy link
Contributor

This ticket was kicked back since it seems that there are more requirements that were not fulfilled. We have to check what is the real scope of this ticket

@iamacook
Copy link
Member Author

This ticket was kicked back since it seems that there are more requirements that were not fulfilled. We have to check what is the real scope of this ticket

Please see my comment here. @francovenica

@liliya-soroka
Copy link
Member

@iamacook , @katspaugh "known addresses" were missed on transaction details for incoming/outgoing txs
We should not change it in transactions list for incoming and outgoing txs
From my comment
"The addresses are not taken from the known address list on transaction details. - Outgoing tx /Incoming txs.
Only custom transaction was covered in known addresses v1"

@katspaugh katspaugh merged commit c64ea1d into dev Oct 14, 2021
@katspaugh katspaugh deleted the display-known-addresses branch October 14, 2021 07:19
@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2 Display human readable names for "Known" addresses
4 participants