Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDW-663] Use asset policyId+name as unique identifier instead of the fingerprint #2562

Conversation

thedanheller
Copy link
Member

@thedanheller thedanheller commented May 12, 2021

This PR changes the assets identifiers from fingerprint to policyId+name.

Todos

  • Remove any fingertip as asset identifier
  • Add policyId+name as asset identifiers
  • Change the types accordingly
  • Organize Assets types

Testing Checklist

  • There should be no change in the app behavior
  • We need to test anything related to Assets
  • Slack QA thread

Test Cases

Scenario 1: Displayed data is correctly displayed
Given I am on (Wallet Summary | Native Token Settings) screen
When I hover upon the asset
Then the data is correct
And the data matches the data on production build

Scenario 2: Number of decimal places are correctly displayed
Given I am on Native Token Settings dialog
When I select an option under ‘Number of decimal places’
And I select ‘Save’
Then decimal places are correctly displayed on Wallet Summary screen

Scenario 3: Data displayed as expected on Send screen
Given I am on Send Screen
And I have chosen to send native tokens
When I observe the data
Then the data is correct
And the data matches the data on production build

Scenario 4: Data displayed as expected on Transaction screen
Given I am on Transaction Screen
And I have transaction for (Multiple tokens sent | Multiple tokens received)
And the transaction is expanded
When I hover upon the asset
Then the data is correct
And the data matches the data on production build

Scenario 5: Copying Native Token Data displayed as expected on Transaction screen
Given I am on Transaction Screen
And I have transaction for (Multiple tokens sent | Multiple tokens received)
And the transaction is expanded
And I am hovering upon the asset
When I click on individual data
Then the data is copied
And correct toast message is displayed on top of Daedalus

Review Checklist

Basics

  • PR has been assigned and has appropriate labels (feature/bug/chore, release-x.x.x)
  • PR is updated to the most recent version of the target branch (and there are no conflicts)
  • PR has a good description that summarizes all changes
  • PR has default-sized Daedalus window screenshots or animated GIFs of important UI changes:
    • In English
    • In Japanese
  • CHANGELOG entry has been added to the top of the appropriate section (Features, Fixes, Chores) and is linked to the correct PR on GitHub
  • Automated tests: All acceptance and unit tests are passing (yarn test)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in development build (yarn dev)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in production build (yarn package / CI builds)
  • There are no flow errors or warnings (yarn flow:test)
  • There are no lint errors or warnings (yarn lint)
  • There are no prettier errors or warnings (yarn prettier:check)
  • There are no missing translations (running yarn manage:translations produces no changes)
  • Text changes are proofread and approved (Jane Wild / Amy Reeve)
  • Japanese text changes are proofread and approved (Junko Oda)
  • UI changes look good in all themes (Alexander Rukin)
  • Storybook works and no stories are broken (yarn storybook)
  • In case of dependency changes yarn.lock file is updated

Code Quality

  • Important parts of the code are properly commented and documented
  • Code is properly typed with flow
  • React components are split-up enough to avoid unnecessary re-renderings
  • Any code that only works in main process is neatly separated from components

Testing

  • New feature/change is covered by acceptance tests
  • New feature/change is manually tested and approved by QA team
  • All existing acceptance tests are still up-to-date
  • New feature/change is covered by Daedalus Testing scenario
  • All existing Daedalus Testing scenarios are still up-to-date

After Review

  • Merge the PR
  • Delete the source branch
  • Move the ticket to done column on the YouTrack board
  • Update Slack QA thread by marking it with a green checkmark

@thedanheller thedanheller removed the WIP label May 17, 2021
Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

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

Hi @daniloprates, is the reason for this change that since there is not enough screen space to show the full fingerprint, the AssetId may as well be used?

source/renderer/app/api/assets/types.js Outdated Show resolved Hide resolved
source/renderer/app/api/api.js Show resolved Hide resolved
@nikolaglumac
Copy link
Contributor

Hi @daniloprates, is the reason for this change that since there is not enough screen space to show the full fingerprint, the AssetId may as well be used?

No @rvl - this is in order to ensure uniqueness in terms of Daedalus internal asset data handling. So far we treated the fingerprint as the unique identifier which is a false assumption. We are doing this to avoid any future conflicts.

@DominikGuzei DominikGuzei self-requested a review May 18, 2021 10:26
Copy link
Member

@DominikGuzei DominikGuzei left a comment

Choose a reason for hiding this comment

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

Great work 🎉 I just added a few comments 👍

source/renderer/app/api/assets/types.js Outdated Show resolved Hide resolved
source/renderer/app/api/assets/types.js Show resolved Hide resolved
source/renderer/app/utils/assets.js Outdated Show resolved Hide resolved
source/renderer/app/stores/AssetsStore.js Outdated Show resolved Hide resolved
Copy link

@miorsufianiohk miorsufianiohk left a comment

Choose a reason for hiding this comment

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

LGTM. Tested on 18005 👍

Copy link
Member

@DominikGuzei DominikGuzei left a comment

Choose a reason for hiding this comment

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

Code looks great 👍

@nikolaglumac
Copy link
Contributor

@daniloprates I will review and merge this tomorrow morning!

@nikolaglumac
Copy link
Contributor

@gabriela-ponce please make sure to test this one 🙏

@gabriela-ponce
Copy link

@daniloprates This looks good, but I find something that I'm not sure if it's expected and I couldn't reproduce it in develop:

  • After changing the decimal precision for a Native token, the list refreshes on the "Transactions" screen and the order is altered for a second. Check this video.

@thedanheller
Copy link
Member Author

@daniloprates This looks good, but I find something that I'm not sure if it's expected and I couldn't reproduce it in develop:

  • After changing the decimal precision for a Native token, the list refreshes on the "Transactions" screen and the order is altered for a second. Check this video.

Thanks @gabriela-ponce! Fixed.

@ManusMcCole ManusMcCole self-requested a review May 19, 2021 08:42
Copy link

@ManusMcCole ManusMcCole left a comment

Choose a reason for hiding this comment

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

👍

@nikolaglumac nikolaglumac merged commit 502070d into develop May 19, 2021
@iohk-bors iohk-bors bot deleted the chore/ddw-663-use-asset-policyidname-as-unique-identifier-instead-of-the-fingerprint branch May 19, 2021 14:38
@dsc81
Copy link

dsc81 commented May 22, 2021

Hi,
Is that possible to add the token logo too? Instead of just better naming?
I think that would be cool features.
Thank you

@nikolaglumac
Copy link
Contributor

@dsc81 please submit a feature request here https://github.com/input-output-hk/daedalus/issues
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore release-4.1.0-FC1 Daedalus Flight release-4.1.0 Daedalus Mainnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants