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

fix: format units according to asset decimals + unknown asset #115

Merged
merged 6 commits into from
Nov 15, 2023

Conversation

LuizAsFight
Copy link
Contributor

@LuizAsFight LuizAsFight commented Nov 14, 2023

Closes FE-31

this PR address fully the format of amounts being showed across the explorer. will format to assets decimal config OR format the raw amount if it’s a unknown asset (unknown asset decimals)

  • update to fuels/assets@0.1.3 to get new asset utils functions
  • share assetId with components that didn’t have it
  • apply correct amount formatted to this pages/components
    • BalanceItem
    • Utxos
    • TxAssetItem
    • TxInput
    • TxOutput

Copy link
Contributor

github-actions bot commented Nov 14, 2023

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 100% 0/0
🟢 Branches 100% 0/0
🟢 Functions 100% 0/0
🟢 Lines 100% 0/0

Test suite run success

0 tests passing in 0 suite.

Report generated by 🧪jest coverage report action from 1170dbf

Copy link

linear bot commented Nov 15, 2023

FE-31 Unknown assets should have units 0 by default

When working with custom assets that we don't have the metadata, is not a good thing to format by default with 9 decimals, to avoid this let's fix default units for unknown assets to 0.

This should affect all places that have asset balance.

Screenshot 2023-11-10 at 5.20.53 PM.png

@LuizAsFight LuizAsFight marked this pull request as ready for review November 15, 2023 15:40
@LuizAsFight LuizAsFight self-assigned this Nov 15, 2023
Copy link
Member

@luizstacio luizstacio left a comment

Choose a reason for hiding this comment

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

The amount format is great, but it should not have any decimal... as a decimal .0 for integer means one more 0 that don't exist.

Account example: https://fuel-explorer-j0r8fpcif-fuel-labs.vercel.app/account/fuel18e7amfxs60urq7h97xhdsa3rnykpcn0valkxsjfkjcrh2xqmyvpq4ay9jn It should be showing 1,052,399,877 only.

@LuizAsFight LuizAsFight merged commit fe981bd into main Nov 15, 2023
7 checks passed
@LuizAsFight LuizAsFight deleted the lf/fix/format-units branch November 15, 2023 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants